Merge "Fix broken tests: com.android.settings.fuelgauge"

This commit is contained in:
YK Hung
2022-01-24 00:23:51 +00:00
committed by Android (Google) Code Review
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())) {