Commit Graph

460 Commits

Author SHA1 Message Date
TreeHugger Robot
861872dace Merge "Remove BackupManagerServiceInterface" 2018-10-16 10:01:08 +00:00
Bernardo Rufino
d77874c423 Merge "[KV] Only discard state if non-null" 2018-10-15 09:17:18 +00:00
Bernardo Rufino
5dcff70658 [KV] Only discard state if non-null
To avoid NPEs. Added tests. This design is not optimal but left any
re-design to be done when we move applyStateTransition() to more upper
levels, which is going to happen when we extract package-backup.

Bug: 117269444
Test: atest FrameworksServicesRoboTests
Test: 1. Set BackupApp to time-out on agent onCreate()
      2. adb shell bmgr backupnow --non-incremental
         com.google.android.apps.backupapp
      3. Verify it doesn't crash
Change-Id: I7a3fd3d3d5a4b5931206564c197edd86b6321933
2018-10-12 15:09:47 +01:00
Bram Bonné
477a17e6d8 Ports part of the backup/encryption/chunking code from gmscore.
Some additional changes (apart from style) were needed:
- ChunkOrderingType.java is an @IntDef referencing the possible values
for the ChunkOrderingType enum in the proto.
- EncryptedChunk.java is no longer an AutoValue class.
- Inlined some constants from Guava.

Bug: 111386661,116575321
Test: atest RunFrameworksServicesRoboTests
Change-Id: I7656cae13de0bd918be5016ffb155de4b8fd5f71
2018-10-05 12:58:06 +02:00
Bernardo Rufino
a5ccb6c032 Remove BackupManagerServiceInterface
Interface was created for switching between refactored and
non-refactored version, not needed anymore. Removed with IntelliJ's
Refactor > Inline... tool.

Bug: 22388012
Test: atest FrameworksServicesTests
Test: atest FrameworksServicesRoboTests
Test: adb shell bmgr backupnow <package>
Change-Id: I7d92b73676634ddd09a1bc71cbcfc4400ad1be90
2018-10-02 14:13:07 +01:00
Bram Bonné
ab4bbc038e Merge "Moves all backup chunk-model related classes over to the framework." 2018-09-27 12:19:58 +00:00
Bernardo Rufino
4fee398440 Merge "[KV] Exceptions for error-handling" 2018-09-26 09:11:20 +00:00
TreeHugger Robot
d142f36457 Merge "Set KV MORE_DEBUG to false and add tests" 2018-09-25 18:52:18 +00:00
Bernardo Rufino
1f1bae9073 [KV] Exceptions for error-handling
Added 2 exceptions:
* TaskException: For what we used to call transport-level failures,
  these bring queue processing to a halt.
* AgentException: For failures that happen due to the backup agent, these
  only prevent the backup of the current package, still allowing backup
  for the remaining packages in the queue.

These are usually thrown deep in the call stack and caught in backupPackage()
(and similarly backupPm()) and run(), the former for clean-up, where
they are re-thrown and the latter for further processing where they are
finally swallowed. The clean-up is more explicit now.

This enabled further refactoring of backupPackage()/backupPm(),
extractAgentData() and sendDataToTransport().

