Fix broken tests: com.android.settings.fuelgauge

Bug: 215064709
Fixes: 215064709
Test: make -j64 RunSettingsRoboTests ROBOTEST_FILTER="com.android.settings.fuelgauge"
Change-Id: I79a27b4fcef3a21207b37db422d983ae9d521b45
This commit is contained in:
ykhung
2022-01-23 01:04:40 +08:00
parent 7dd97c7091
commit c8a63b3416
3 changed files with 8 additions and 183 deletions

View File

@@ -67,6 +67,9 @@ public final class BatteryBackupHelper implements BackupHelper {
static final String KEY_FULL_POWER_LIST = "full_power_list";
static final String KEY_OPTIMIZATION_LIST = "optimization_mode_list";
@VisibleForTesting
List<ApplicationInfo> mTestApplicationInfoList = null;
@VisibleForTesting
PowerAllowlistBackend mPowerAllowlistBackend;
@VisibleForTesting
@@ -267,6 +270,9 @@ public final class BatteryBackupHelper implements BackupHelper {
}
private List<ApplicationInfo> getInstalledApplications() {
if (mTestApplicationInfoList != null) {
return mTestApplicationInfoList;
}
final List<ApplicationInfo> applications = new ArrayList<>();
final UserManager um = mContext.getSystemService(UserManager.class);
for (UserInfo userInfo : um.getProfiles(UserHandle.myUserId())) {