Also, throw an IllegalArgumentException is these APIs are called on
sessions that are not marked as staged.
Test: tested new apis with an ad-hoc app. atest RollbackTest
StagedRollbackTest
Fix: 124507718
Change-Id: I3529aaff404d644ab6dad98f29411141e8df865d
Add @RequiresPermission annotations to the methods so that
it's clear what permission is protecting these APIs.
Test: make
Change-Id: I203ce997319c7fc8a13e91b55f3c55d844429be8
Fix: 123661724
Using a global setting to specify the lid open/close behaviour
allows OEMs to support switching between windowed and windowless
lids at runtime instead of build time.
Bug: 70378569
Test: Find the hall effect sensor on the device and then using a magnet
confirm the expected behaviour for each global setting:
* No reaction from device
adb shell settings put global lid_behavior 0
* Sleep/screen off
adb shell settings put global lid_behavior 1
* Lock screen but screen stays on
adb shell settings put global lid_behavior 2
Change-Id: I53682711aeaaeb9eead7246ba83e4dd4b3c06a58
The initial behavior cop^H^H^H based on Autofill, which only closes the session when the activity
finishes. But for content capture we must always close the session when the activity is stopped.
Test: manual verification
Fixes: 125628737
Change-Id: I064d4ace97721dd8fb20075c02e1f059ecbf942a
after the asynchronous restore is complete
This is a better alternative to the existing synchronous PackageManager.installExistingPackage
method where the restore operation happens asynchronously but the method itself will return
success before the restore finishes.
Bug: 122881085
Test: 1) cts-tradefed run cts -m CtsBackupHostTestCases
-t android.cts.backup.ProfileKeyValueBackupRestoreHostSideTest
2) atest RunBackupFrameworksServicesRoboTests
3) Install Hangouts on work profile. Then install on primary profile, backup and uninstall.
Now install again and immediately hit Open. Before this change, the app will crash after a few
seconds (when the background restore operation finishes). With this change and a corresponding
Play Store change to use this new method, Open shows up only after restore has finished so the
app doesn't crash.
Change-Id: I5d2e1f3bb5509894bedd6bbcfac32ed6cf946a80
We want to know which profile people share from and if users are
switching from work to personal profile when sharing and vice versa.
This adds the current profile to the sharesheet and also logs when the
profile is switched.
Bug: 124503277
Test: Added new unit tests for ChooserActivity and IntentForwardActivity
Change-Id: Ideb83682bf3395258ff457988f4a3e9f519a844c
This fix introduced a painful crash that ends up disabling accessibility
services for certain users.
This happens when a client of AccessibilityCache tries to add a node, with the same id as a node previously in the cache, but fewer children, where the removed child is not in the cache.
This is because, when children are removed, and a the node is updated, the cache tries to clear the child trees. But if the child is not in the cache, the cache clears the whole tree. Every node is recycled.
Then the original node being replaced is attempted to be recycled again, and voila crash.
The fix also didn't fix the original issue based on the discussion in
b/114133438.
The risk for this is pretty low, since nothing was built on top of this.
This reverts commit 2f69c16c3d.
Bug: 124676705
Test: Tested to see if above usecase still happens.
Change-Id: I8a39698c4532a1613ba47e1c6ca70201cd496212
Currently, IWindowSession#performHapticFeedback() would first lookup
the WindowState via IWindow token. That would also hold the WMS lock,
so if some function like relayout window is still hold WMS lock,
it may block the function.
Use uid and package name from Session that they already restored.
Bug: 62330939
Test: Open app with autofill edit, type with IME.
Change-Id: I359c106d213b87aa8afee48b0f1ad70011970eab
This is much slower than the old way as we need to call into a different
process. On the other hand this handles the following cases correctly:
- foreground / background permissions
- pre-M apps
- split permissions
Test: CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testPermissionGrant,testPermissionPolicy,testPermissionMixedPolicies,testPermissionAppUpdate,testPermissionGrantPreMApp
Change-Id: I5cd139ad29e5b77b77b02e12c75eb774984a7759
Bug: 124128308
- Allow an app to change policy_fixed permissions
- Disallow apps >= Q to change the polic_fixed flag
Bug: 124128308
Test: Changed permissions that were policy_fixed
Change-Id: Ia94bae1b993bd8a18c93f866df2114c740fa17bd
Added a new test method to allow the client to wait until input windows
have been propagated to InputFlinger before proceeding to inject input.
This ensures that the inject is called when all windows have been set
up.
Bug: 123041491
Test: ListPopupWindowTest, PopupMenuTest
Change-Id: I42abfa4ea23a14ae1a003c6ee8976cc466f1d5af
Also split some logic from PendingRequest into BasePendingRequest, so they're
not leaked into the async requests.
Test: atest CtsContentCaptureServiceTestCases CtsAutoFillServiceTestCases
Bug: 117779333
Change-Id: Ife9a3ab3a817944408caf9eae69dd75f48ab90c6
This avoids packageManager call everytime a widget updates and
on swipe up
Test: Everything compiles
Change-Id: I58e8613b7a8c9d27fb9293e623ccb274edab82d3