Refactor BatteryOptimizeUtils from enum to @IntDef

Based on the Android API Council guideline, we should avoid using the
Enum structure to define the constant definition.
go/android-api-guidelines#avoid-enum

Bug: 197595292
Test: make SettingsRoboTests
Change-Id: I4b22f0abde7f4ce2c3a0b076db786e619783d93e
Merged-In: I4b22f0abde7f4ce2c3a0b076db786e619783d93e
This commit is contained in:
ykhung
2021-08-24 14:37:05 +08:00
committed by YUKAI HUNG
parent a1b8347ae4
commit 0ab0a3af56
10 changed files with 84 additions and 70 deletions

View File

@@ -180,8 +180,8 @@ public final class BatteryBackupHelperTest {
mBatteryBackupHelper.backupOptimizationMode(mBackupDataOutput, allowlistedApps);
final String expectedResult =
packageName1 + "|UNRESTRICTED," + packageName2 + "|RESTRICTED,";
// 2 for UNRESTRICTED mode and 1 for RESTRICTED mode.
final String expectedResult = packageName1 + "|2," + packageName2 + "|1,";
final byte[] expectedBytes = expectedResult.getBytes();
verify(mBackupDataOutput).writeEntityHeader(
BatteryBackupHelper.KEY_OPTIMIZATION_LIST, expectedBytes.length);