One change that I intend to revisit is reporting to the observer.
Previously we used to detect some exceptional cases and set mStatus
(which doesn't exist anymore) to other more general exceptional case and
then in this general case handling report the success/failure to the observer.
With the new exception-throwing model I changed this and the leaves are
actually responsible for reporting success/failure to the observer (see
changes in the reporter). This is to avoid too many changes in this CL.

I'm entertaining the idea of extracting out package backup as a separate
class and leave only queue-processing and generic bookkeeping to this
class.

Test: atest FrameworksServicesRoboTests
Test: adb shell bmgr backupnow <kv_package>
Change-Id: If3b1da7a5eb939e453f94fad76f5790696d1265a
2018-09-25 15:49:43 +01:00
Bram Bonné
226dfa2eda Moves all backup chunk-model related classes over to the framework.
Includes the proto definition of ChunksMetadata and related classes.

Some additional changes (apart from style) were needed:
- EncryptedChunkOrdering was modified to be a non-AutoValue class, and
tests were added.
- Protos are now read from an InputStream manually, as any protos should not
be used directly in the platform.
- Helper classes are added for reading from ProtoInputStream.

Bug: 111386661,116575321
Test: atest RunFrameworksServicesRoboTests
Change-Id: I8b74ad059d72e305be7817f79f8c61aa50f7b268
2018-09-25 16:04:32 +02:00
Bernardo Rufino
e58291256b Fix caller log on appIsRunningAndEligibleForBackupWithTransport
Test: atest FrameworksServicesRoboTests
Test: adb shell bmgr backupnow --all
Change-Id: I577db6fb92880916a231ffa36a468bd64d8cae09
2018-09-20 11:59:10 +01:00
Bernardo Rufino
cad924cfd4 Set KV MORE_DEBUG to false and add tests
Forgot this one in the CL. Also added tests to catch this in presubmit.

Test: atest FrameworksServicesRoboTests
Test: adb shell bmgr backupnow <kv_package> and verify no MORE_DEBUG
      logs

Change-Id: I14affca28609bcd855e13fdcc160994c71ed9695
2018-09-20 11:52:07 +01:00
TreeHugger Robot
071f28ded1 Merge "Revert the mandatory backups feature." 2018-09-13 08:45:35 +00:00
Lenka Trochtova
3b6e08772e Revert the mandatory backups feature.
Bug: 79736299
Test: make RunFrameworksServicesRoboTests
Test: cts-tradefed run cts -m CtsBackupHostTestCase

Change-Id: I1209174c9f6aa794c7ca67f4a8737c0589d5fd69
2018-09-12 13:39:05 +02:00
Bram Bonné
629d31c543 Merge "Moves first parts of backup crypto code (ChunkHash class) to the framework." 2018-09-12 10:02:24 +00:00
Bram Bonné
cf2b7c3b39 Moves first parts of backup crypto code (ChunkHash class) to the framework.
Some changes were needed to the original code:
- Guava's EqualsTester tests are replaced by regular equals tests.
- Guava's primitives.UnsignedBytes.LexicographicalComparator needed to
be copied over, as no corresponding comparator exists in the framework.

Bug: 111386661
Test: atest RunFrameworksServicesRoboTests
Change-Id: I24fef4b47f7777b9be0c2e51f0be48e45b323987
2018-09-11 19:32:25 +02:00
TreeHugger Robot
944dca780e Merge "[KV] Refactor clean-up" 2018-09-10 11:56:20 +00:00
Annie Meng
1374690674 [FBR] Extract app metadata backup to helper
In full backup, we backup additional metadata about the app
(manifest, widget, apk, obb) not specified by the app's backup agent.
This CL extracts these methods out to their own helper (AppMetadataBackupWriter)
and adds unit tests for these methods.

** Note: The backup behavior is the same, only the structure has changed.
Behavioral changes will be done in future CLs. **

What this CL covers:
- Move the backup of this extra app data out of the FullBackupEngine to
separate agent data backup and non-agent data backup.
- Move logic of deciding what data to backup from FullBackupEngine to
FullBackupRunner (where the writer is used).
- Add unit tests for metadata backup.
- Some style fixes/clean up.

Not covered (future CLs):
- Refactoring FullBackupEngine/FullBackupRunner mechanism.
- Streaming backup data directly instead of writing to temporary files.
- Separating out and fixing apk and obb backup.

Bug: 110081582
Test: 1) atest AppDataBackupWriterTest
2) atest RunFrameworksServicesRoboTests
3) atest GtsBackupHostTestCases
4) Verify success for:
 - adb shell bmgr backupnow <full backup package>; adb restore 1 <full
backup package>
 - adb backup <full backup package>; adb restore
 - cloud backup and restore
5) Use local transport and adb backup to inspect manifest and widget data
written and file metadata consistent between runs.
6) Verify compatibility with adb backup -keyvalue manifest

Change-Id: Icb43fd2e0505c2416738ee3ef370b206363fac68
2018-09-07 14:56:45 +01:00
Bernardo Rufino
ef0d93eb71 [KV] Refactor clean-up
Only clean-up after possibly calling quota exceeded to avoid bug linked.
Small refactors and tests.

Test: atest KeyValueBackupTaskTest
Test: atest KeyValueQuotaTest
Bug: 114002519
Bug: 110082831
Change-Id: If53aaa59287cf9f2ac8d9ad47afc0a62161373c5
2018-09-07 14:23:31 +01:00
Bernardo Rufino
74eee1031c Use RemoteCall for quota exceeded in backups
For both key-value and full-backup. This makes the tasks wait for the
quota exceeded call, allowing the agent to complete before being torn
down (as described in bug). Also added a short time-out (3s) in case of
misbehaving agents.

