Fix b/279120121: Unplug 100% Pixel phone won't reset the battery usage data when the phone is just started.
Bug: 279120121 Fix: 279120121 Test: manual Change-Id: Ie793266f8453a2902d7e16e5c58443a3c7bf55ef
This commit is contained in:
@@ -106,9 +106,13 @@ public final class BatteryUsageBroadcastReceiver extends BroadcastReceiver {
|
||||
return;
|
||||
}
|
||||
|
||||
final boolean delayHourlyJobWhenBooting =
|
||||
FeatureFactory.getFactory(context)
|
||||
.getPowerUsageFeatureProvider(context)
|
||||
.delayHourlyJobWhenBooting();
|
||||
final long broadcastDelay = sBroadcastDelayFromBoot - SystemClock.elapsedRealtime();
|
||||
// If current boot time is smaller than expected delay, cancel sending the broadcast.
|
||||
if (broadcastDelay > 0) {
|
||||
if (delayHourlyJobWhenBooting && broadcastDelay > 0) {
|
||||
Log.d(TAG, "cancel sendBroadcastToFetchUsageData when broadcastDelay is "
|
||||
+ broadcastDelay + "ms.");
|
||||
return;
|
||||
|
Reference in New Issue
Block a user