summaryrefslogtreecommitdiff
path: root/libs/binder/ActivityManager.cpp
Commit message (Collapse)AuthorAgeFilesLines
* activity_manager: use waitForService instead of getServiceYifei Zhang2023-06-021-16/+26
| | | | | | Test: build & boot Bug: 284487308 Change-Id: I9f81398c1350749d55e6f97e84dffbc38fcdcd62
* Camera / UidObserver: Add the ability to subscribe to specific UIDsAustin Borger2023-05-081-0/+34
| | | | | | | | | | | | | | | | | | | | | | UidObserver sends updates about the state of all packages installed on the system. In the case of the cameraserver, we only care about a handful of them. The current status quo is to filter out these callbacks but there is a significant IPC cost that is not addressed by that approach. This patch adds new entrypoints to ActivityManagerService to listen only to specified UIDs. This set of uids can be updated dynamically. Change-Id: I669f27b94fb691187bb77942f53ebc02cb90ace4 Bug: 274486653 Test: -- on physical device: -- testCamera2AccessCallbackInSplitMode x10 -- ActivityManagerServiceTest -- ActivityManagerProcessStateTest -- ActivityManagerFgsBgStartTest -- UidObserverControllerTest -- Alternate focus in split screen between Camera2 + GCA x20 Ignore-AOSP: Soak time in U
* ActivityManager: return status for register/unregisterUidObserverChong Zhang2020-11-171-4/+8
| | | | | | bug: 172942349 bug: 159172726 Change-Id: I1420d5a9e14aca4f70e8c6cbd26613dd85db51f1
* Add NDK PermissionManager checkPermissionChong Zhang2020-11-041-0/+13
| | | | | | | bug: 172283477 bug: 159172726 Change-Id: I532722772f6a86ef4f94a95146df34603278bb45
* Revert "Add setSchedPolicyCgroup to AM binder"Rick Yiu2020-08-281-9/+0
| | | | | | | | This reverts commit b12941cf9b1e3c3456eb44a19927570d99ba108d. Reason for revert: may have problem under race condition Change-Id: I67941e7b5026484df856554dc66e1ae0c621a93c
* Add setSchedPolicyCgroup to AM binderRick Yiu2020-05-071-0/+9
| | | | | | | | | Add setSchedPolicyCgroup function to native Activity Manager binder interface. Bug: 139521784 Test: function works Change-Id: Icc89e0c4d33993d2ccb80f5d63efb9f6fdd5ba40
* Revert "Add isUidActiveOrForeground for camera/audio to use."Hui Yu2020-05-041-9/+0
| | | | | | | | | | | | | | | | | | | | Revert submission 10829580-isUidForeground Reason for revert: In CameraService.cpp, before this change, around "am.isUidActive", there was up to 300 ms retry. After this change, the code could move forward fast without retry, but at "mAppOpsManager->startOpNoThrow" call, for the same reason as uid is not updated fast enough, "mAppOpsManager->startOpNoThrow" could also fail. This CL does not really fix the root cause, but it changes the timing and now the code fails at "mAppOpsManager->startOpNoThrow" call. Also the timing change may also cause recent multiple CTS test failures. Bug: 154570809, 155032617, 154849083 Reverted Changes: Iffed63293:Add isUidActiveOrForeground() for camera/audio to ... I3685e0c8d:Add isUidActiveOrForeground() for camera/audio to ... I51ed1fe78:Add isUidActiveOrForeground for camera/audio to us... Change-Id: I9fbeb190c5a0ac640ad5be8140fe4aaeb7cfe33d
* Add isUidActiveOrForeground for camera/audio to use.Hui Yu2020-03-251-0/+9
| | | | | | | | | 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
* Remove extraneous semicolon.Steven Moreland2019-09-271-1/+1
| | | | | | Bug: N/A Test: build w/o -Wno-c++98-compat-extra-semi Change-Id: I632d6df9a03485e547a6e7f14df0f1c068066c1e
* Activity manager: native callback for process stateEric Laurent2018-11-271-0/+9
| | | | | | | | | | | Make getUidProcessState() callback in IActivityManager.aidl available to native processes. Test: Manual test with audio recording apps pushed to background and back to top. Bug: 111438757 Change-Id: I16d001dcaeb3e9a38743aa7b301445c94fe5dc99
* [binder] Replace NULL/0 with nullptrYi Kong2018-06-071-9/+9
| | | | | | | | | | | Fixes -Wzero-as-null-pointer-constant warning. clang-tidy -checks=modernize-use-nullptr -p compile_commands.json -fix ... Test: m Bug: 68236239 Change-Id: I3181bc5683796423a98b0f9b94daf30880c07bdc
* Add API to query if a UID is activeSvet Ganov2018-03-281-0/+9
| | | | | | | | Test: cts-tradefed run cts-dev -m CtsCameraTestCases Bug: 72863398 Change-Id: I8e5021f2ef4cd77fc89ae3b47cc32ad6913da0d6
* ActivityManager: Add link/unlinkToDeathEino-Ville Talvala2018-03-201-0/+16
| | | | | | | | | | | Native services aren't killed when the system service dies, so they may need to be able to tell when ActivityManager has died. Test: adb shell stop; adb shell start; verify camera service still allows camera use. No regression to camera CTS. Bug: 74230547 Change-Id: Iaa078b2f9a1d9c7be305b7667e3055a8ce52aa21
* Don't block long time gettng system serviceSvetoslav Ganov2018-02-221-1/+3
| | | | | | | | | | | Test: run google/template/local --template:map test google/continuous/boot-successive --no-first-boot --successive-boot --boot-count 10 --granular-boot-info -f SystemServerTiming_StartServices,SystemServerTiming_StartAudioService bug:72322854 Change-Id: Ie287e0a8f1ed10f9a535b489cef6f3db184e41cb
* Wait longer for the activity serviceSvet Ganov2018-01-211-1/+1
| | | | | | Test: manual Change-Id: I4cdbaa756bd26986265bca4e3a0919083ea23336
* Don't record audio if UID is idle - native frameworkGanesh Mahendran2017-12-261-0/+81
If a UID is in an idle state we don't allow recording to protect user's privacy. If the UID is in an idle state we allow recording but report empty data (all zeros in the byte array) and once the process goes in an active state we report the real mic data. This avoids the race between the app being notified aboout its lifecycle and the audio system being notified about the state of a UID. Test: Added - AudioRecordTest#testRecordNoDataForIdleUids Passing - cts-tradefed run cts-dev -m CtsMediaTestCases -t android.media.cts.AudioRecordTest bug:63938985 Change-Id: I10db89c09498b487ce483d1868123fca95589b34