diff options
| author | 2020-03-05 19:45:57 +0000 | |
|---|---|---|
| committer | 2020-03-05 19:45:57 +0000 | |
| commit | 07d44b2044dfc66e91a2357cdda79ce59ca4a1a8 (patch) | |
| tree | e0f43202af60b0f4007f2a1b93e91e5dc21a34e8 /libs/binder/AppOpsManager.cpp | |
| parent | 5f85bc3db9b97a58da34870d6f0c411c9b555926 (diff) | |
| parent | 7fcc470e7e80a5e6b3e6de83acf4c88355cd7cde (diff) | |
libbinder: move AppOpManager globals into function am: 1e219c147e am: 7fcc470e7e
Change-Id: Ic9f348a8b527319791afdeaa91ca211ccf96a902
Diffstat (limited to 'libs/binder/AppOpsManager.cpp')
| -rw-r--r-- | libs/binder/AppOpsManager.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/binder/AppOpsManager.cpp b/libs/binder/AppOpsManager.cpp index aeca12b582..b2a6f3bbe9 100644 --- a/libs/binder/AppOpsManager.cpp +++ b/libs/binder/AppOpsManager.cpp @@ -43,11 +43,10 @@ const int APP_OPS_MANAGER_UNAVAILABLE_MODE = AppOpsManager::MODE_IGNORED; } // namespace -static String16 _appops("appops"); -static pthread_mutex_t gClientIdMutex = PTHREAD_MUTEX_INITIALIZER; -static sp<IBinder> gClientId; - static const sp<IBinder>& getClientId() { + static pthread_mutex_t gClientIdMutex = PTHREAD_MUTEX_INITIALIZER; + static sp<IBinder> gClientId; + pthread_mutex_lock(&gClientIdMutex); if (gClientId == nullptr) { gClientId = new BBinder(); @@ -72,6 +71,7 @@ sp<IAppOpsService> AppOpsManager::getService() { return NULL; } #else sp<IAppOpsService> AppOpsManager::getService() { + static String16 _appops("appops"); std::lock_guard<Mutex> scoped_lock(mLock); int64_t startTime = 0; |