Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ public interface BatteryController extends DemoMode, Dumpable, */ boolean isAodPowerSave(); /** * Returns {@code true} if the device is currently in wireless charging mode. */ default boolean isWirelessCharging() { return false; } /** * Returns {@code true} if reverse is supported. */ Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryControllerImpl.java +8 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC private boolean mCharged; protected boolean mPowerSave; private boolean mAodPowerSave; protected boolean mWirelessCharging; private boolean mTestmode = false; private boolean mHasReceivedBattery = false; private Estimate mEstimate; Loading Loading @@ -150,6 +151,8 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC BatteryManager.BATTERY_STATUS_UNKNOWN); mCharged = status == BatteryManager.BATTERY_STATUS_FULL; mCharging = mCharged || status == BatteryManager.BATTERY_STATUS_CHARGING; mWirelessCharging = mCharging && intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) == BatteryManager.BATTERY_PLUGGED_WIRELESS; fireBatteryLevelChanged(); } else if (action.equals(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED)) { Loading Loading @@ -204,6 +207,11 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC return mAodPowerSave; } @Override public boolean isWirelessCharging() { return mWirelessCharging; } @Override public void getEstimatedTimeRemainingString(EstimateFetchCompletion completion) { // Need to fetch or refresh the estimate, but it may involve binder calls so offload the Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java +5 −0 Original line number Diff line number Diff line Loading @@ -52,6 +52,11 @@ public interface BatteryController extends DemoMode, Dumpable, */ boolean isAodPowerSave(); /** * Returns {@code true} if the device is currently in wireless charging mode. */ default boolean isWirelessCharging() { return false; } /** * Returns {@code true} if reverse is supported. */ Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryControllerImpl.java +8 −0 Original line number Diff line number Diff line Loading @@ -73,6 +73,7 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC private boolean mCharged; protected boolean mPowerSave; private boolean mAodPowerSave; protected boolean mWirelessCharging; private boolean mTestmode = false; private boolean mHasReceivedBattery = false; private Estimate mEstimate; Loading Loading @@ -150,6 +151,8 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC BatteryManager.BATTERY_STATUS_UNKNOWN); mCharged = status == BatteryManager.BATTERY_STATUS_FULL; mCharging = mCharged || status == BatteryManager.BATTERY_STATUS_CHARGING; mWirelessCharging = mCharging && intent.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0) == BatteryManager.BATTERY_PLUGGED_WIRELESS; fireBatteryLevelChanged(); } else if (action.equals(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED)) { Loading Loading @@ -204,6 +207,11 @@ public class BatteryControllerImpl extends BroadcastReceiver implements BatteryC return mAodPowerSave; } @Override public boolean isWirelessCharging() { return mWirelessCharging; } @Override public void getEstimatedTimeRemainingString(EstimateFetchCompletion completion) { // Need to fetch or refresh the estimate, but it may involve binder calls so offload the Loading