Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6dd45526 authored by Christopher Wiley's avatar Christopher Wiley
Browse files

Fix race in AppOpsManager client library

If the service stays down for more than 10 seconds, client threads
will time out attempting to obtain a reference, and never release
the mutex.  This causes deadlock on the next attempt to speak
with the AppOpsManager.

Test: System without AppOpsManager service no longer hangs in camera
      code.

Change-Id: I5a8ac2f0f35345f72c3d2a45b9d1fc5a78d28a51
parent 2be113a2
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -53,7 +53,8 @@ sp<IAppOpsService> AppOpsManager::getService()
                ALOGI("Waiting for app ops service");
                ALOGI("Waiting for app ops service");
            } else if ((uptimeMillis()-startTime) > 10000) {
            } else if ((uptimeMillis()-startTime) > 10000) {
                ALOGW("Waiting too long for app ops service, giving up");
                ALOGW("Waiting too long for app ops service, giving up");
                return NULL;
                service = NULL;
                break;
            }
            }
            sleep(1);
            sleep(1);
        } else {
        } else {