summaryrefslogtreecommitdiffstats
path: root/policy
diff options
context:
space:
mode:
authorDaniel Sandler <dsandler@android.com>2010-04-13 14:41:27 -0400
committerDaniel Sandler <dsandler@android.com>2010-04-13 14:47:25 -0400
commite82ca2dec0469714650b9e3d23a554d4ba9dab9f (patch)
tree1edafec6e70a939b0c18e7851dc1802d94b4db59 /policy
parent8dc634e82f065e5090b99660739ba26217765789 (diff)
downloadframeworks_base-e82ca2dec0469714650b9e3d23a554d4ba9dab9f.zip
frameworks_base-e82ca2dec0469714650b9e3d23a554d4ba9dab9f.tar.gz
frameworks_base-e82ca2dec0469714650b9e3d23a554d4ba9dab9f.tar.bz2
Manually integrating froyo lockscreen fixes:
I6872c3ad135bc34348adafa76e08a3878f1b506f "Add emergency call button to PUK'd lockscreen." Bug: 2568732 I5ad8745443fc97225af9efb938e4640cfc29b5d7 "Restore text field used by sliding tab to give ringer mode feedback." Bug: 2587358 Change-Id: Ide3ad839aaf029930c0bf7ba4b9f6587efbd811d
Diffstat (limited to 'policy')
-rw-r--r--policy/com/android/internal/policy/impl/LockScreen.java63
1 files changed, 33 insertions, 30 deletions
diff --git a/policy/com/android/internal/policy/impl/LockScreen.java b/policy/com/android/internal/policy/impl/LockScreen.java
index baed9eb..a5ef1fa 100644
--- a/policy/com/android/internal/policy/impl/LockScreen.java
+++ b/policy/com/android/internal/policy/impl/LockScreen.java
@@ -66,6 +66,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
private TextView mStatus1;
private TextView mStatus2;
private TextView mScreenLocked;
+ private TextView mEmergencyCallText;
private Button mEmergencyCallButton;
// current configuration state of keyboard and display
@@ -185,7 +186,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
Log.v(TAG, "Cur orient=" + mCreationOrientation
+ " res orient=" + context.getResources().getConfiguration().orientation);
}
-
+
final LayoutInflater inflater = LayoutInflater.from(context);
if (DBG) Log.v(TAG, "Creation orientation = " + mCreationOrientation);
if (mCreationOrientation != Configuration.ORIENTATION_LANDSCAPE) {
@@ -203,19 +204,23 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
mStatus1 = (TextView) findViewById(R.id.status1);
mStatus2 = (TextView) findViewById(R.id.status2);
- mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton);
- mEmergencyCallButton.setText(R.string.lockscreen_emergency_call);
- mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton);
mScreenLocked = (TextView) findViewById(R.id.screenLocked);
mSelector = (SlidingTab) findViewById(R.id.tab_selector);
mSelector.setHoldAfterTrigger(true, false);
mSelector.setLeftHintText(R.string.lockscreen_unlock_label);
+
+ mEmergencyCallText = (TextView) findViewById(R.id.emergencyCallText);
+ mEmergencyCallButton = (Button) findViewById(R.id.emergencyCallButton);
+ mEmergencyCallButton.setText(R.string.lockscreen_emergency_call);
+
+ mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton);
mEmergencyCallButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
mCallback.takeEmergencyCallAction();
}
});
+
setFocusable(true);
setFocusableInTouchMode(true);
setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
@@ -269,7 +274,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
refreshBatteryStringAndIcon();
refreshAlarmDisplay();
- mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton);
mTimeFormat = DateFormat.getTimeFormat(getContext());
mDateFormatString = getContext().getString(R.string.full_wday_month_day_no_year);
@@ -340,8 +344,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
* @param iconResourceId The left hand icon.
*/
private void toastMessage(final TextView textView, final String text, final int color, final int iconResourceId) {
- if (DBG) android.util.Log.d("LockScreen", "toastMessage(text=" + text +", color=" + color + ")");
-
if (mPendingR1 != null) {
textView.removeCallbacks(mPendingR1);
mPendingR1 = null;
@@ -499,9 +501,11 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
* Update the layout to match the current status.
*/
private void updateLayout(Status status) {
- // The emergency call button appears where the carrier would
- // ordinarily be shown, so if one is VISIBLE the other must be
- // INVISIBLE.
+ // The emergency call button no longer appears on this screen.
+ if (DBG) Log.d(TAG, "updateLayout: status=" + status);
+
+ mEmergencyCallButton.setVisibility(View.GONE); // in almost all cases
+
switch (status) {
case Normal:
// text
@@ -509,12 +513,14 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
getCarrierString(
mUpdateMonitor.getTelephonyPlmn(),
mUpdateMonitor.getTelephonySpn()));
-// mScreenLocked.setText(R.string.lockscreen_screen_locked);
+
+ // Empty now, but used for sliding tab feedback
+ mScreenLocked.setText("");
// layout
mScreenLocked.setVisibility(View.VISIBLE);
mSelector.setVisibility(View.VISIBLE);
- mEmergencyCallButton.setVisibility(View.GONE);
+ mEmergencyCallText.setVisibility(View.GONE);
break;
case NetworkLocked:
// The carrier string shows both sim card status (i.e. No Sim Card) and
@@ -528,34 +534,31 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
// layout
mScreenLocked.setVisibility(View.VISIBLE);
mSelector.setVisibility(View.VISIBLE);
- mEmergencyCallButton.setVisibility(View.GONE);
+ mEmergencyCallText.setVisibility(View.GONE);
break;
case SimMissing:
// text
- mCarrier.setText("");
- mScreenLocked.setText(
- getCarrierString(
- mUpdateMonitor.getTelephonyPlmn(),
- getContext().getText(R.string.lockscreen_missing_sim_message_short)));
- // previously shown here: lockscreen_instructions_when_pattern_disabled
+ mCarrier.setText(R.string.lockscreen_missing_sim_message_short);
+ mScreenLocked.setText(R.string.lockscreen_missing_sim_instructions);
// layout
mScreenLocked.setVisibility(View.VISIBLE);
mSelector.setVisibility(View.VISIBLE);
- mEmergencyCallButton.setVisibility(View.VISIBLE);
+ mEmergencyCallText.setVisibility(View.VISIBLE);
+ // do not need to show the e-call button; user may unlock
break;
case SimMissingLocked:
// text
- mCarrier.setText("");
- mScreenLocked.setText(
+ mCarrier.setText(
getCarrierString(
mUpdateMonitor.getTelephonyPlmn(),
getContext().getText(R.string.lockscreen_missing_sim_message_short)));
- // previously shown here: lockscreen_missing_sim_instructions
+ mScreenLocked.setText(R.string.lockscreen_missing_sim_instructions);
// layout
mScreenLocked.setVisibility(View.VISIBLE);
- mSelector.setVisibility(View.GONE);
+ mSelector.setVisibility(View.GONE); // cannot unlock
+ mEmergencyCallText.setVisibility(View.VISIBLE);
mEmergencyCallButton.setVisibility(View.VISIBLE);
break;
case SimLocked:
@@ -568,20 +571,20 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
// layout
mScreenLocked.setVisibility(View.INVISIBLE);
mSelector.setVisibility(View.VISIBLE);
- mEmergencyCallButton.setVisibility(View.GONE);
+ mEmergencyCallText.setVisibility(View.GONE);
break;
case SimPukLocked:
// text
- mCarrier.setText("");
- mScreenLocked.setText(
+ mCarrier.setText(
getCarrierString(
mUpdateMonitor.getTelephonyPlmn(),
getContext().getText(R.string.lockscreen_sim_puk_locked_message)));
- // previously shown here: lockscreen_sim_puk_locked_instructions);
+ mScreenLocked.setText(R.string.lockscreen_sim_puk_locked_instructions);
// layout
mScreenLocked.setVisibility(View.VISIBLE);
- mSelector.setVisibility(View.GONE);
+ mSelector.setVisibility(View.GONE); // cannot unlock
+ mEmergencyCallText.setVisibility(View.VISIBLE);
mEmergencyCallButton.setVisibility(View.VISIBLE);
break;
}
@@ -618,7 +621,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM
}
}
}
-
+
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();