Bug: 68762178
Bug: 110082831
Test: atest FrameworksServicesRoboTests
Test: 1. while true; do atest FullBackupQuotaTest; done
      2. Stop after ~50 executions, verify all succeeded.
Test: 1. while true; do atest KeyValueQuotaTest; done
      2. Stop after ~50 executions, verify all succeeded.
Test: CtsBackupTestCases

Change-Id: Ib582e75a4d317ab53a6df8cb261966a04ef085fb
2018-09-03 13:53:33 +00:00
Bernardo Rufino
6a422d6a61 [KV] Consider throwing BackupAgent a failure
And not a success as it used to be.

Bug: 111051813
Bug: 110082831
Test: atest KeyValueBackupTaskTest
Test: 1. BackupApp throwing in onBackup.
      2. adb shell bmgr backupnow com.google.android.apps.backupapp
      3. Verify logs and that it threw and we did not save backup data for it.
Test: 1. BackupApp not throwing.
      2. adb shell bmgr backupnow com.google.android.apps.backupapp
      3. Verify logs and that data was sent to transport.

Change-Id: Idb7fe298f64786668989c30cdce53355aeef7277
2018-08-31 17:32:26 +01:00
Bernardo Rufino
47b3cf937c [KV] Remove states
To do so, had to:
* Remove PM state and put it back into the queue.
* Introduce 'active' boolean in the queue loop, which when false breaks
  out of the loop. (This is because the states collapsed into 'keep
  going' and 'finish' states.)
* Renamed extractNextAgentData() to backupPackage().
* Queue handling from backupPackage() to run().
* Agent result handling from run to backupPackage().

Bug: 110082831
Test: atest KeyValueBackupTaskTest
Test: adb shell bmgr backupnow <kv_package>
Change-Id: If6efcbf91f10426d3c955b83deb1ecd8e714f79a
2018-08-31 15:00:38 +01:00
Bernardo Rufino
0830f64222 [KV] Refactor sendDataToTransport() and finishTask()
Refactor sendDataToTransport():
* Instead of truncating backup data when reading backup data / writing widget
  data, consider the IOException a transport-level failure. Added tests for
  this.
* Extracted a few methods: validateBackupData(), updateFiles(),
  handleTransportStatus().
* Put the if (size > 0) check outside try-catch block.
* Used try-with-resources.
* Clean files in case of transport error, quota exceeded.

Refactor finishTask():
* Extracted triggerTransportInitializationLocked(), assigned queue lock
  to private final var in ctor.
* In triggerTransportInitializationLocked() set the status to T_ERROR if
  we failed to query the name of the transport.
* Tests for TRANSPORT_NOT_INITIALIZED.

General:
* Small refactors in KVBT.
* Small refactors in test.

Bug: 110082831
Bug: 113311470
Test: adb shell bmgr backupnow <kv_package>
Test: 1. adb shell bmgr backupnow <kv_package>
      2. Transport returns T_NOT_INITIALIZED
      3. Make sure PM metadata state file is deleted.
Test: atest KeyValueBackupTaskTest
Change-Id: I8d85c24cba6da4fbaf14234e2ce6d8e0699a3eed
2018-08-31 08:29:12 +01:00
Bernardo Rufino
e80f270e7f [KV] Cancellation and small refactors
* Refactored cancellation a bit.
* Added tests for cancellation, had to break down handleCancel() in 2 methods.
* Removed BackupRequest.
* Removed onPmFoundInQueue() report.
* Renamed a few methods.
* Moved PM package synthetization to backupPm().

Test: atest RunFrameworksServicesRoboTests
Test: adb shell bmgr backupnow <kv_package>
Test: 1. adb shell bmgr backup <kv_package>
      2. adb shell bmgr run
Test: 1. adb shell bmgr backupnow com.google.android.apps.backupapp
      2. Cancel while in-flight
      3. Verify data not backed-up
Test: 1. adb shell bmgr backupnow --non-incremental com.google.android.apps.backupapp
      2. While in-flight, check blank_state file exists.
      3. When it finishes, check blank_state file does not exist.
Test: atest BackupManagerHostTest
Change-Id: Ie74a19189dc700ef517417b54ecb8930c6aa41ce
2018-08-15 09:17:21 +01:00
Bernardo Rufino
bd758fd738 [KV] Extract event reporting and remove traces
Created KeyValueBackupReporter, which includes:
* Logcat (main and event buffers).
* Backup observer.
* Backup manager monitor.

Also removed traces since they weren't very useful. Hopefully this will clear
KVBT of noise and help spot refactor opportunities. Did some small refactors
along w/ it.

Methods are starting to fit in one (big) screen :)

