Merge "Fix the NPE in the tryToFetchUsageData() method" into main am: 250101cd8f
Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/3424441 Change-Id: I7376d3e498ebca9eeaa90244d8b2da6b6ad7d658 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -106,6 +106,10 @@ public final class BatteryUsageBroadcastReceiver extends BroadcastReceiver {
|
|||||||
|
|
||||||
private void tryToFetchUsageData(Context context) {
|
private void tryToFetchUsageData(Context context) {
|
||||||
final Intent batteryIntent = BatteryUtils.getBatteryIntent(context);
|
final Intent batteryIntent = BatteryUtils.getBatteryIntent(context);
|
||||||
|
if (batteryIntent == null) {
|
||||||
|
Log.w(TAG, "tryToFetchUsageData: ignore from null battery intent");
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Returns when battery is not fully charged.
|
// Returns when battery is not fully charged.
|
||||||
if (!BatteryStatus.isCharged(batteryIntent)) {
|
if (!BatteryStatus.isCharged(batteryIntent)) {
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user