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
This commit is contained in:
ykhung
2023-02-09 11:13:27 +08:00
parent d6da5c2f24
commit 7cf9d0108e

View File

@@ -618,8 +618,7 @@ public class BatteryUtils {
/** Gets the latest sticky battery intent from the Android system. */ /** Gets the latest sticky battery intent from the Android system. */
public static Intent getBatteryIntent(Context context) { public static Intent getBatteryIntent(Context context) {
return context.registerReceiver( return com.android.settingslib.fuelgauge.BatteryUtils.getBatteryIntent(context);
/*receiver=*/ null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
} }
/** Gets the current dock defender mode */ /** Gets the current dock defender mode */