Bug: 110082831
Test: atest KeyValueBackupTaskTest
Test: adb shell bmgr backupnow <kv_package> and verify logs
Test: Kicked-off KV in different scenarios to check logs, this is
      tracked in https://docs.google.com/spreadsheets/d/1EcZ61qapj2cW_Yr99gIlQz0QVJ_BQfVc_1dHBor2cOo/edit?usp=sharing
Test: adb shell bmgr backupnow <kv_package> <fb_package>
      Verify PFTBT is kicked-off and logs
Change-Id: I1486049861543b5ad558b45cf0e0206532e20632
2018-08-09 14:24:11 +01:00
Bernardo Rufino
8fe7b59a71 Add null check for full-backup task
The backup-already-running code-path leaves the field null.

Bug: 112359186
Test: atest KeyValueBackupTaskTest
Test: 1. adb shell bmgr backupnow --all &>/dev/null&
      2. adb shell bmgr backupnow com.google.android.apps.backupapp
      3. Verify it finishes and no error

Change-Id: I6880c4e7752b943608d41c946e8d18d46cd9da38
2018-08-09 12:01:04 +01:00
Bernardo Rufino
75f73f07fe [KV] Move KVBT to its own package
And related classes.

Test: atest RunFrameworksServicesRoboTests
Test: adb shell bmgr backupnow com.google.android.apps.backupapp
Test: 1. adb shell bmgr backup com.google.android.apps.backupapp
      2. adb shell bmgr run
Test adb shell cmd jobscheduler run -f android 20537

Change-Id: I1aba694786a4e2a5add5c388cd095700ade1ace9
2018-08-06 12:20:04 +01:00
Bernardo Rufino
088a0ef493 [KV] Refactor logs
Unify formatting. Start w/ upper case, using ',' instead of ';', '-'.

Test: atest KeyValueBackupTask
Test: 1. adb shell bmgr backupnow com.google.android.apps.backupapp
      2. Verify logs
Test: atest CtsBackupTestCases
Test: atest CtsBackupHostTestCases
Test: atest GtsBackupTestCases
Test: atest GtsBackupHostTestCases

Change-Id: I171110f69e66d0311cbf030b210600ddf1ad5656
2018-08-03 15:59:19 +01:00
Bernardo Rufino
cc714c1c67 [KV] PerformBackupTask => KeyValueBackupTask
Test: atest RunFrameworksServicesRoboTests
Test: adb shell bmgr backupnow com.google.android.apps.backupapp
Test: adb shell bmgr backup com.google.android.apps.backupapp
      adb shell bmgr run
Test: atest ScheduledBackupHostSideTest

Change-Id: I30b689538e6301d05416e21abe012a51ef83c5df
2018-08-02 14:55:32 +01:00
Bernardo Rufino
2d87f453d9 [KV] State machine to linear task w/ RemoteCall
This is the first CL of key-value backup refactor.

* Method execute() that executed the state machine states is now empty
  and run() is created with the initial version of the linear task. It's
  basically composed of begin + loop + end. Although it still has the notion
  of state, it's more restricted than before (with private methods returning
  the next state). This is intentional to avoid making this CL too heavy to
  review and to avoid too much behavioral changes here. In the next CLs I
  intend to remove BackupState.

* Introduction of RemoteCall, which encapsulates an outbound call that
  leaves the system_server, with time-out and cancellation built-in.
  Agent calls are now triggered using this. As a result there is no more
  operationComplete() method either.

* Cancellation now is cleaner. We don't need a step lock anymore, only a
  (volatile) boolean that is checked in every queue iteration. If asked
  to cancel during an ongoing agent call we rely on RemoteCall.cancel()
  to return control of the task thread to us. We wait for the cancel
  acknowledgement to preserve the contract of no more transport calls.

