diff options
author | 2020-03-24 16:12:07 -0700 | |
---|---|---|
committer | 2020-03-25 11:06:49 -0700 | |
commit | ef6532c9d46439e4773435c10624d097a53978df (patch) | |
tree | 6d140d62b6bfa225383fbb17b0b6e282ea0a80c1 /libs/binder/ActivityManager.cpp | |
parent | f08d9c835f9e422e34f19b0ed779cea1ec983105 (diff) |
Add isUidActiveOrForeground for camera/audio to use.
The new interface isUidActiveOrForeground will call AM.isUidActiveOrForeground()
which check isUidActive() first, if flase, then check isUidForeground.
Bug: 151185692, 151777097, 109950150
Test: manual test.
Change-Id: I51ed1fe780dbead0688e73a37c6c762f84e8bf23
Diffstat (limited to 'libs/binder/ActivityManager.cpp')
-rw-r--r-- | libs/binder/ActivityManager.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/binder/ActivityManager.cpp b/libs/binder/ActivityManager.cpp index 5e4c98fc7a..4f2709d91a 100644 --- a/libs/binder/ActivityManager.cpp +++ b/libs/binder/ActivityManager.cpp @@ -98,6 +98,15 @@ int32_t ActivityManager::getUidProcessState(const uid_t uid, const String16& cal return PROCESS_STATE_UNKNOWN; } +bool ActivityManager::isUidActiveOrForeground(const uid_t uid, const String16& callingPackage) +{ + sp<IActivityManager> service = getService(); + if (service != nullptr) { + return service->isUidActiveOrForeground(uid, callingPackage); + } + return false; +} + status_t ActivityManager::linkToDeath(const sp<IBinder::DeathRecipient>& recipient) { sp<IActivityManager> service = getService(); if (service != nullptr) { |