diff options
| author | Daniel Sandler <dsandler@android.com> | 2010-04-13 14:41:27 -0400 |
|---|---|---|
| committer | Daniel Sandler <dsandler@google.com> | 2010-04-15 11:37:05 -0400 |
| commit | 368de81b71af00628b60558a52c7df53e1cd1e96 (patch) | |
| tree | ce8989a7d99f0dbe0e47adac47c48aa0c7d17f66 /policy | |
| parent | 36b763e95290b231f614ab2fd0cab5eaecf16daa (diff) | |
| download | frameworks_base-368de81b71af00628b60558a52c7df53e1cd1e96.zip frameworks_base-368de81b71af00628b60558a52c7df53e1cd1e96.tar.gz frameworks_base-368de81b71af00628b60558a52c7df53e1cd1e96.tar.bz2 | |
Lockscreen improvements from froyo.
(In kraken as Ide3ad839.)
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: I631d8e73571ccd566dc0ad80941bd739e614b9f6
Diffstat (limited to 'policy')
| -rw-r--r-- | policy/com/android/internal/policy/impl/LockScreen.java | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/policy/com/android/internal/policy/impl/LockScreen.java b/policy/com/android/internal/policy/impl/LockScreen.java index 381b913..b3707b0 100644 --- a/policy/com/android/internal/policy/impl/LockScreen.java +++ b/policy/com/android/internal/policy/impl/LockScreen.java @@ -67,6 +67,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM private TextView mStatus2; private TextView mScreenLocked; private TextView mEmergencyCallText; + private Button mEmergencyCallButton; // current configuration state of keyboard and display private int mKeyboardHidden; @@ -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) { @@ -209,6 +210,15 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM 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); @@ -492,6 +502,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM private void updateLayout(Status status) { // 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 @@ -499,8 +512,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM getCarrierString( mUpdateMonitor.getTelephonyPlmn(), mUpdateMonitor.getTelephonySpn())); - // unnecessary clutter - //mScreenLocked.setText(R.string.lockscreen_screen_locked); + + // Empty now, but used for sliding tab feedback + mScreenLocked.setText(""); // layout mScreenLocked.setVisibility(View.INVISIBLE); @@ -530,6 +544,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM mScreenLocked.setVisibility(View.VISIBLE); mSelector.setVisibility(View.VISIBLE); mEmergencyCallText.setVisibility(View.VISIBLE); + // do not need to show the e-call button; user may unlock break; case SimMissingLocked: // text @@ -541,8 +556,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM // 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: // text @@ -566,8 +582,9 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM // layout mScreenLocked.setVisibility(View.VISIBLE); - mSelector.setVisibility(View.GONE); + mSelector.setVisibility(View.GONE); // cannot unlock mEmergencyCallText.setVisibility(View.VISIBLE); + mEmergencyCallButton.setVisibility(View.VISIBLE); break; } } @@ -603,7 +620,7 @@ class LockScreen extends LinearLayout implements KeyguardScreen, KeyguardUpdateM } } } - + @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); |
