diff options
author | Eino-Ville Talvala <etalvala@google.com> | 2013-02-19 12:54:57 -0800 |
---|---|---|
committer | Eino-Ville Talvala <etalvala@google.com> | 2013-02-19 18:10:05 -0800 |
commit | e88a85e0d0a25c943e974114557770ba10b81847 (patch) | |
tree | d8872089aea8322195ac333e576a3c9407ac6c60 /libs/binder/AppOpsManager.cpp | |
parent | c4905eb49d20667381f3cda7c6f6894234404bd3 (diff) | |
download | frameworks_native-e88a85e0d0a25c943e974114557770ba10b81847.zip frameworks_native-e88a85e0d0a25c943e974114557770ba10b81847.tar.gz frameworks_native-e88a85e0d0a25c943e974114557770ba10b81847.tar.bz2 |
Fixes to native app ops services
Bug: 8181262
Change-Id: I3d3f20453f6c6f2756c988363c5b5453ef309cb6
Diffstat (limited to 'libs/binder/AppOpsManager.cpp')
-rw-r--r-- | libs/binder/AppOpsManager.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/libs/binder/AppOpsManager.cpp b/libs/binder/AppOpsManager.cpp index 5d36dd2..7ac1b11 100644 --- a/libs/binder/AppOpsManager.cpp +++ b/libs/binder/AppOpsManager.cpp @@ -32,23 +32,21 @@ sp<IAppOpsService> AppOpsManager::getService() int64_t startTime = 0; mLock.lock(); sp<IAppOpsService> service = mService; - while (true) { - if (service == NULL || !service->asBinder()->isBinderAlive()) { - sp<IBinder> binder = defaultServiceManager()->checkService(_appops); - if (binder == NULL) { - // Wait for the app ops service to come back... - if (startTime == 0) { - startTime = uptimeMillis(); - ALOGI("Waiting for app ops service"); - } else if ((uptimeMillis()-startTime) > 10000) { - ALOGW("Waiting too long for app ops service, giving up"); - return NULL; - } - sleep(1); - } else { - service = interface_cast<IAppOpsService>(binder); - mService = service; + while (service == NULL || !service->asBinder()->isBinderAlive()) { + sp<IBinder> binder = defaultServiceManager()->checkService(_appops); + if (binder == NULL) { + // Wait for the app ops service to come back... + if (startTime == 0) { + startTime = uptimeMillis(); + ALOGI("Waiting for app ops service"); + } else if ((uptimeMillis()-startTime) > 10000) { + ALOGW("Waiting too long for app ops service, giving up"); + return NULL; } + sleep(1); + } else { + service = interface_cast<IAppOpsService>(binder); + mService = service; } } mLock.unlock(); |