Pull all user logic out into a utility class (which can be mocked for
unit testing!).
Provider useability was not properly being updated for all current user
profiles, only for the current user. This fix ensures that all profiles
see the correct useable status for the provider.
Test: atest CtsLocationManagerFineTestCases
Change-Id: I799b16613d6a98e52eb2c561b6605d2c872fbf23
* changes:
Check if number of packages enabled for rollback is equal to number of sessions
Rollback user data of apks-in-apex while rolling back the apex
This reverts commit 4f62f21a30523d6767a75437b9d3183a62173be1.
Reason for revert: Might be causing Camera CTS tests to fail b/147384764
Change-Id: I0e0abeee90287cb290fbf41cab5d90fff25df304
Currently, the RollbackManager is not aware of the apk-in-apex being
installed since the install is done by PM during scan phase of boot. As
such, RM does not backup the user data of the apk-in-apex.
In the new implementation, we ask the RM to snapshot/restore user data
of apk-in-apex while resuming the apex session in StagingManager.
Bug: 142712057
Test: atest StagedRollbackTest#testRollbackApexWithApk
Test: atest AppDataRollbackHelperTest
Test: atest RollbackStoreTest
Test: atest RollbackUnitTest
Change-Id: Ibbaa5d0c98cb883588c085d77bc89c3e8217d76a
As otherwise they may be out of sync, leading to shifting when the
IME disappears.
Bug: 111084606
Test: InsetsSourceTest, InsetsStateTest, InsetsSourceProviderTest
Change-Id: Ifd7dfa6694efccf8693fd46bec1a9dea879790ff
Currently backup dumpsys in bugreport only contains information
for system user making it hard to debug backup bugs in non-system
users. Therefore, add dumpsys information for all users running backup.
For system user, keep the dumpsys format the same for compatibility with
cts and gts tests. For non-system users, add a prefix "User <userid>:"
to all dumpsys headers.
The changes in Android.bp and AndroidManifest.xml are to support mocking
of the static method DumpUtils.checkDumpAndUsageStatsPermission in the
test testDump_systemUserFirst
Bug: 143867387
Test: atest com.android.server.backup.BackupManagerServiceTest
Test: atest com.android.server.backup.UserBackupManagerServiceTest
Test: adb shell pm create-user test1 -> say this gives 11
adb shell am start-user 11
adb shell bmgr --user 11 activate true
adb shell dumpsys backup users -> "Backup Manager is running for users: 0 11"
adb shell dumpsys backup -> contains both
"Backup Manager is enabled / setup complete / not pending init" and
"User 11:Backup Manager is disabled / not setup complete / not pending init"
adb shell pm remove-user 11
Test: "adb bugreport" on device with secondary user as created above and check that result
contains dumpsys for both system and secondary users.
Test: atest -v CtsBackupTestCases
Test: atest -v CtsBackupHostTestCases
Change-Id: Ib94c168f8e89b0ba8f398152ea744fe3d626efc4
A first take at the TaskOrganizer API for allowing SysUI to control task presentation.
In this CL we introduce the first two primitives:
1. The interface itself for implementation by SysUI
2. Support for organizing a given windowing mode (but atm really only PIP)
We include a sample app that manages the PIP from an APPLICATION_OVERLAY window.
Bug: 139371701
Test: wmtests/TaskOrganizerTests. TaskOrganizerPipTest
Change-Id: I44a8ed311bc5f06285bba2c6ff3b37a7d19a9190
Since we've moved AppStandbyController inside the JobScheduler mainline
module boundary, we need to move the logic of setAppStandby over so that
it's consistent for callers and easy to do the right thing.
Bug: 137763703
Bug: 145551233
Test: atest AppIdleHistoryTests
Test: atest AppStandbyControllerTests
Test: atest UsageStatsTest
Change-Id: Ie2ccb0508c3a3887ab3debc47e78427477d2d77b
Previously when an installer package was uninstalled we removed all
reference to it in InstallSource.
Now we retain the initiator package name (but not installer or
originator). We set a flag to remember it has been uninstalled, and we
also store its signatures which would otherwise cease to be
available. Update persistence logic.
Also minor refactoring of InstallSource#create to separate the normal
case from those that need to set every field.
This information is not yet exposed in the API, but it will be.
Test: atest PackageManagerTests PackageVerifierTest
Test: Manually verify XML contents before & after uninstalling an installer.
Bug: 134746019
Bug: 146555198
Change-Id: I1452402de554b916e5f79bd386c5857d4860ba12
Rename android.util.TimestampedValue to android.os to avoid dependency
from android.util onto android.os, which is disallowed by lint.
Bug: 147012511
Test: boot
Merged-In: I4b84db03c8ad24bbef63e45d6d15fb306a10364e
Change-Id: I4b84db03c8ad24bbef63e45d6d15fb306a10364e
(cherry picked from commit d159015e5445fcfc0b3e4084095e2850d28a3fb4)
In order to let external module report their network stats,
expose necessary APIs to construct NetworkStats object.
Test: atest FrameworksNetTests CtsUsageStatsTestCases
Test: m doc-comment-check-docs
Bug: 130855321
Change-Id: Id3ec8aaff3df67948c25eac2319a74cf33a27979
This is followup from a code review comment at ag/9588196. In display
manager, each display already has a concept of a default mode id, so
rename DesiredDisplayModeSpecs.defaultModeId to baseModeId, to avoid
confusion.
Bug: 142507213
Test: atest FrameworksServicesTests:DisplayModeDirectorTest
Change-Id: I5cc137bb6f79dc120c29abda4e352e185c3aff5b
If adb is not enabled on a device then the adb key store is not
instantiated when the AdbDebuggingManager's handler is started as
in most cases it will not be needed. However if the user attempts
to revoke any previous adb grants when a device is booted with adb
disabled it will result in a NPE. This commit ensures the key store
is instantiated before attempting to revoke authorizations.
Test: atest AdbDebuggingManagerTest
Test: Manually invoked 'Revoke USB debugging authorizations' after
a boot with adb disabled.
Fixes: 145790817
Change-Id: Id00e531c18412be009a211eec80a72867659608f
Activity visibility messages simply move the activity to STOPPED or
STARTED state. We can use the lifecycle messages to do the same and
simplify the logic/remove duplicated code.
This CL also removes the option to send STOP message without making
the client invisible and actually calling onStop(). This option
caused a mismatch of the state between server (STOPPED) and client
(PAUSED). Also, in cases when the device was going to sleep, STOP
message was always followed by SLEEP message, which called onStop()
anyway.
Bug: 137329632
Bug: 129750406
Test: AM/WM CTS and unit tests
Change-Id: I487575520ce301bb2f65519f0c0a30b6b9edac0c
Integrate Rescue Party as an observer for Package
Watchdog, for managing package failures. Rescue Party
will be a persistent observer, meaning it may receive
failure calls for packages it has not explicitly asked
to observe.
Remove app failure calls and thresholding logic from
Rescue Party. Remove obsolete Rescue Party tests
and add persistent observer tests to
PackageWatchdogTest.
Test: atest PackageWatchdogTest
Test: atest RescuePartyTest
Test: atest StagedRollbackTest
Bug: 136135457
Change-Id: I55ec0de48acd5434255811feba758d38c9304478
UnlockedDeviceRequired=true keys survive LSKF removal.
Generation id for keys created with new param will start from 1000000.
New parameter only works for primary user.
Added 2 seconds delay between phone unlock and running sync task.
Test: atest com.android.server.locksettings.recoverablekeystore
Bug: 111561213
Change-Id: Ifc48ef823a72fdbdff1a09563de0d0be0b004f79