summaryrefslogtreecommitdiff
path: root/core/java/android/app/ActivityManagerInternal.java
Commit message (Collapse)AuthorAgeFilesLines
* Inform Assistant visible activity when the stage of activity lifecycle is ↵Peter Li2022-11-011-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | invoked. By the original design, we register the activity event in the ActivityManagerService. After getting the activity event, we will query current visible activities and report them to Assistant. Assistant will start to get direct actions of those visible activities. But sometimes they can not get the direct actions due to the stage of activity lifecycle before onStart(). We change the logic to make sure that the stage of visible activity that we reported to the Assistant is after onStart(). Bug: 235296082 Test: atest VoiceInteractionSessionVisibleActivityTest Test: atest android.app.activity.ActivityThreadClientTest Test: atest android.view.DisplayTest Test: atest android.window.ConfigurationHelperTest Test: atest android.window.SizeConfigurationBucketsTest Change-Id: Ie439ff3706dab35e875c1eb995a67fa73aec4d76 (cherry picked from commit 29bb3a3428fcd272f8ec236f14354b9ec6c28f3e) Merged-In: Ie439ff3706dab35e875c1eb995a67fa73aec4d76
* Reland: Change input injection security modelPrabir Pradhan2022-05-091-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6b3c6cae3ff558a0f452f39060af559a19669dd5. Changes from revert: - Explicitly maintain the same behavior as previous versions of Android, where injection is allowed into all window if the caller has the INJECT_EVENTS permission, even if it is targeting a certain uid. This fallback will be removed separately in b/228161340. - Clear the calling identity before checking if the injection source has a permisssion to avoid hitting blanket-checks in PackageManager that denys permissions in some cases, such as if the permission check call is coming from an instant app (b/228319794). - Leave the existing IInputManager#injectInputEvent method signature unchanged, and add a new input method injectInputEventToTarget to perform targeted injection. This makes it so that tools or apps relying on the @UnsupportedAppUsage injection method will not be broken by a change in the method's signature (b/228583652). Bug: 207667844 Bug: 194952792 Test: Run tests affected by b/228319794 and its duplicates using cts-tradefed, so that they are also run as instant apps. Test: Test scrcpy tool works locally Change-Id: I503e4f087501e3aecf2c18b4b1d27e51ecda59ac Merged-In: I503e4f087501e3aecf2c18b4b1d27e51ecda59ac
* Inform Application thread to block for network rules to be updated.Sudheer Shanka2022-04-091-1/+1
| | | | | | Bug: 226299593 Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java Change-Id: Ie37173d0d3f4034a74b834550920530166cd4201
* Inform AMS about the uid blocked reasons.Sudheer Shanka2022-04-081-0/+6
| | | | | | | | | | This will be used to let the application thread know whether or not to block for network rules to be updated when coming to the foreground. Bug: 226299593 Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java Change-Id: I9bff481a0026fb57af8dbee580e617c8410f9ebe
* Revert "Change input injection security model to require INJECT_..."Prabir Pradhan2022-04-081-5/+4
| | | | | | | | | | | | | | | | Revert "Update WindowInputTests after changing injection permiss..." Revert "Change input injection security model to require INJECT_..." Revert submission 17125748-require-inject-events-permission Reason for revert: b/228203157, b/228194124, b/228583652 Reverted Changes: Ib0d66eff3:Change input injection security model to require I... Ief1a2f10c:Update WindowInputTests after changing injection p... Ie2d8d0c3d:Change input injection security model to require I... Change-Id: I4e77238f00ccd6379486ba77613430fbf166821c
* Merge "Add a parameter to the internal FGS notification listener" into tm-devJing Ji2022-04-051-3/+4
|\
| * Add a parameter to the internal FGS notification listenerJing Ji2022-04-041-3/+4
| | | | | | | | | | | | | | | | | | Don't use the notification ID to determine if it's being canceled or not. Bug: 203105544 Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest Change-Id: I0ddcb7de57800c5f8b69100353ba7f71157a5448
* | Change input injection security model to require INJECT_EVENTS permissionPrabir Pradhan2022-04-041-4/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, any app could inject input events into the system via the IInputManager#injectInputEvent API. The injection was only allowed if the input event targeted a window owned by the same UID as that of the process calling the API. This had drawbacks metioned in the bug. Here, we change the input injection security model so that the signature permission INJECT_EVENTS is required to inject events. This permission is given to the system and the shell, so input injection can still be done through the 'adb shell input' command. We also allow injection from instrumeted processes where the instrumentation source has the permission. For exmaple, running a test from the shell allows for the test to inject events. We also add support for a targeted injection mode, where the input injection succeeds only if the target window for the event is owned by the provided UID. This allows us to support injection from the Instrumentation class, which only allows for injection into windows owned by the same UID. In contrast to this, injection from the UiAutomation class will target all windows, including system and spy windows. Bug: 207667844 Bug: 194952792 Test: atest inputflinger_tests Test: atest WindowInputTests Test: manual with test app: app cannot inject navigation gestures Change-Id: Ib0d66eff3fc2f061e7c0d3b7e139a841a9bcebc7
* Inform NPMS about the app coming to the TOP state early.Sudheer Shanka2022-03-311-0/+11
| | | | | | | | | | | | It's possible for an app to come to the TOP state before the oomAdj computation is done and we cannot wait for oomAdj computation to complete and then inform NPMS about the state change. So, inform NPMS early about the state change when we know the app is going to the TOP state. Bug: 226299593 Test: atest tests/cts/hostside/src/com/android/cts/net/HostsideRestrictBackgroundNetworkTests.java Change-Id: I5d582618652cead179c419f7fe084283dd89d514
* Merge "[Bugfix] Don't delete mPendingUids if PendingTopPid is added later ↵Hui Yu2022-03-241-1/+2
|\ | | | | | | | | | | | | | | than updateOomAdj started" am: 8f321a616b am: c9c23976a9 am: a0be2d5cc5 Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2036403 Change-Id: I278a9e0c7cf4f42431a40c054738873888bf033f
| * [Bugfix] Don't delete mPendingUids if PendingTopPid is added later than ↵huang chaopeng2022-03-241-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | updateOomAdj started Analysis: 1.Doing updateOomAdjInnerLSP in backgroud, and it would last for a long time 2.Now start a new Activity, windowManager save the latest topUid into PendingStartActivityUids 3.updateOomAdj task in step.1 done, and then delete all uids in PendingStartActivityUids 4.The topApp will be rejected by AppOps due to the deleting in step.3 Signed-off-by: huang chaopeng <huangchaopeng@oppo.corp-partner.google.com> Change-Id: I52c7c2a8d6cb86b27b1f008cb56f670ce7698dc9
| * Renamed setStopBackgroundUsersOnSwitch to setStopUserOnSwitch()Felipe Leme2021-11-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Test: atest NeneTest:UsersTest Test: m update-api CtsVerifier Test: adb shell cmd activity set-stop-user-on-switch false Test: adb shell cmd activity set-stop-user-on-switch Test: adb shell dumpsys activity users|grep OnSwitch Bug: 203752848 Merged-In: Iea03164319768abf159bf8ae2ccc539620cb30fe Change-Id: Iea03164319768abf159bf8ae2ccc539620cb30fe
* | Increase startForeground() timeout to 30 seconds.Hui Yu2022-03-181-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Right now there is 10 seconds grace period from Context.startForegroudService() to Service.startForeground() call, afterwards we crash the app and thow ForegroundServiceDidNotStartInTimeException, at the same time generate ANR report. Make the startForegroundService() to startForeground() grace period configurable, increase the default value from 10 seconds to 30 seconds. This value can be changed by command "adb shell device_config put activity_manager service_start_foreground_timeout_ms 30000" After the 30 seconds service_start_foreground_timeout_ms and ForegroundServiceDidNotStartInTimeException, delay the ANR generation for another 10 seconds configurable by service_start_foreground_anr_delay_ms. This value can be changed by "adb shell device_config put activity_manager service_start_foreground_anr_delay_ms 10000". At the end of service_start_foreground_anr_delay_ms, if the app's process is still alive, the ANR report will be taken. Otherwise, there is no ANR report. Bug: 219514357 Test: adb shell device_config put activity_manager service_start_foreground_timeout_ms, adb shell device_config put activity_manager service_start_foreground_anr_delay_ms, Manual test, in test app, startForegroundService() but not call startForeground(), 30 seconds later, observe the ForegroundServiceDidNotStartInTimeException, 10 seconds later, try to take the ANR report. Change-Id: I5f30d0996bff23f8a302cedef01eaa31e6ff29ce
* | Puller for PendingIntentControllerRichard Gaywood2022-02-151-0/+5
| | | | | | | | | | | | | | | | Populate a new stats atom with information about PendingIntents; per-uid: (1) the total number of intents and (2) the total size of any extras bundled with the intents. Change-Id: I04e6b368a76623c80ead6f846baf85b1a6c5ce70 Test: statsd_testdrive 10151 Bug: 217162457
* | Merge "Add ability for sysui/featureflags to restart android"Evan Rosky2022-02-141-0/+5
|\ \
| * | Add ability for sysui/featureflags to restart androidEvan Rosky2022-02-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | When setting flags/sysprops, full reboot is overkill. This adds a way to just restart system_server. Bug: 219067621 Test: Call API and verify that it restarts Change-Id: I67aecbc6ec0570fbaf36165034648ab39da57940
| * | Revert "Revert "Revert "User consent for Logcat data access"""Daniel Chapin2022-02-081-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ec8c5511afb4a1f6e1f1b300ef7ac5263a990cc1. Reason for revert: Droidfood Blocking Bug: 218267535 Change-Id: I313f3fb7fdfbefb1c62b474b09f5b14e6ca0afd5
* | | Don't prompt on bg abuse if the app has a FGS with notificationJing Ji2022-02-081-0/+10
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Add a new config to control whether or not to prompt the user when the system detects a background abusive app and it has a foreground service with notification shown. By default it's OFF, meaning if the background abusive app has a foreground service and its notification is still showing, no prompt to the user in this case. Bug: 200326767 Bug: 203105544 Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest Change-Id: Ic611090e3152117a2379d902fc32416e11c3e197
* | Revert "Revert "User consent for Logcat data access""Wenhao Wang2022-02-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d7138b445c54248b50dd879d08798e71cc1e94b4. This patch fixes the breaking caused by commit b4f8ed9bb8a94575989d689d37be523ee99bc589. It's a workaround patch. The upcoming patch will have solid fix. Bug: 193708292 Bug: 217482811 Bug: 217495147 Test: atest PlatformRuleTests -- --abi x86_64 Test: atest FrameworksServicesTests -- --abi x86_64 Ignore-AOSP-First: pending fix for logcat privacy issue Change-Id: If18086130599f0ae027d16ccbb7b5b5cd73f2e72
* | Revert "User consent for Logcat data access"Shubham Dubey2022-02-021-8/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit b4f8ed9bb8a94575989d689d37be523ee99bc589. Reason for revert: Breaking Dex2oatPressureRuleTest and PreRebootLoggerTest BUG:217482811 BUG:217495147 Change-Id: I745de0dbcaa328918b5a1c58028471fd3d8ae0ab
* | User consent for Logcat data accesseunjeongshin2022-02-011-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The LogcatManagerService checks if logd access is coming from background or foreground. If the requester is foreground, the LogcatManagerService generates a notification to get user consent. If the user grants access, the LogcatManagerService approves logd access. If the user does not grant access, the LogcatManagerService denies logd access. If the requester is background, the LogcatManagerService waits to observe process status change. If the process status updates to foreground from background, LogcatManagerService sends a notification to get user consent. If the process remains background, the LogcatManagerService denies logd access. This codebase is the continuity of the implementation ag/16618162 to obtain user consent. Bug: 193708292 Test: CtsVerifier Ignore-AOSP-First: pending fix for logcat privacy issue Change-Id: I4103c72daebdea5e8f04ab4901c05be2f1aefc84
* | Merge "Full teardown when the user stops background apps"Chris Tate2022-01-271-2/+4
|\ \
| * | Full teardown when the user stops background appsChristopher Tate2022-01-251-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not just moving its services out of the FGS mode. The shell command for invoking this operation has changed; it is now adb shell cmd activity stop-app [--user NUM] PACKAGE Bug: 192504071 Test: manual (Maps nav, YouTube, etc) Test: atest CtsAppTestCases:android.app.cts.ServiceTest Test: atest RunningFgsControllerTest Change-Id: Ic14c1ba557460e25dd1ba2fd79462918e9a47377
* | | Add tracking on abusive broadcast and service binding requestsJing Ji2022-01-251-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case of excessive amount of outgoing broadcast/service binding requests from a background app, move the app to restricted bucket. The exemptions in previous CL still applys here. Bug: 200326767 Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest Change-Id: I2ec82f26bf2a72e2201b140979be09794adedf47
* | | Monitor long-running foreground servicesJing Ji2022-01-251-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a certain package has foreground services running for a long time, say the accumulated durations over last X hours are more than Y hours, system will post a notification to remind the user. Some type of apps are subjected to be exempted, i.e. if it's already in the device idle allowlist. More exemption could be added in the follow-up CLs. Bug: 200326767 Bug: 203105544 Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest Change-Id: I3a8f34c33e7a533240abc7cf4fa569a0956eec73
* | | Allow limited alarms/jobs when background restrictedJing Ji2022-01-251-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When app is background restricted, allow alarms/jobs but they'll be under the quota control of restricted standby bucket. This behavior is gated by a feature flag now. Bug: 200326767 Test: atest CtsJobSchedulerTestCases Test: atest CtsAlarmManagerTestCases Test: atest FrameworksMockingServicesTests Change-Id: I154656c19954a306e8ae05dc50ea708c4de2a739
* | | Add background restriction levels definition and its controllerJing Ji2022-01-241-0/+12
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL adds the definition of background app restriction levels. The existing various system background app restriction features will be mapped into the levels here, including app standby buckets, background restrictions (forced-app-standby) etc. Future CLs may apply restrictions to background apps accordingly. BYPASS_INCLUSIVE_LANGUAGE_REASON=Legacy API name Bug: 200326767 Test: atest FrameworksMockingServicesTests:BackgroundRestrictionTest Change-Id: Icf82031c572e7b8e82e6528402e9df4de5b7a675
* | Allow bindServiceAsUser without _FULL if same appAdam Bookatz2022-01-121-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we allowed bindServiceAsUser in the following situations: * caller has INTERACT_ACROSS_USERS_FULL * caller has INTERACT_ACROSS_USERS and is in same profile group * caller has INTERACT_ACROSS_PROFILES and is in same profile group and is the same app as the service We now additionally allow: * caller has INTERACT_ACROSS_USERS and is the same app as the service (regardless of whether it is in the same profile group) Bug: 209989958 Test: tested locally that granting the permission allows access to bindServiceAsUser Test: atest UserControllerTest Change-Id: I47d6f86fd159aa993971366ee9d7d334644d391e
* | Renamed setStopBackgroundUsersOnSwitch to setStopUserOnSwitch()Felipe Leme2021-11-081-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | Test: atest NeneTest:UsersTest Test: m update-api CtsVerifier Test: adb shell cmd activity set-stop-user-on-switch false Test: adb shell cmd activity set-stop-user-on-switch Test: adb shell dumpsys activity users|grep OnSwitch Bug: 203752848 Change-Id: Iea03164319768abf159bf8ae2ccc539620cb30fe
* | Merge "New TestAPIs on ActivityManager to not stop bg users on switch." into ↵Felipe Leme2021-11-051-0/+7
|\| | | | | | | | | | | | | | | sc-v2-dev am: 7c1c6a691c am: 3f4a968751 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/16105957 Change-Id: Ifc97656622981ae421488f97fa48dbb9afeb277f
| * New TestAPIs on ActivityManager to not stop bg users on switch.Felipe Leme2021-11-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Test: atest NeneTest:UsersTest Test: m update-api Test: adb shell cmd activity set-stop-user-on-switch false Test: adb shell cmd activity set-stop-user-on-switch Test: adb shell dumpsys activity users|grep OnSwitch Bug: 203752848 Change-Id: Ib57989aff323dc1f7d98720d01215e4f7c79ba3a
* | Implement demotion of an app's FGsesChristopher Tate2021-10-251-0/+5
| | | | | | | | | | | | | | | | | | | | The OS now has an operation for wholesale shutting down all of an application's foreground services. Bug: 192504071 Test: atest CtsAppTestCases:android.app.cts.ServiceTest Test: ApiDemos + shell command Change-Id: I67d4469d5c20c25c717024fad80849c080c98190
* | Merge "[NGA v2] Reliable Visible Activity Lookup" into sc-v2-dev am: ↵TreeHugger Robot2021-09-281-0/+19
|\| | | | | | | | | | | | | | | 80fcbc8fe0 am: 347557e905 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15810445 Change-Id: I4a5b0c551343984de6124a497f7b24dd750c5aca
| * [NGA v2] Reliable Visible Activity Lookuplpeter2021-09-281-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | To enable more voice-oriented in-app user journeys, Google Assistant needs to access more information regarding the visible activities via the Voice Interaction Session. Thus, we provide the APIs to receive the changed visible activities in Voice Interaction Session. Bug: 178244510 Test: atest CtsVoiceInteractionTestCases Test: atest CtsVoiceInteractionTestCases --instant Change-Id: I019d09fee8105ae1eadbc76803f46fd8b1948f6b
| * Merge "tempAllowList duration can be updated if an UID is already temp ↵Hui Yu2021-09-251-1/+2
| |\ | | | | | | | | | | | | | | | | | | | | | allowlisted." into sc-qpr1-dev am: add3a2e361 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15851148 Change-Id: I98beccce014373f5ccb43e76c7e6acfc76407301
* | \ Merge "tempAllowList duration can be updated if an UID is already temp ↵Hui Yu2021-09-201-1/+2
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | allowlisted." into sc-qpr1-dev am: add3a2e361 am: c10b7d62e2 am: bb932ee046 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15851148 Change-Id: I757e56a566bc2058260064d506c752b02a2f45da
| * \ \ Merge "tempAllowList duration can be updated if an UID is already temp ↵Hui Yu2021-09-201-1/+2
| |\ \ \ | | |/ / | |/| / | | |/ | | | | | | | | | | | | allowlisted." into sc-qpr1-dev am: add3a2e361 am: c10b7d62e2 Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15851148 Change-Id: I07e09839e0d46103f7fbc2863888820b4afd4acd
| | * tempAllowList duration can be updated if an UID is already tempHui Yu2021-09-201-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | allowlisted. Previously when PowerExemptionManager.addToTemporaryAllowList() is called for a second time before the first time call's duration expires, the second call does not update ActivityManagerService's FgsTempAllowList for the new duration. This CL fixes this problem. Bug: 199801023 Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java Change-Id: Ibb8c6f41740a9b7468b50a4cdabe526ae58550ec
* | | Merge "Add CPU stats into trace."Hongming Jin2021-08-101-0/+13
|\ \ \
| * | | Add CPU stats into trace.Hongming Jin2021-08-091-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 157601519 Test: adb shell cmd accessibility start-trace -t AccessibilityInteractionClient IAccessibilityInteractionConnectionCallback adb shell cmd accessibility stop-trace Change-Id: I765ff5fc4656f0e6c686407d11a596b4e009a8ca
* | | | Add logic to re-raise ANR dialogs if the user taps wait.Varun Shah2021-08-091-0/+7
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the user taps "wait" on the ANR dialog, redisplay the dialog after a specified timeout (currently 5 seconds). If the app becomes responsive, cancel any pending delayed dialogs and dismiss the dialog if it's currently visible. Bug: 171218828 Test: manual (test app) Test: atest AnrTest Change-Id: I4ca34bb8cc60bcde3ff571566553f44246d78ddc
* / / Apply package visibility to PACKAGE_DATA_CLEAREDJackal Guo2021-07-201-1/+1
|/ / | | | | | | | | | | | | | | | | Intent ACTION_PACKAGE_DATA_CLEARED is sent without the allowlist so it may potentially leakage the package information. Bug: 191291133 Test: atest AppEnumerationTests Change-Id: Ica10615db22c0bc0eb4fba550bc069031f18c9a9
* / Create a LegacyTransitions to manage combined WCT + remoteanimationEvan Rosky2021-07-161-0/+5
|/ | | | | | | | | | | Use this to implement Drag-to-split transition BYPASS_INCLUSIVE_LANGUAGE_REASON=using existing API. Bug: 192291727 Test: drag from taskbar into split and observe. Also, drag same-app into split and observe no-op. Change-Id: I710805c85c7d57ae8eebe18e5df7fca899f1b882
* Fix FGS notification mismatchChristopher Tate2021-07-071-1/+1
| | | | | | | | | | | Mistakenly matching against id alone, rather than the (id,tag) tuple, led to some notifications mistakenly being flagged as FGS-related. Bug: 191518901 Test: atest CtsAppTestCases:android.app.cts.ServiceTest Test: atest CtsAppTestCases:android.app.cts.NotificationManagerTest Test: manual Change-Id: I11c3993c13ded7859a5a860dcc99728f3db9809f
* Provide a system_server internal API to get isolated PIDs of an UIDJing Ji2021-06-301-0/+6
| | | | | | | | | | | Internal services within system_server can query the PID list of the isolated processes with packages matching the given UID. Also added a shell command to help the testing. Bug: 191703385 Test: atest FrameworksServicesTests:ActivityManagerTest Change-Id: I9749bc9c70902221f41945c7e785d13631acbae2
* Show mic/cam enable dialog for IMEEvan Severson2021-06-251-0/+6
| | | | | | | | | | If the IME is bound with capabilities it is considered to be in use by the user so when they attempt to open the mic or camera we show the dialog to renable. Test: Disable microphone and use gboard Bug: 187154145 Change-Id: Icf8d91f2a2b97068852c1b98d36916c07c42d3fa
* Handle exact alarm permission state changesSuprabh Shukla2021-06-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The permission SCHEDULE_EXACT_ALARM state changes at the following boundaries: 1. App-op: This gets toggled by the user via Settings. 2. Deny-list: Packages can be added to the deny list via DeviceConfig APIs. 3. Package changes: A package's manifest may changes when it gets updated. In both cases 1 and 2, if alarm manager detects a permission change from revoked to granted, it sends the ACTION_SCHEDULE_EXACT_ALARM_PERMISSION_STATE_CHANGED broadcast to the app. If it detects a permission change from granted to revoked, it kills all the processes within the hosting uid. In all three cases, when the permssion changes from granted to revoked, all the exact alarms scheduled by the relevant package are removed. Package updates are treated differently as they require processes to restart anyway. The broadcast is not needed in this case as there are no alarms expected to have been lost by a previous revocation, and apps can always use ACTION_MY_PACKAGE_REPLACED for post-update setup as usual. All this only applies to packages that have the change REQUIRE_EXACT_ALARM_PERMISSION enabled. Also changed canScheduleExactAlarms to return false if the change is not enabled for the calling package. Test: atest FrameworksMockingServicesTests:AlarmManagerServiceTest atest CtsAlarmManagerTestCases Bug: 179541791 Bug: 187206399 Change-Id: Icd68275701f2804be65b3a10a7dd81bbf6e2a0bb
* Merge "Preventing component spoofing during getShortcutIntent" into sc-devTreeHugger Robot2021-06-081-0/+8
|\
| * Preventing component spoofing during getShortcutIntentPinyao Ting2021-05-261-0/+8
| | | | | | | | | | | | | | | | | | Bug: 184972789 Test: manually verified in log that calling PendingIntent#send resulted in SecurityException which is being swallowed in PendingIntentRecord#sendInner Change-Id: Iebf95631949c52a262455621b62b49c320113a21
* | Fix FGS enter/exit statslog semanticsChristopher Tate2021-06-031-4/+4
| | | | | | | | | | | | | | | | | | Logging wasn't quite right in the case of deferred FGS notification in various ordering scenarios. Bug: 189926836 Test: atest CtsStatsdAtomHostTestCases:android.cts.statsdatom.statsd.UidAtomTests#testForegroundServiceState Change-Id: I650730db9e01faa90a36a73b486464ab5b179fc6