OSDN Git Service

Binding on-demand #8: Miscellaneous usages
authorBernardo Rufino <brufino@google.com>
Tue, 2 Jan 2018 16:01:53 +0000 (16:01 +0000)
committerBernardo Rufino <brufino@google.com>
Fri, 5 Jan 2018 16:33:33 +0000 (16:33 +0000)
commitfa51853ae56ed74a0c854c01851cb1435453005f
treed9ae04564295053eb2b8621f55fa2f64b63bb1a3
parentdc4cb146315240441fc8d9c05fe8dd63370a7c57
Binding on-demand #8: Miscellaneous usages

Migrate usages of the transport binder to binding on-demand:
* getDestinationString()
* isAppEligibleForBackup()
* dump()

For getDestinationString() we'll be introducing an invisible bug for
people that haven't updated GMSCore to include the usage of
updateTransportAttributes() API introduced in earlier CL. The bug is
that that text won't change, it'll remain constant. It's invisible
because currently only place that uses that method is Settings in some
circumstances that depend on the transport, and those circunstances
don't happen with our transports. Check http://ag/1831025.

For isAppEligibleForBackup(), a new filterAppsEligibleForBackup() is
created and there we bind on-demand.

Change-Id: Idc9e31f0e8eda8531e204c05a84fafdaf0247d08
Ref: http://go/br-binding-on-demand
Bug: 17140907
Test: adb shell dumpsys backup, observe destination of transports
Test: adb shell bmgr backupnow --all, observe only eligible apps got backed-up
Test: Force-loaded settings screen and observed destination string
Test: m -j RunFrameworksServicesRoboTests
12 files changed:
cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
core/java/android/app/backup/IBackupManager.aidl
services/backup/java/com/android/server/backup/BackupManagerServiceInterface.java
services/backup/java/com/android/server/backup/RefactoredBackupManagerService.java
services/backup/java/com/android/server/backup/Trampoline.java
services/backup/java/com/android/server/backup/TransportManager.java
services/backup/java/com/android/server/backup/utils/AppBackupUtils.java
services/robotests/src/com/android/server/backup/BackupManagerServiceRoboTest.java [new file with mode: 0644]
services/robotests/src/com/android/server/backup/internal/PerformInitializeTaskTest.java
services/robotests/src/com/android/server/backup/testing/ShadowAppBackupUtils.java [new file with mode: 0644]
services/robotests/src/com/android/server/backup/testing/TransportTestUtils.java [new file with mode: 0644]
services/tests/servicestests/src/com/android/server/backup/BackupManagerServiceTest.java