Fix mistake in conditional + test
This CL fixes a mixup that was in a conditional that determined what was shown on the battery settings page. Additionally, it adds a simple test to help ensure that this does not regress in the future. Test: Robotest Bug: 63158794 Change-Id: I8af4843ef6d798b5114c97b2f1b99dd29fa5f412
This commit is contained in:
@@ -55,7 +55,7 @@ public class BatteryInfoLoader extends AsyncLoader<BatteryInfo>{
|
||||
FeatureFactory.getFactory(context).getPowerUsageFeatureProvider(context);
|
||||
|
||||
// Stuff we always need to get BatteryInfo
|
||||
Intent batteryBroadcast = getContext().registerReceiver(null,
|
||||
Intent batteryBroadcast = context.registerReceiver(null,
|
||||
new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
|
||||
final long elapsedRealtimeUs = BatteryUtils.convertMsToUs(SystemClock.elapsedRealtime());
|
||||
BatteryInfo batteryInfo;
|
||||
@@ -79,7 +79,7 @@ public class BatteryInfoLoader extends AsyncLoader<BatteryInfo>{
|
||||
} else {
|
||||
batteryInfo = BatteryInfo.getBatteryInfo(context, batteryBroadcast, stats,
|
||||
elapsedRealtimeUs, false /* shortString */,
|
||||
discharging ? 0 : stats.computeBatteryTimeRemaining(elapsedRealtimeUs),
|
||||
discharging ? stats.computeBatteryTimeRemaining(elapsedRealtimeUs) : 0,
|
||||
false /* basedOnUsage */);
|
||||
}
|
||||
BatteryUtils.logRuntime(LOG_TAG, "BatteryInfoLoader.loadInBackground", startTime);
|
||||
|
Reference in New Issue
Block a user