Loading data/keyboards/Generic.kcm +1 −1 Original line number Diff line number Diff line Loading @@ -563,7 +563,7 @@ key BUTTON_START { } key BUTTON_SELECT { base: fallback MENU base: fallback BACK } key BUTTON_MODE { Loading packages/SystemUI/src/com/android/systemui/battery/BatteryMeterView.java +11 −1 Original line number Diff line number Diff line Loading @@ -90,6 +90,7 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { private int mShowPercentMode = MODE_DEFAULT; private String mEstimateText = null; private boolean mPluggedIn; private boolean mPresent; private boolean mPowerSaveEnabled; private boolean mIsBatteryDefender; private boolean mIsIncompatibleCharging; Loading Loading @@ -389,6 +390,10 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { mBatteryEstimateFetcher = fetcher; } void setBatteryPresence(boolean isPresent) { mPresent = isPresent; } void setDisplayShieldEnabled(boolean displayShieldEnabled) { mDisplayShieldEnabled = displayShieldEnabled; } Loading Loading @@ -605,7 +610,7 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { mBatteryStateUnknown = isUnknown; updateContentDescription(); if (mBatteryStateUnknown) { if (mBatteryStateUnknown && mPresent) { mBatteryIconView.setImageDrawable(getUnknownStateDrawable()); } else { updateDrawable(); Loading Loading @@ -693,6 +698,10 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { } private void updateDrawable() { if (!mPresent) { return; } switch (getBatteryStyle()) { case BATTERY_STYLE_PORTRAIT: mBatteryIconView.setImageDrawable(mAccessorizedDrawable); Loading Loading @@ -808,6 +817,7 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { pw.println(" mBatteryStateUnknown: " + mBatteryStateUnknown); pw.println(" mIsIncompatibleCharging: " + mIsIncompatibleCharging); pw.println(" mPluggedIn: " + mPluggedIn); pw.println(" mPresent: " + mPresent); pw.println(" mLevel: " + mLevel); pw.println(" mMode: " + mShowPercentMode); } Loading packages/SystemUI/src/com/android/systemui/battery/BatteryMeterViewController.java +4 −0 Original line number Diff line number Diff line Loading @@ -162,8 +162,12 @@ public class BatteryMeterViewController extends ViewController<BatteryMeterView> mBatteryController = batteryController; mView.setBatteryEstimateFetcher(mBatteryController::getEstimatedTimeRemainingString); mView.setBatteryPresence(mBatteryController.isPresent()); mView.setDisplayShieldEnabled( getContext().getResources().getBoolean(R.bool.flag_battery_shield_icon)); if (!mBatteryController.isPresent()) { mView.setVisibility(View.GONE); } mSlotBattery = getResources().getString(com.android.internal.R.string.status_bar_battery); mSettingObserver = new SettingObserver(mMainHandler); Loading packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +2 −2 Original line number Diff line number Diff line Loading @@ -580,7 +580,7 @@ public class KeyguardIndicationController { } private void updateLockScreenBatteryMsg(boolean animate) { if (mPowerPluggedIn || mEnableBatteryDefender) { if (mBatteryPresent && (mPowerPluggedIn || mEnableBatteryDefender)) { String powerIndication = computePowerIndication(); if (DEBUG_CHARGING_SPEED) { powerIndication += ", " + (mChargingWattage / 1000) + " mW"; Loading @@ -596,7 +596,7 @@ public class KeyguardIndicationController { animate); } else { mKeyguardLogger.log(TAG, LogLevel.DEBUG, "hide battery indication"); // don't show the charging information if device isn't plugged in // don't show the charging information mRotateTextViewController.hideIndication(INDICATION_TYPE_BATTERY); } } Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java +5 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,11 @@ public interface BatteryController extends DemoMode, return false; } /** * Returns {@code true} if there's a battery present in the device. */ boolean isPresent(); /** * Returns {@code true} if the device is currently in power save mode. */ Loading Loading
data/keyboards/Generic.kcm +1 −1 Original line number Diff line number Diff line Loading @@ -563,7 +563,7 @@ key BUTTON_START { } key BUTTON_SELECT { base: fallback MENU base: fallback BACK } key BUTTON_MODE { Loading
packages/SystemUI/src/com/android/systemui/battery/BatteryMeterView.java +11 −1 Original line number Diff line number Diff line Loading @@ -90,6 +90,7 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { private int mShowPercentMode = MODE_DEFAULT; private String mEstimateText = null; private boolean mPluggedIn; private boolean mPresent; private boolean mPowerSaveEnabled; private boolean mIsBatteryDefender; private boolean mIsIncompatibleCharging; Loading Loading @@ -389,6 +390,10 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { mBatteryEstimateFetcher = fetcher; } void setBatteryPresence(boolean isPresent) { mPresent = isPresent; } void setDisplayShieldEnabled(boolean displayShieldEnabled) { mDisplayShieldEnabled = displayShieldEnabled; } Loading Loading @@ -605,7 +610,7 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { mBatteryStateUnknown = isUnknown; updateContentDescription(); if (mBatteryStateUnknown) { if (mBatteryStateUnknown && mPresent) { mBatteryIconView.setImageDrawable(getUnknownStateDrawable()); } else { updateDrawable(); Loading Loading @@ -693,6 +698,10 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { } private void updateDrawable() { if (!mPresent) { return; } switch (getBatteryStyle()) { case BATTERY_STYLE_PORTRAIT: mBatteryIconView.setImageDrawable(mAccessorizedDrawable); Loading Loading @@ -808,6 +817,7 @@ public class BatteryMeterView extends LinearLayout implements DarkReceiver { pw.println(" mBatteryStateUnknown: " + mBatteryStateUnknown); pw.println(" mIsIncompatibleCharging: " + mIsIncompatibleCharging); pw.println(" mPluggedIn: " + mPluggedIn); pw.println(" mPresent: " + mPresent); pw.println(" mLevel: " + mLevel); pw.println(" mMode: " + mShowPercentMode); } Loading
packages/SystemUI/src/com/android/systemui/battery/BatteryMeterViewController.java +4 −0 Original line number Diff line number Diff line Loading @@ -162,8 +162,12 @@ public class BatteryMeterViewController extends ViewController<BatteryMeterView> mBatteryController = batteryController; mView.setBatteryEstimateFetcher(mBatteryController::getEstimatedTimeRemainingString); mView.setBatteryPresence(mBatteryController.isPresent()); mView.setDisplayShieldEnabled( getContext().getResources().getBoolean(R.bool.flag_battery_shield_icon)); if (!mBatteryController.isPresent()) { mView.setVisibility(View.GONE); } mSlotBattery = getResources().getString(com.android.internal.R.string.status_bar_battery); mSettingObserver = new SettingObserver(mMainHandler); Loading
packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java +2 −2 Original line number Diff line number Diff line Loading @@ -580,7 +580,7 @@ public class KeyguardIndicationController { } private void updateLockScreenBatteryMsg(boolean animate) { if (mPowerPluggedIn || mEnableBatteryDefender) { if (mBatteryPresent && (mPowerPluggedIn || mEnableBatteryDefender)) { String powerIndication = computePowerIndication(); if (DEBUG_CHARGING_SPEED) { powerIndication += ", " + (mChargingWattage / 1000) + " mW"; Loading @@ -596,7 +596,7 @@ public class KeyguardIndicationController { animate); } else { mKeyguardLogger.log(TAG, LogLevel.DEBUG, "hide battery indication"); // don't show the charging information if device isn't plugged in // don't show the charging information mRotateTextViewController.hideIndication(INDICATION_TYPE_BATTERY); } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/BatteryController.java +5 −0 Original line number Diff line number Diff line Loading @@ -81,6 +81,11 @@ public interface BatteryController extends DemoMode, return false; } /** * Returns {@code true} if there's a battery present in the device. */ boolean isPresent(); /** * Returns {@code true} if the device is currently in power save mode. */ Loading