Fix background call hangup and end calls on screen lock or lid close
This commit is contained in:
1 parent
c7cdde6734
commit
0c352f0a10
55 files changed
+391
-120
No files matched your search
@@ -1880,6 +1880,12 @@ inline DualSimInfo queryDualSimInfo(bool forceRefresh = false) {
|
||||
}
|
||||
|
||||
inline void placePhoneCall(const std::string& rawNumber, int simSlot = 0) {
|
||||
if (isCallActiveOrRingingFast()) {
|
||||
if (!sendPluginCommand("callscreen", "OPEN")) {
|
||||
runAsyncArgv("xcallscreen");
|
||||
}
|
||||
return;
|
||||
}
|
||||
std::string num = normalizePhone(rawNumber);
|
||||
if (num.empty()) {
|
||||
return;
|
||||
@@ -1948,7 +1954,10 @@ inline void closeOtherPlugins(const char* selfPluginName) {
|
||||
}
|
||||
|
||||
inline bool isAnotherPluginActive(const char* selfPluginName) {
|
||||
bool isCallScreenSelf =
|
||||
(selfPluginName && std::strcmp(selfPluginName, "callscreen") == 0);
|
||||
if ((!selfPluginName || std::strcmp(selfPluginName, "locker") != 0) &&
|
||||
!(isCallScreenSelf && isCallActiveOrRingingFast()) &&
|
||||
::access("/tmp/bananarchy_screen_locked", F_OK) == 0) {
|
||||
return true;
|
||||
}
|
||||
@@ -1987,6 +1996,10 @@ inline bool isAnotherPluginActive(const char* selfPluginName) {
|
||||
if (selfPluginName && std::strcmp(p.name, selfPluginName) == 0) {
|
||||
continue;
|
||||
}
|
||||
if (isCallScreenSelf && std::strcmp(p.name, "locker") == 0 &&
|
||||
isCallActiveOrRingingFast()) {
|
||||
continue;
|
||||
}
|
||||
if (isPidFileAlive(getRuntimeFile(p.pidFile))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user