Make App info page support new battery entry
- Add new battery entry to app info battery preference, support both legacy and new args, controlled by P/H - Add a method to check is work profile app or not, use owner context to query correct context for feature provider - Add string for new args Bug: 178197718 Test: make RunSettingsRoboTests Change-Id: Ic93142a0c5e2851917cb3e224340a6e3e81fd801
This commit is contained in:
@@ -157,7 +157,8 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements
|
||||
|
||||
/** Launches battery details page for an individual battery consumer. */
|
||||
public static void startBatteryDetailPage(Activity caller,
|
||||
InstrumentedPreferenceFragment fragment, BatteryEntry entry, String usagePercent) {
|
||||
InstrumentedPreferenceFragment fragment, BatteryEntry entry, String usagePercent,
|
||||
boolean isValidToShowSummary) {
|
||||
final LaunchBatteryDetailPageArgs launchArgs = new LaunchBatteryDetailPageArgs();
|
||||
// configure the launch argument.
|
||||
launchArgs.mUsagePercent = usagePercent;
|
||||
@@ -166,8 +167,8 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements
|
||||
launchArgs.mUid = entry.getUid();
|
||||
launchArgs.mIconId = entry.iconId;
|
||||
launchArgs.mConsumedPower = (int) entry.getConsumedPower();
|
||||
launchArgs.mForegroundTimeMs = entry.getTimeInForegroundMs();
|
||||
launchArgs.mBackgroundTimeMs = entry.getTimeInBackgroundMs();
|
||||
launchArgs.mForegroundTimeMs = isValidToShowSummary ? entry.getTimeInForegroundMs() : 0;
|
||||
launchArgs.mBackgroundTimeMs = isValidToShowSummary ? entry.getTimeInBackgroundMs() : 0;
|
||||
launchArgs.mIsUserEntry = entry.isUserEntry();
|
||||
startBatteryDetailPage(caller, fragment, launchArgs);
|
||||
}
|
||||
|
Reference in New Issue
Block a user