* PFTBT instantiation moved from the constructor to the run() method,
  which makes more sense.

* No need for mFinished, mBackupData == null bookkeeping since time-outs,
  cancellation and legitimate agent responses won't step into one another
  anymore.

* Ternary (mQueue.isEmpty) ? BackupState.FINAL : BackupState.RUNNING_QUEUE gone
  because we check this in the beginning of invokeNextAgent() and now we
  don't pay the state-machine tick price associated with the handler.

* PerformBackupTask call sites now call static method start(), that
  spins up a new dedicated thread for the task. This new thread is
  assigned the same (process) priority as the backup thread
  (THREAD_PRIORITY_BACKGROUND).

Work left for future CLs:

* RemoteCall spins up a new thread for kicking off the call, this is for
  system agents that are executed inline. Old PBT also executed in the same
  thread (backup handler thread), so maintaining this to keep this CL at
  a reasonable size.

Test: atest PerformBackupTaskTest
Test: atest RunFrameworksServicesRoboTests
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/backup
Test: atest CtsBackupTestCases
Test: atest CtsBackupHostTestCases
Test: atest GtsBackupTestCases
Test: atest GtsBackupHostTestCases
Test: adb shell bmgr backupnow <kv_packages>
Test: 1. adb shell bmgr backup <p1> <p2>
      2. adb shell bmgr run
      A) 3. Cancel while sending <p1> data to transport
         4. Verify <p1> is backed-up and not pending
	    Verify <p2> is not backed-up and is pending
      B) 3. Cancel while waiting for <p1> agent
         4. Verify <p1> is not backed-up and is pending
	    Verify <p2> is not backed-up and is pending

Change-Id: Ia456c4e807de95d662c9e923245be07e8996f58a
2018-07-30 17:04:02 +01:00
Bernardo Rufino
374b2522b3 Increase PerformBackupTask unit coverage 3
With KV Refactor in mind:
* Tests around calling agent.
* Tests around agent writing data.
* Tests around transport handling agent data.
* Small modification on ShadowBackupData{Input,Output} to allow empty data.
* Small refactor.

Test: atest PerformBackupTaskTest
Change-Id: Ia9296859926d09d5bbcb0532fb869ace110240e4
2018-07-26 11:42:23 +00:00
Bernardo Rufino
fd1d729574 Increase PerformBackupTask unit coverage 2
With KV Refactor in mind.
* Split empty queue test into multiple tests.
* Tests around packages failing backup pre-conditions.
* Added verifications for event logging.
* Renamed some tests to better reflect important parts of it.
* More tests about one package.
* Introduced PackageData to help mock packages, much like TransportData.
* Some small refactors.

Test: atest PerformBackupTaskTest
Change-Id: I23aba2b26e82f8643cc1c90f9408510ab34045fd
2018-07-20 18:11:25 +01:00
Bernardo Rufino
c1b6ca05ef Increase PerformBackupTask unit coverage
With KV Refactor in mind.
* Added tests around empty queue and single package backups.
* Refactored a bit some of the existing tests.
* Moved from mocking BMS to using a real instance and had to adjust a
  few things for this.

Test: atest PerformBackupTaskTest
Change-Id: I0ee3be32c7cbac5ed2cdc2717408749907c15ade
2018-07-17 12:23:11 +01:00
Anton Philippov
5148582ef2 Use FullRestoreEngine in adb restore.
PerformAdbRestoreTask and FullRestoreEngine has shared a lot of code,
remove the copy that was in PerformAdbRestoreTask.

Test: adb restore
Change-Id: Ib4ce8b50eff8aed4a2c0660808c05b80f378ea98
2018-06-15 11:38:29 +00:00
TreeHugger Robot
c87e4b8ea0 Merge "Update PerformInitializeTask error message" 2018-06-11 11:34:26 +00:00
Bernardo Rufino
1f315591ba Update PerformInitializeTask error message
Bug: 109652198
Test: m -j RunFrameworksServicesRoboTests
Change-Id: Iaef534bba74b05f73e150d9fc3ff212c788e8205
2018-06-08 17:54:19 +01:00
Bernardo Rufino
7307e645b8 Check manifest if runtime state of app is DEFAULT
Before we were considering that the app was enabled in this case, which
might not be always true.

Bug: 80227098
Test: atest AppBackupUtilsTest
Test: Check app w/ manifest enabled="true" is backed-up, but
      enabled="false" is not.

