Loading src/com/android/settings/fuelgauge/batteryusage/BatteryChartPreferenceController.java +1 −1 Original line number Diff line number Diff line Loading @@ -559,7 +559,7 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll final Map<Integer, Map<Integer, BatteryDiffData>> batteryUsageData = DataProcessor.getBatteryUsageData( context, new UserIdsSeries(context, /* mainUserOnly= */ false), new UserIdsSeries(context, /* isNonUIRequest= */ false), batteryHistoryMap); if (batteryUsageData == null) { return null; Loading src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoader.java +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public final class BatteryUsageDataLoader { if (!isFullChargeStart) { // No app usage data or battery diff data at this time. final UserIdsSeries userIdsSeries = new UserIdsSeries(context, /* mainUserOnly= */ true); new UserIdsSeries(context, /* isNonUIRequest= */ true); if (!userIdsSeries.isCurrentUserLocked()) { loadAppUsageData(context, userIdsSeries); preprocessBatteryUsageSlots(context, userIdsSeries); Loading src/com/android/settings/fuelgauge/batteryusage/PowerUsageAdvanced.java +1 −1 Original line number Diff line number Diff line Loading @@ -496,7 +496,7 @@ public class PowerUsageAdvanced extends PowerUsageBase { return DataProcessManager.getBatteryLevelData( getContext(), mHandler, new UserIdsSeries(getContext(), /* mainUserOnly= */ false), new UserIdsSeries(getContext(), /* isNonUIRequest= */ false), /* isFromPeriodJob= */ false, PowerUsageAdvanced.this::onBatteryDiffDataMapUpdate); } Loading src/com/android/settings/fuelgauge/batteryusage/UserIdsSeries.java +12 −14 Original line number Diff line number Diff line Loading @@ -33,31 +33,29 @@ class UserIdsSeries { @Nullable private UserInfo mPrivateUser = null; @Nullable private UserInfo mManagedProfileUser = null; UserIdsSeries(final Context context, final boolean mainUserOnly) { UserIdsSeries(final Context context, final boolean isNonUIRequest) { mUserManager = context.getSystemService(UserManager.class); mCurrentUserId = context.getUserId(); List<UserInfo> aliveUsers = mUserManager != null ? mUserManager.getAliveUsers() : new ArrayList<>(); if (mainUserOnly) { aliveUsers.stream() .filter(UserInfo::isMain) .forEach(userInfo -> mVisibleUserIds.add(userInfo.id)); return; } for (UserInfo userInfo : aliveUsers) { if (!mUserManager.isSameProfileGroup(mCurrentUserId, userInfo.id)) { continue; } if (!userInfo.isQuietModeEnabled() || userInfo.isManagedProfile()) { if (userInfo.isManagedProfile()) { // Load data for WorkProfile mode mManagedProfileUser = userInfo; mVisibleUserIds.add(userInfo.id); } if (userInfo.isPrivateProfile()) { } else if (userInfo.isPrivateProfile()) { mPrivateUser = userInfo; // Load data for PrivateProfile if it is from UI caller and PS is unlocked. if (!isNonUIRequest && !userInfo.isQuietModeEnabled()) { mVisibleUserIds.add(userInfo.id); } if (userInfo.isManagedProfile()) { mManagedProfileUser = userInfo; } else if (!userInfo.isQuietModeEnabled()) { // Load data for other profiles if it is not in quiet mode mVisibleUserIds.add(userInfo.id); } } } Loading Loading
src/com/android/settings/fuelgauge/batteryusage/BatteryChartPreferenceController.java +1 −1 Original line number Diff line number Diff line Loading @@ -559,7 +559,7 @@ public class BatteryChartPreferenceController extends AbstractPreferenceControll final Map<Integer, Map<Integer, BatteryDiffData>> batteryUsageData = DataProcessor.getBatteryUsageData( context, new UserIdsSeries(context, /* mainUserOnly= */ false), new UserIdsSeries(context, /* isNonUIRequest= */ false), batteryHistoryMap); if (batteryUsageData == null) { return null; Loading
src/com/android/settings/fuelgauge/batteryusage/BatteryUsageDataLoader.java +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ public final class BatteryUsageDataLoader { if (!isFullChargeStart) { // No app usage data or battery diff data at this time. final UserIdsSeries userIdsSeries = new UserIdsSeries(context, /* mainUserOnly= */ true); new UserIdsSeries(context, /* isNonUIRequest= */ true); if (!userIdsSeries.isCurrentUserLocked()) { loadAppUsageData(context, userIdsSeries); preprocessBatteryUsageSlots(context, userIdsSeries); Loading
src/com/android/settings/fuelgauge/batteryusage/PowerUsageAdvanced.java +1 −1 Original line number Diff line number Diff line Loading @@ -496,7 +496,7 @@ public class PowerUsageAdvanced extends PowerUsageBase { return DataProcessManager.getBatteryLevelData( getContext(), mHandler, new UserIdsSeries(getContext(), /* mainUserOnly= */ false), new UserIdsSeries(getContext(), /* isNonUIRequest= */ false), /* isFromPeriodJob= */ false, PowerUsageAdvanced.this::onBatteryDiffDataMapUpdate); } Loading
src/com/android/settings/fuelgauge/batteryusage/UserIdsSeries.java +12 −14 Original line number Diff line number Diff line Loading @@ -33,31 +33,29 @@ class UserIdsSeries { @Nullable private UserInfo mPrivateUser = null; @Nullable private UserInfo mManagedProfileUser = null; UserIdsSeries(final Context context, final boolean mainUserOnly) { UserIdsSeries(final Context context, final boolean isNonUIRequest) { mUserManager = context.getSystemService(UserManager.class); mCurrentUserId = context.getUserId(); List<UserInfo> aliveUsers = mUserManager != null ? mUserManager.getAliveUsers() : new ArrayList<>(); if (mainUserOnly) { aliveUsers.stream() .filter(UserInfo::isMain) .forEach(userInfo -> mVisibleUserIds.add(userInfo.id)); return; } for (UserInfo userInfo : aliveUsers) { if (!mUserManager.isSameProfileGroup(mCurrentUserId, userInfo.id)) { continue; } if (!userInfo.isQuietModeEnabled() || userInfo.isManagedProfile()) { if (userInfo.isManagedProfile()) { // Load data for WorkProfile mode mManagedProfileUser = userInfo; mVisibleUserIds.add(userInfo.id); } if (userInfo.isPrivateProfile()) { } else if (userInfo.isPrivateProfile()) { mPrivateUser = userInfo; // Load data for PrivateProfile if it is from UI caller and PS is unlocked. if (!isNonUIRequest && !userInfo.isQuietModeEnabled()) { mVisibleUserIds.add(userInfo.id); } if (userInfo.isManagedProfile()) { mManagedProfileUser = userInfo; } else if (!userInfo.isQuietModeEnabled()) { // Load data for other profiles if it is not in quiet mode mVisibleUserIds.add(userInfo.id); } } } Loading