Change 1/2. Change 2/2 will setup the class loader namespace for
shared libraries.
This change sets up shared libraries class loaders for applications
and for dexopt.
bug: 111174995
Test: DexoptUtilsTest, device boots
Exempt-From-Owner-Approval: PS1 was approved by owner, PS2 is a build fix.
(cherry picked from commit 8d144eb8bd3487a68c3a0cf58d9744e7d9e1d78b)
Merged-In: Ie9a2b4eaa85cda59951703433f7a2d03bc12095d
Change-Id: I76383308418485ad6739f8a404d02c2771e4afe4
This fixes an issue when adb backup would hang (and hold wakelock)
forever when run with '-obb' and '-shared'.
Bug: 75997810
Test: 'adb backup -obb -shared' finishes successfully
Change-Id: I015add6dc525984592e733266b3e046f41d2cb93
We only report failure to IBackupObserver.backupFinished() when we meet
transport failure, but now it will report failure when the last package
meet TRANSPORT_PACKAGE_REJECTED or TRANSPORT_QUOTA_EXCEEDED, add above
two states in FINAL to prevent the situation, and update related
test, also javadoc of IBackupObserver.
Bug: 77271953
Test: make -j RunFrameworksServicesRoboTests ROBOTEST_FILTER=PerformBackupTaskTest
Change-Id: Ic2bfdf9f50d700f8ccb509e081ae8e0afb186020
mCurrentPackage is null when package doesn't exist, which lead test
failed with NPE
Use request.packageName for case BackupTransport.AGENT_UNKNOWN instead
Bug: 77272500
Test: m -j RunFrameworksServicesRoboTests ROBOTEST_FILTER=PerformBackupTaskTest
Change-Id: I27be85f0c3f95e36edd92d0d552189fbcf6952dd
(cherry picked from commit 87f1209ac6398c1045845640e620fc9d3b36f9f5)
This is a temporary solution for P to unblock GTS tests.
Bug: 77852250
Test: manual:
1. adb backup -f saved-wifi-api100.ab -keyvalue com.android.providers.settings
2. adb restore saved-wifi-api100.ab
3. See that SettingsBackupAgent receives appVersionCode in onRestore()
Change-Id: I6092bea570e7e27cb5b72165e9284ad2befc21b6
Attempt to simplify the exposure of package signing information via
PackageInfo by creating a new class and corresponding methods for
querying a package's signing information.
Bug: 74831530
Test: PkgInstallSignatureVerificationTest
Change-Id: Idbc008b41a921f89cefb224b26f910da4d238dea
We still don't know the underlying cause of this, but we shouldn't crash
the system_server. Catching for now.
Bug: 74940472
Bug: 77574274
Test: m -j RunFrameworksServicesRoboTests
Change-Id: I36fc2e65f8766f6b8fd68104d8830b72668d84eb
In some cases (deferred restore) the app data needs to be cleared even
if the app has implemented backup agent. As a quick fix introduce
PACKAGES_TO_CLEAR_DATA_BEFORE_FULL_RESTORE secure setting, which
transport can fill prior to restore.
Bug: 69069240
Test: adb shell settings put secure packages_to_clear_data_before_full_restore com.google.android.apps.nexuslauncher && adb shell bmgr restore com.google.android.apps.nexuslauncher
Change-Id: I2a4651365d9cf4747f32d2ba69312f54cd03d118
This reverts commit f77cae61250c727630616b5672df2781e84a7e80.
Reason for revert: crashes SUW
Bug: 76128378
Change-Id: Ia77af64892aa5a03109cc4ef4c2c04b256000ba9
With the newly created Global setting for backup/restore agent timeouts
(backup_agent_timeout_parameters introduced in ag/3731401), update
references in backup and restore code to get the timeout values from
the setting instead of referencing constants in BMS.
This makes these timeouts configurable outside of the framework.
The default value of the setting is the same as the constants in BMS so
this should have no change on the timeout values used in the backup and
restore flow.
Bug: 70276070
Test: 1) m -j RunFrameworksServicesRoboTests
Change-Id: I0259bba76d0fed48158b8316f430b315ea98086e
Part of push to make backup and restore agent timeouts configurable. Creates
a Global setting for the current static BackupManagerService timeouts so
that they can be overriden with P/H. We keep the current default values,
which will be updated once we investigate what more appropriate values are.
Remame the constants to better reflect what they're used
for. Next, we will update the framework to use these constants.
This depends on the refactor of how we observe changes to key value
backup settings (ag/3709997).
Bug: 70276070
Test: m -j RunFrameworksServicesRoboTests ROBOTEST_FILTER=BackupAgentTimeoutParametersTest
Change-Id: Id506314ce0c8bd5e4d1d8b4001b26cbad0056c99
Extracts an abstract class to observe changes in backup parameter settings that
are stored as a comma-separated key value list. This class is
responsible for registering and unregistering a content observer on the
setting and updating local references to the parameters.
Refactor BackupManagerConstants and LocalTransportParameters to use this
implementation. This will also be used for the new backup timeout
setting.
Bug: 74346317
Test: 1) m -j RunFrameworksServicesRoboTests ROBOTEST_FILTER=BackupManagerConstantsTest
2) gts-tradefed run commandAndExit gts-dev -m GtsBackupHostTestCases -t com.google.android.gts.backup.TransportFlagsHostSideTest
Change-Id: Id4c50fbcf7479c925515887e3fa70e166dd9955c
Added units for http://ag/3709565. Some refactoring.
Test: m -j RunFrameworksServicesRoboTests
Bug: 72485465
Change-Id: Id75a4e0b96936580fd677041e091340b0fff8c1e
(cherry picked from commit cac3a7405997ab9783b537128107a71e6f5b75a2)
Retrievable via 'adb shell dumpsys backup transportstats'.
Sample output:
Average connection time: 36.00 ms
Max connection time: 181 ms
Min connection time: 7 ms
Number of connections: 16
Per transport:
com.google.android.gms/.backup.BackupTransportService
Average connection time: 27.71 ms
Max connection time: 139 ms
Min connection time: 13 ms
Number of connections: 14
com.google.android.gms/.backup.component.D2dTransportService
Average connection time: 181.00 ms
Max connection time: 181 ms
Min connection time: 181 ms
Number of connections: 1
android/com.android.internal.backup.LocalTransportService
Average connection time: 7.00 ms
Max connection time: 7 ms
Min connection time: 7 ms
Number of connections: 1
Bug: 72485465
Test: Will follow in another CL if reviewers OK w/ approach.
Change-Id: I133ed423d0b8471d69e3c3631aadee7d42d0ec0e
(cherry picked from commit e5a976404c66c054fbec9b124f816a90f9d6b4dc)
Says that backups can be canceled if one already running. Put message
for running backups in dumpsys for checking.
Bug: 72484277
Test: Triggered backup, checked dumpsys and bmgr backupnow
Change-Id: I028cf663858e374389f50175aaf5a3e8c9d45e42
Previously, the transport registration extra was a private
constant. Since GMSCore depends on this value being passed, moving
it to a public API prevents having to define it twice in
framework and GMSCore, and ensures compatibility between the two.
TODO: Update GMSCore with this constant once this drops
into GMSCore.
Bug: 72730566
Test: 1) m -j ROBOTEST_FILTER=TransportManagerTest RunFrameworksServicesRoboTests
2) m -j ROBOTEST_FILTER=TransportClientManagerTest RunFrameworksServicesRoboTests
Change-Id: I8f7a2ca0275047a5d3cc1a530cd86499d0170f2f
Around restoreAll() and restoreSome(). And some small refactorings in
restore code paths.
Test: m -j RunFrameworksServicesRoboTests
Change-Id: I0ff446ef4dcf15eade189c79e90a22c0f2eda0d6
Restoring of apps that rotated key wouldn't be possible due to
explicit signature matching.
Amend signature matching strategies to take into account
apps that have rotated key.
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/backup/utils/AppBackupUtilsTest.java
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/pm/backup/BackupUtilsTest.java
Test: m -j RunFrameworksServicesRoboTests
Test: runtest -p com.android.server.backup frameworks-services
Bug: 64686581
Bug: 34345052
Change-Id: I91b5ae0afb6f2714ceae02b4d4dc202d6cd4fe4e
Previously we'd only really clear data for K/V packages,
now we consult with the journal of ever backed apps.
Bug: 28405555
Test: manual (adb shell bmgr wipe com.google.android.gms/.backup.BackupTransportService com.android.wallpaperbackup
after adb shell bmgr backupnow --all)
Test: m -j RunFrameworksServicesRoboTests
Test: runtest -p com.android.server.backup frameworks-services
Change-Id: If99cb2c8ab9ddc05386d634818f4585ec47efc00
When connecting to a transport, let the transport
know if this connection is for registration. This is to
prevent updating transport attributes during registration
in GMSCore.
Bug: 72730566
Test: 1) m -j ROBOTEST_FILTER=TransportManagerTest RunFrameworksServicesRoboTests
2) m -j ROBOTEST_FILTER=TransportClientManagerTest RunFrameworksServicesRoboTests
3) adb reboot; adb logcat | grep BackupTransportManager; check no errors with "...not registered tried to change description"
4) GMSCore Robo tests
Change-Id: I5adf6ea3e668a8e8ed8c568728d109814b6f8975
Add @GuardedBy for simple functions that require a single lock
and are named XYZLocked.
Derived by errorprone.
Bug: 73000847
Test: m
Test: m javac-check-framework RUN_ERROR_PRONE=true
Change-Id: Id1d9fbe5018250e3b9d1466fc5f670d5ad902fa3
Now, if adb backup/restore is currently active and the activity is
passed a new intent, the activity instance would be updated with the new intent.
Same for if the activity is relaunched.
Before, the activity would ignore intent changes and use old tokens and
views, leading to backing up/restoring wrong files.
Bug: 65723308
Test: adb backup -f old.ab -all; ctrl-c; adb backup -f new.ab -all;
gts-tradefed run commandAndExit gts-dev -m GtsBackupHostTestCases
Change-Id: Ifa11efecf82a682a578dab7e5795328ab7d0c054
The interface will be removed in a subsequent CL, it will be
easier to deal with merge conflicts.
Test: 1) m -j RunFrameworksServicesRoboTests
2) runtest -p com.android.server.backup frameworks-services
Bug: 65823538
Change-Id: I37c4c6758c646e1b18889ed05aa1b1d7c6129cf0
Extracted connection in TransportClient to static class with weak
reference to TransportClient so that TransportClient is garbage
collected when left undisposed. Created finalize method that logs,
unbinds TransportClient and warns using CloseGuard.
Also adjusted some logging.
Bug: 17140907
Test: m -j RunFrameworksServicesRoboTests
Test: Manually left a dangling TransportClient and observed logs and
connections
Change-Id: I30f89e7c27579089ba29936483abd1b60c9e8e37
This allows a BackupAgent to check whether the transport has client-side
encryption enabled. It can then use this information to decide whether
to back up more sensitive data.
Bug: 72299360
Test: Manually verified full & kv backup agents receive transport flags
Test: m -j RunFrameworksServicesRoboTests
Change-Id: Ibd9b5f9479815e1721e9d6b7663d892b9ab3fcae
Add a new performBackup() return code TRANSPORT_PACKAGE_DATA_LOST. If
the transport returns this then delete the state for the package and
immediately retry it. Thus the retry will be a non-incremental backup.
I have left the new constant as @hide to unblock this change. I will add
this to the current API review change: ag/3477872.
Bug: 71887023
Test: I tested manually by returning the new code for both @pm@ and
other key value packages. No automated test exists for this file, and it
will be tricky to add this before IC.
Change-Id: I4357a8b297c373eb81e25afb82d480b26f6642b6
Previously it shared the INITIAL state with various set up work and
initializing the transport if needed. By moving it to its own state this
will mean we can retry a non-incremental backup of @pm@ if the transport
indicates that it has lost the state.
I removed the "mStatus == BackupTransport.TRANSPORT_NOT_INITIALIZED" as
the mStatus could never have this value at that point.
TRANSPORT_NOT_INITIALIZED is returned by the transport.performBackup(),
which is not executed until after beginBackup() has returned.
Bug: 71887023
Test: Manually tested init case, incremental case, @pm@ error case, init
error case. There are no unit tests for this file, and it's 1200 lines
long which makes writing them for IC difficult.
Change-Id: I23b7512391068316f4c1039faf88cc27905f4492
This method is called by bmgr backupnow. Bmgr pid is not system uid.
When executing the method it fails with permission denied because it
can't bind to the transport. Before binding on-demand we haven't seen
this error because we didn't try to bind in the method, it was always
bound.
Bug: 72215413
Test: adb shell bmgr backupnow -all
Change-Id: I82ad712e893abfec4727d568ab48a49945645eb4
There was a deadlock around the transport lock. We registered transports
with the transport lock held, this kicked-off transport onCreate()
synchronously, which called TransportManager
updateTransportAttributes(), which tried to acquire mentioned lock but
couldn't. This CL removes the lock for any call to the transport or
operation that triggers a call to the transport (it was
TransportClient.connect() or its variants).
Test: Load GMSCore before fix, boot, register transports, check no ANR
Test: m -j RunFrameworksServicesRoboTests
Test: adb shell bmgr transport -c <transport>, being registered & not
Bug: 72147303
Change-Id: I72ca145d7fb73c0ef29c4aa1b620fea4969481db