From 7cf9d0108eee2ce58e08fb5cb2664309fb9f9385 Mon Sep 17 00:00:00 2001 From: ykhung Date: Thu, 9 Feb 2023 11:13:27 +0800 Subject: [PATCH] Replace getBatteryIntent() to centralized method Replace the current getBatteryIntent() in the Settings into the centralized method in the SettingsLib Bug: N/A Test: presubmit Change-Id: If27d01c4ff52259e0185ca5d16ac88ca1bebac82 --- src/com/android/settings/fuelgauge/BatteryUtils.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/com/android/settings/fuelgauge/BatteryUtils.java b/src/com/android/settings/fuelgauge/BatteryUtils.java index b08f4e3e441..ef43bb70635 100644 --- a/src/com/android/settings/fuelgauge/BatteryUtils.java +++ b/src/com/android/settings/fuelgauge/BatteryUtils.java @@ -618,8 +618,7 @@ public class BatteryUtils { /** Gets the latest sticky battery intent from the Android system. */ public static Intent getBatteryIntent(Context context) { - return context.registerReceiver( - /*receiver=*/ null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); + return com.android.settingslib.fuelgauge.BatteryUtils.getBatteryIntent(context); } /** Gets the current dock defender mode */