Merge "Fix mistake in conditional + test" into oc-dr1-dev

This commit is contained in:
TreeHugger Robot
2017-07-12 20:41:27 +00:00
committed by Android (Google) Code Review
2 changed files with 91 additions and 2 deletions

View File

@@ -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);