From 3bb65ee33b3001fe4100fe0779ad214d6898a465 Mon Sep 17 00:00:00 2001 From: Daniel Sandler Date: Wed, 17 Mar 2010 21:52:35 -0400 Subject: [PATCH] Redesigned keyguard layout in the no-SIM case. The emergency call button has been removed (since the user can disable the keyguard, open the phone app, and enter the emergency number there). This change also restores a number of the informational & help messages that were previously removed from the lock screen. (Requires I07bfc0f1c5b3f0e10b8cb72768848251439e19dd) Bug: 2421380 Change-Id: I46a78c700427d769da6f7f2d3e9f419c2a921a61 --- .../internal/policy/impl/LockScreen.java | 57 +++++++------------ 1 file changed, 20 insertions(+), 37 deletions(-) diff --git a/policy/com/android/internal/policy/impl/LockScreen.java b/policy/com/android/internal/policy/impl/LockScreen.java index baed9ebcea326..381b9132b5252 100644 --- a/policy/com/android/internal/policy/impl/LockScreen.java +++ b/policy/com/android/internal/policy/impl/LockScreen.java @@ -66,7 +66,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM private TextView mStatus1; private TextView mStatus2; private TextView mScreenLocked; - private Button mEmergencyCallButton; + private TextView mEmergencyCallText; // current configuration state of keyboard and display private int mKeyboardHidden; @@ -203,18 +203,12 @@ 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); - mEmergencyCallButton.setOnClickListener(new View.OnClickListener() { - public void onClick(View v) { - mCallback.takeEmergencyCallAction(); - } - }); + + mEmergencyCallText = (TextView) findViewById(R.id.emergencyCallText); setFocusable(true); setFocusableInTouchMode(true); @@ -269,7 +263,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 +333,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 +490,8 @@ 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); switch (status) { case Normal: // text @@ -509,12 +499,13 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM getCarrierString( mUpdateMonitor.getTelephonyPlmn(), mUpdateMonitor.getTelephonySpn())); -// mScreenLocked.setText(R.string.lockscreen_screen_locked); + // unnecessary clutter + //mScreenLocked.setText(R.string.lockscreen_screen_locked); // layout - mScreenLocked.setVisibility(View.VISIBLE); + mScreenLocked.setVisibility(View.INVISIBLE); 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,35 +519,30 @@ 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); 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); - mEmergencyCallButton.setVisibility(View.VISIBLE); + mEmergencyCallText.setVisibility(View.VISIBLE); break; case SimLocked: // text @@ -568,21 +554,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); - mEmergencyCallButton.setVisibility(View.VISIBLE); + mEmergencyCallText.setVisibility(View.VISIBLE); break; } } @@ -655,7 +640,6 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM /** {@inheritDoc} */ public void onResume() { resetStatusInfo(mUpdateMonitor); - mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton); } /** {@inheritDoc} */ @@ -673,6 +657,5 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM } public void onPhoneStateChanged(String newState) { - mLockPatternUtils.updateEmergencyCallButtonState(mEmergencyCallButton); } }