diff options
author | Joe Onorato <joeo@google.com> | 2011-01-26 22:21:26 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-26 22:21:26 -0800 |
commit | e193c4688f9062e1d4dba97413788b6ffa122a55 (patch) | |
tree | b259458815979620843b92d06c565a1c1198073e /policy | |
parent | ea1fbe9c8c9fe32690252dcc4dc96c93ae03f686 (diff) | |
parent | b92e18e2dfa4f5b791a53b9c963cf2b9e1f1f25c (diff) | |
download | frameworks_base-e193c4688f9062e1d4dba97413788b6ffa122a55.zip frameworks_base-e193c4688f9062e1d4dba97413788b6ffa122a55.tar.gz frameworks_base-e193c4688f9062e1d4dba97413788b6ffa122a55.tar.bz2 |
Merge "Fix 3388705: Explicitly check for low battery level" into honeycomb
Diffstat (limited to 'policy')
-rw-r--r-- | policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java | 2 | ||||
-rw-r--r-- | policy/src/com/android/internal/policy/impl/StatusView.java | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java b/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java index b225e56..e775dac 100644 --- a/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java +++ b/policy/src/com/android/internal/policy/impl/KeyguardUpdateMonitor.java @@ -62,7 +62,7 @@ public class KeyguardUpdateMonitor { static private final String TAG = "KeyguardUpdateMonitor"; static private final boolean DEBUG = false; - private static final int LOW_BATTERY_THRESHOLD = 20; + /* package */ static final int LOW_BATTERY_THRESHOLD = 20; private final Context mContext; diff --git a/policy/src/com/android/internal/policy/impl/StatusView.java b/policy/src/com/android/internal/policy/impl/StatusView.java index 4b91b65..1732adb 100644 --- a/policy/src/com/android/internal/policy/impl/StatusView.java +++ b/policy/src/com/android/internal/policy/impl/StatusView.java @@ -193,12 +193,15 @@ class StatusView { mBatteryLevel)); } mStatus1.setCompoundDrawablesWithIntrinsicBounds(CHARGING_ICON, 0, 0, 0); - } else { + mStatus1.setVisibility(View.VISIBLE); + } else if (mBatteryLevel < KeyguardUpdateMonitor.LOW_BATTERY_THRESHOLD) { // Battery is low mStatus1.setText(getContext().getString(R.string.lockscreen_low_battery)); mStatus1.setCompoundDrawablesWithIntrinsicBounds(BATTERY_LOW_ICON, 0, 0, 0); + mStatus1.setVisibility(View.VISIBLE); + } else { + mStatus1.setVisibility(View.INVISIBLE); } - mStatus1.setVisibility(View.VISIBLE); } else { // nothing specific to show; show help message and icon, if provided if (mHelpMessageId != 0) { |