Loading core/java/android/provider/Settings.java +14 −9 Original line number Diff line number Diff line Loading @@ -2629,6 +2629,15 @@ public final class Settings { */ public static final String LOCKSCREEN_TARGETS = "lockscreen_targets"; /** * Lockscreen battery status visibility mode * 0 = show if charging * 1 = always show * 2 = never show * @hide */ public static final String LOCKSCREEN_BATTERY_VISIBILITY = "lockscreen_always_show_battery"; /** * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} * instead Loading Loading @@ -3306,14 +3315,8 @@ public final class Settings { public static final String VOLUME_KEYS_CONTROL_RING_STREAM = "volume_keys_control_ring_stream"; /** * Whether to enable custom rebindings of the actions performed on * certain key press events. * @hide */ public static final String HARDWARE_KEY_REBINDING = "hardware_key_rebinding"; /** * Action to perform when the home key is long-pressed. (Default is 2) * Action to perform when the home key is long-pressed. * (Default can be configured via config_longPressOnHomeBehavior) * 0 - Nothing * 1 - Menu * 2 - App-switch Loading @@ -3326,7 +3329,8 @@ public final class Settings { public static final String KEY_HOME_LONG_PRESS_ACTION = "key_home_long_press_action"; /** * Action to perform when the home key is double-tapped. (Default is 0) * Action to perform when the home key is double-tapped. * (Default can be configured via config_doubleTapOnHomeBehavior) * (See KEY_HOME_LONG_PRESS_ACTION for valid values) * @hide */ Loading Loading @@ -3503,6 +3507,7 @@ public final class Settings { POWER_MENU_SOUND_ENABLED, POWER_MENU_USER_ENABLED, LOCKSCREEN_VIBRATE_ENABLED, LOCKSCREEN_BATTERY_VISIBILITY, PHONE_BLACKLIST_ENABLED, PHONE_BLACKLIST_NOTIFY_ENABLED, PHONE_BLACKLIST_PRIVATE_NUMBER_MODE, Loading core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1947,4 +1947,7 @@ <java-symbol type="string" name="symbol_picker_z" /> <java-symbol type="string" name="symbol_picker_Z" /> <!-- Lock screen always show battery --> <java-symbol type="string" name="lockscreen_discharging" /> </resources> packages/Keyguard/res/values/cm_strings.xml 0 → 100644 +19 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 The CyanogenMod Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="keyguard_discharging">Discharging, <xliff:g id="number">%d</xliff:g><xliff:g id="percent">%%</xliff:g></string> </resources> packages/Keyguard/res/values/strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -61,8 +61,8 @@ <string name="keyguard_plugged_in">Charging, <xliff:g id="number">%d</xliff:g><xliff:g id="percent">%%</xliff:g></string> <!-- When the lock screen is showing and the battery is low, warn user to plug in the phone soon. --> <string name="keyguard_low_battery">Connect your charger.</string> in the phone soon and show current percentage. --> <string name="keyguard_low_battery">Connect your charger, <xliff:g id="number">%d</xliff:g><xliff:g id="percent">%%</xliff:g></string> <!-- On the keyguard screen, when pattern lock is disabled, only tell them to press menu to unlock. This is shown in small font at the bottom. --> <string name="keyguard_instructions_when_pattern_disabled">Press Menu to unlock.</string> Loading packages/Keyguard/src/com/android/keyguard/KeyguardMessageArea.java +16 −2 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ class KeyguardMessageArea extends TextView { static final int CHARGING_ICON = 0; //R.drawable.ic_lock_idle_charging; static final int BATTERY_LOW_ICON = 0; //R.drawable.ic_lock_idle_low_battery; static final int DISCHARGING_ICON = 0; // no icon used in ics+ currently static final int SECURITY_MESSAGE_DURATION = 5000; protected static final int FADE_DURATION = 750; Loading @@ -66,6 +67,9 @@ class KeyguardMessageArea extends TextView { // are we showing battery information? boolean mShowingBatteryInfo = false; // always show battery status? boolean mAlwaysShowBattery = false; // is the bouncer up? boolean mShowingBouncer = false; Loading Loading @@ -155,12 +159,18 @@ class KeyguardMessageArea extends TextView { private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() { @Override public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) { mShowingBatteryInfo = status.isPluggedIn() || status.isBatteryLow(); mCharging = status.status == BatteryManager.BATTERY_STATUS_CHARGING || status.status == BatteryManager.BATTERY_STATUS_FULL; mBatteryLevel = status.level; mBatteryCharged = status.isCharged(); mBatteryIsLow = status.isBatteryLow(); mAlwaysShowBattery = KeyguardUpdateMonitor.shouldAlwaysShowBatteryInfo(getContext()); if (KeyguardUpdateMonitor.shouldNeverShowBatteryInfo(getContext())) { mShowingBatteryInfo = false; } else { mShowingBatteryInfo = status.isPluggedIn() || status.isBatteryLow() || mAlwaysShowBattery; } update(); } public void onScreenTurnedOff(int why) { Loading Loading @@ -267,8 +277,12 @@ class KeyguardMessageArea extends TextView { icon.value = CHARGING_ICON; } else if (mBatteryIsLow) { // Battery is low string = getContext().getString(R.string.keyguard_low_battery); string = getContext().getString(R.string.keyguard_low_battery, mBatteryLevel); icon.value = BATTERY_LOW_ICON; } else if (mAlwaysShowBattery) { // Discharging string = getContext().getString(R.string.keyguard_discharging, mBatteryLevel); icon.value = DISCHARGING_ICON; } } return string; Loading Loading
core/java/android/provider/Settings.java +14 −9 Original line number Diff line number Diff line Loading @@ -2629,6 +2629,15 @@ public final class Settings { */ public static final String LOCKSCREEN_TARGETS = "lockscreen_targets"; /** * Lockscreen battery status visibility mode * 0 = show if charging * 1 = always show * 2 = never show * @hide */ public static final String LOCKSCREEN_BATTERY_VISIBILITY = "lockscreen_always_show_battery"; /** * @deprecated Use {@link android.provider.Settings.Global#LOW_BATTERY_SOUND} * instead Loading Loading @@ -3306,14 +3315,8 @@ public final class Settings { public static final String VOLUME_KEYS_CONTROL_RING_STREAM = "volume_keys_control_ring_stream"; /** * Whether to enable custom rebindings of the actions performed on * certain key press events. * @hide */ public static final String HARDWARE_KEY_REBINDING = "hardware_key_rebinding"; /** * Action to perform when the home key is long-pressed. (Default is 2) * Action to perform when the home key is long-pressed. * (Default can be configured via config_longPressOnHomeBehavior) * 0 - Nothing * 1 - Menu * 2 - App-switch Loading @@ -3326,7 +3329,8 @@ public final class Settings { public static final String KEY_HOME_LONG_PRESS_ACTION = "key_home_long_press_action"; /** * Action to perform when the home key is double-tapped. (Default is 0) * Action to perform when the home key is double-tapped. * (Default can be configured via config_doubleTapOnHomeBehavior) * (See KEY_HOME_LONG_PRESS_ACTION for valid values) * @hide */ Loading Loading @@ -3503,6 +3507,7 @@ public final class Settings { POWER_MENU_SOUND_ENABLED, POWER_MENU_USER_ENABLED, LOCKSCREEN_VIBRATE_ENABLED, LOCKSCREEN_BATTERY_VISIBILITY, PHONE_BLACKLIST_ENABLED, PHONE_BLACKLIST_NOTIFY_ENABLED, PHONE_BLACKLIST_PRIVATE_NUMBER_MODE, Loading
core/res/res/values/symbols.xml +3 −0 Original line number Diff line number Diff line Loading @@ -1947,4 +1947,7 @@ <java-symbol type="string" name="symbol_picker_z" /> <java-symbol type="string" name="symbol_picker_Z" /> <!-- Lock screen always show battery --> <java-symbol type="string" name="lockscreen_discharging" /> </resources>
packages/Keyguard/res/values/cm_strings.xml 0 → 100644 +19 −0 Original line number Diff line number Diff line <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (C) 2014 The CyanogenMod Project Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. --> <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2"> <string name="keyguard_discharging">Discharging, <xliff:g id="number">%d</xliff:g><xliff:g id="percent">%%</xliff:g></string> </resources>
packages/Keyguard/res/values/strings.xml +2 −2 Original line number Diff line number Diff line Loading @@ -61,8 +61,8 @@ <string name="keyguard_plugged_in">Charging, <xliff:g id="number">%d</xliff:g><xliff:g id="percent">%%</xliff:g></string> <!-- When the lock screen is showing and the battery is low, warn user to plug in the phone soon. --> <string name="keyguard_low_battery">Connect your charger.</string> in the phone soon and show current percentage. --> <string name="keyguard_low_battery">Connect your charger, <xliff:g id="number">%d</xliff:g><xliff:g id="percent">%%</xliff:g></string> <!-- On the keyguard screen, when pattern lock is disabled, only tell them to press menu to unlock. This is shown in small font at the bottom. --> <string name="keyguard_instructions_when_pattern_disabled">Press Menu to unlock.</string> Loading
packages/Keyguard/src/com/android/keyguard/KeyguardMessageArea.java +16 −2 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ class KeyguardMessageArea extends TextView { static final int CHARGING_ICON = 0; //R.drawable.ic_lock_idle_charging; static final int BATTERY_LOW_ICON = 0; //R.drawable.ic_lock_idle_low_battery; static final int DISCHARGING_ICON = 0; // no icon used in ics+ currently static final int SECURITY_MESSAGE_DURATION = 5000; protected static final int FADE_DURATION = 750; Loading @@ -66,6 +67,9 @@ class KeyguardMessageArea extends TextView { // are we showing battery information? boolean mShowingBatteryInfo = false; // always show battery status? boolean mAlwaysShowBattery = false; // is the bouncer up? boolean mShowingBouncer = false; Loading Loading @@ -155,12 +159,18 @@ class KeyguardMessageArea extends TextView { private KeyguardUpdateMonitorCallback mInfoCallback = new KeyguardUpdateMonitorCallback() { @Override public void onRefreshBatteryInfo(KeyguardUpdateMonitor.BatteryStatus status) { mShowingBatteryInfo = status.isPluggedIn() || status.isBatteryLow(); mCharging = status.status == BatteryManager.BATTERY_STATUS_CHARGING || status.status == BatteryManager.BATTERY_STATUS_FULL; mBatteryLevel = status.level; mBatteryCharged = status.isCharged(); mBatteryIsLow = status.isBatteryLow(); mAlwaysShowBattery = KeyguardUpdateMonitor.shouldAlwaysShowBatteryInfo(getContext()); if (KeyguardUpdateMonitor.shouldNeverShowBatteryInfo(getContext())) { mShowingBatteryInfo = false; } else { mShowingBatteryInfo = status.isPluggedIn() || status.isBatteryLow() || mAlwaysShowBattery; } update(); } public void onScreenTurnedOff(int why) { Loading Loading @@ -267,8 +277,12 @@ class KeyguardMessageArea extends TextView { icon.value = CHARGING_ICON; } else if (mBatteryIsLow) { // Battery is low string = getContext().getString(R.string.keyguard_low_battery); string = getContext().getString(R.string.keyguard_low_battery, mBatteryLevel); icon.value = BATTERY_LOW_ICON; } else if (mAlwaysShowBattery) { // Discharging string = getContext().getString(R.string.keyguard_discharging, mBatteryLevel); icon.value = DISCHARGING_ICON; } } return string; Loading