summaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorJorim Jaggi <jjaggi@google.com>2014-05-27 20:30:26 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-27 20:30:28 +0000
commit2d6f780cc534920c8e12baf1f60e9cfb4bee5223 (patch)
tree552ab043e38049899b9e3a3b9fa7a90368e829e7 /packages
parent6020071df901be17bedb0b59ab634555a1d95ecb (diff)
parent40a0b38160b1b80a48aa6a0d87b3fab888fd55f0 (diff)
downloadframeworks_base-2d6f780cc534920c8e12baf1f60e9cfb4bee5223.zip
frameworks_base-2d6f780cc534920c8e12baf1f60e9cfb4bee5223.tar.gz
frameworks_base-2d6f780cc534920c8e12baf1f60e9cfb4bee5223.tar.bz2
Merge "Remove charging text and carrier label on bouncer." into lmp-preview-dev
Diffstat (limited to 'packages')
-rw-r--r--packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml1
-rw-r--r--packages/Keyguard/src/com/android/keyguard/EmergencyCarrierArea.java8
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardMessageArea.java47
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java3
-rw-r--r--packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java3
5 files changed, 14 insertions, 48 deletions
diff --git a/packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml b/packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml
index b2d0219..78b5746 100644
--- a/packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml
+++ b/packages/Keyguard/res/layout/keyguard_emergency_carrier_area.xml
@@ -37,6 +37,7 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="@dimen/kg_status_line_font_size"
android:textColor="?android:attr/textColorSecondary"
+ android:visibility="gone"
androidprv:allCaps="@bool/kg_use_all_caps" />
<LinearLayout
diff --git a/packages/Keyguard/src/com/android/keyguard/EmergencyCarrierArea.java b/packages/Keyguard/src/com/android/keyguard/EmergencyCarrierArea.java
index 6d392fc..a592db9 100644
--- a/packages/Keyguard/src/com/android/keyguard/EmergencyCarrierArea.java
+++ b/packages/Keyguard/src/com/android/keyguard/EmergencyCarrierArea.java
@@ -17,13 +17,12 @@
package com.android.keyguard;
import android.content.Context;
+import android.content.res.TypedArray;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import android.widget.LinearLayout;
-import com.android.keyguard.R;
-
public class EmergencyCarrierArea extends LinearLayout {
private CarrierText mCarrierText;
@@ -48,6 +47,7 @@ public class EmergencyCarrierArea extends LinearLayout {
mEmergencyButton.setOnTouchListener(new OnTouchListener(){
@Override
public boolean onTouch(View v, MotionEvent event) {
+ if (mCarrierText.getVisibility() != View.VISIBLE) return false;
switch(event.getAction()) {
case MotionEvent.ACTION_DOWN:
mCarrierText.animate().alpha(0);
@@ -59,4 +59,8 @@ public class EmergencyCarrierArea extends LinearLayout {
return false;
}});
}
+
+ public void setCarrierTextVisible(boolean visible) {
+ mCarrierText.setVisibility(visible ? View.VISIBLE : View.GONE);
+ }
}
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardMessageArea.java b/packages/Keyguard/src/com/android/keyguard/KeyguardMessageArea.java
index ede23ef..d589283 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardMessageArea.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardMessageArea.java
@@ -48,35 +48,19 @@ class KeyguardMessageArea extends TextView {
*/
private static final long ANNOUNCEMENT_DELAY = 250;
- 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 SECURITY_MESSAGE_DURATION = 5000;
protected static final int FADE_DURATION = 750;
private static final String TAG = "KeyguardMessageArea";
- // are we showing battery information?
- boolean mShowingBatteryInfo = false;
-
// is the bouncer up?
boolean mShowingBouncer = false;
- // last known plugged in state
- boolean mCharging = false;
-
- // last known battery level
- int mBatteryLevel = 100;
-
KeyguardUpdateMonitor mUpdateMonitor;
// Timeout before we reset the message to show charging/owner info
long mTimeout = SECURITY_MESSAGE_DURATION;
- // Shadowed text values
- protected boolean mBatteryCharged;
- protected boolean mBatteryIsLow;
-
private Handler mHandler;
CharSequence mMessage;
@@ -146,16 +130,6 @@ 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();
- update();
- }
public void onScreenTurnedOff(int why) {
setSelected(false);
};
@@ -212,7 +186,7 @@ class KeyguardMessageArea extends TextView {
*/
void update() {
MutableInt icon = new MutableInt(0);
- CharSequence status = concat(getChargeInfo(icon), getOwnerInfo(), getCurrentMessage());
+ CharSequence status = concat(getOwnerInfo(), getCurrentMessage());
setCompoundDrawablesWithIntrinsicBounds(icon.value, 0, 0, 0);
setText(status);
}
@@ -248,25 +222,6 @@ class KeyguardMessageArea extends TextView {
return info;
}
- private CharSequence getChargeInfo(MutableInt icon) {
- CharSequence string = null;
- if (mShowingBatteryInfo && !mShowingMessage) {
- // Battery status
- if (mCharging) {
- // Charging, charged or waiting to charge.
- string = getContext().getString(mBatteryCharged
- ? R.string.keyguard_charged
- : R.string.keyguard_plugged_in, mBatteryLevel);
- icon.value = CHARGING_ICON;
- } else if (mBatteryIsLow) {
- // Battery is low
- string = getContext().getString(R.string.keyguard_low_battery);
- icon.value = BATTERY_LOW_ICON;
- }
- }
- return string;
- }
-
private void hideMessage(int duration, boolean thenUpdate) {
if (duration > 0) {
Animator anim = ObjectAnimator.ofFloat(this, "alpha", 0f);
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
index 8222009..09c4e7c 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPinView.java
@@ -135,6 +135,9 @@ public class KeyguardSimPinView extends KeyguardAbsKeyInputView
mPasswordEntry.requestFocus();
mSecurityMessageDisplay.setTimeout(0); // don't show ownerinfo/charging status by default
+ if (mEcaView instanceof EmergencyCarrierArea) {
+ ((EmergencyCarrierArea) mEcaView).setCarrierTextVisible(true);
+ }
}
@Override
diff --git a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java
index 79c7dff..6215d34 100644
--- a/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java
+++ b/packages/Keyguard/src/com/android/keyguard/KeyguardSimPukView.java
@@ -186,6 +186,9 @@ public class KeyguardSimPukView extends KeyguardAbsKeyInputView
mPasswordEntry.requestFocus();
mSecurityMessageDisplay.setTimeout(0); // don't show ownerinfo/charging status by default
+ if (mEcaView instanceof EmergencyCarrierArea) {
+ ((EmergencyCarrierArea) mEcaView).setCarrierTextVisible(true);
+ }
}
@Override