Change-Id: I4625aa39ba0de45ce6689f2375245081a5d4d722
2018-06-06 08:19:09 +00:00
Annie Meng
8cdae01244 Clear calling identity in BMS.backupNow
BMS.backupNow is called from GMSCore, which has a different calling
identity than the framework. This causes an IllegalArgumentException due
to uid mismatch when backupNow tries to schedule a job.

This occurs when the following conditions are combined:
1) Battery saver mode enabled
2) Network change detected
3) Backup pass is scheduled for now

Bug: 79441902
Test: 1) m -j RunFrameworksServicesRoboTests
2) Manual: Enabled battery saver, modified code to run backupNow with
each network change and overwrite previously scheduled KeyValueJob.
Then, change wifi to trigger scheduling the KeyValueJob.
Verified:
- IllegalStateException b/c of uid mismatch without change
- No exception and correct calling uid with change

Change-Id: Iac90cd435e3fc32ff5428236aa15507b36aa833d
2018-05-25 09:45:18 +00:00
TreeHugger Robot
a41a7094ac Merge "Add getCurrentTransportComponent() API" 2018-05-24 13:13:18 +00:00
Bernardo Rufino
98b17a6146 Add getCurrentTransportComponent() API
Bug: 73640944
Test: atest RunFrameworksServicesRoboTests
Change-Id: I62193d63367c3b7564ccd41f5b103a7076764e3f
2018-05-14 11:36:11 +01:00
ericchhsu
e6e63cd6c6 Instantly excute next state when the agent provides a prohibited key.
When the agent provides a prohibited key, the code flow will directly be returned
without excuting next backup state. The next state should be execute instantly to
make sure the backup mechanism can be executed properly.

Bug: 77272601
Test: 1.m -j RunFrameworksServicesRoboTests
      2.Manual testing by test package with prohibited key.
      - adb backup -all
      - adb backup -shared
      - adb backup -obb -all
      - adb shell bmgr backupnow --all
      - adb shell bmgr backupnow [test key value package]
      - adb backup -keyvalue [test key value package]
Change-Id: I46e1aa8dd0f75cf54087b43cee50ee952d85abc1
2018-05-03 11:55:17 +08:00
Shaowei Shen
44b8e043cf Merge "Fix [kv-3]PerformBackupTask using last package status to decide status sent to IBackupObserver." into pi-dev am: 49a987c277
am: 661afbe5fa

Change-Id: Ia242afee49f7c715ba0b6fa65a4325b89e26f79d
2018-05-02 19:24:29 -07:00
Shaowei Shen
49a987c277 Merge "Fix [kv-3]PerformBackupTask using last package status to decide status sent to IBackupObserver." into pi-dev 2018-05-03 02:05:17 +00:00
android-build-team Robot
492e53ee17 Merge "Don't run obb backup for shared storage backup package." into pi-dev am: 494113e74a
am: e673650aff

Change-Id: I97389ba178bf6a225c375d27d91655e9957bbbf5
2018-05-01 08:53:05 -07:00
Anton Philippov
09589d0073 Don't run obb backup for shared storage backup package.
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
2018-05-01 14:27:00 +01:00
shaoweishen
59ab5f4934 Fix [kv-3]PerformBackupTask using last package status to decide status sent to IBackupObserver.
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
2018-04-24 09:54:37 +08:00
Allen Su
8eb97f61a4 PerformBackupTask getting 2 IBackupObserver.backupFinished()
Remove IBackupObserver.backupFinished() before
executeNextState(BackupState.FINAL), add test cases to verify it and
format PerformBackupTaskTest.java
Bug: 77272662
Test: make RunFrameworksServicesRoboTests

Change-Id: Ia464d0326437fb8680ab88619829c483e2c1164d
2018-04-24 00:01:05 +08:00
Henry Liu
cfa5a82f82 Fix [kv-4] PerformBackupTask possible NPE/Wrong package report.
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 87f1209ac6)
2018-04-12 02:44:50 +00:00
Henry Liu
af3598cf13 Merge "Fix [kv-4] PerformBackupTask possible NPE/Wrong package report." 2018-04-12 02:43:18 +00:00
Henry Liu
87f1209ac6 Fix [kv-4] PerformBackupTask possible NPE/Wrong package report.
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
2018-04-12 02:17:20 +00:00