Remove useless optimization mode backup for FULL_POWER_LIST am: 2c125d29a3
am: 147033c85c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23240822 Change-Id: Ib95cb6bcc579c19a16f670adecba7ba91bae6468 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -159,34 +159,6 @@ public final class BatteryBackupHelperTest {
|
||||
verify(mBackupDataOutput, never()).writeEntityHeader(anyString(), anyInt());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void performBackup_oneFullPowerListElement_backupFullPowerListData()
|
||||
throws Exception {
|
||||
final String[] fullPowerList = {"com.android.package"};
|
||||
doReturn(fullPowerList).when(mDeviceController).getFullPowerWhitelist();
|
||||
|
||||
mBatteryBackupHelper.performBackup(null, mBackupDataOutput, null);
|
||||
|
||||
final byte[] expectedBytes = fullPowerList[0].getBytes();
|
||||
verify(mBackupDataOutput).writeEntityHeader(
|
||||
BatteryBackupHelper.KEY_FULL_POWER_LIST, expectedBytes.length);
|
||||
verify(mBackupDataOutput).writeEntityData(expectedBytes, expectedBytes.length);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void performBackup_backupFullPowerListData() throws Exception {
|
||||
final String[] fullPowerList = {"com.android.package1", "com.android.package2"};
|
||||
doReturn(fullPowerList).when(mDeviceController).getFullPowerWhitelist();
|
||||
|
||||
mBatteryBackupHelper.performBackup(null, mBackupDataOutput, null);
|
||||
|
||||
final String expectedResult = fullPowerList[0] + DELIMITER + fullPowerList[1];
|
||||
final byte[] expectedBytes = expectedResult.getBytes();
|
||||
verify(mBackupDataOutput).writeEntityHeader(
|
||||
BatteryBackupHelper.KEY_FULL_POWER_LIST, expectedBytes.length);
|
||||
verify(mBackupDataOutput).writeEntityData(expectedBytes, expectedBytes.length);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void performBackup_nonOwner_ignoreAllBackupAction() throws Exception {
|
||||
ShadowUserHandle.setUid(1);
|
||||
@@ -283,7 +255,7 @@ public final class BatteryBackupHelperTest {
|
||||
|
||||
@Test
|
||||
public void restoreEntity_incorrectDataKey_notReadBackupData() throws Exception {
|
||||
final String incorrectDataKey = BatteryBackupHelper.KEY_FULL_POWER_LIST;
|
||||
final String incorrectDataKey = "incorrect_data_key";
|
||||
mockBackupData(30 /*dataSize*/, incorrectDataKey);
|
||||
|
||||
mBatteryBackupHelper.restoreEntity(mBackupDataInputStream);
|
||||
|
Reference in New Issue
Block a user