diff --git a/core/java/com/android/internal/widget/LockPatternUtils.java b/core/java/com/android/internal/widget/LockPatternUtils.java index 0dc0422967afc..682ebc4203dc4 100644 --- a/core/java/com/android/internal/widget/LockPatternUtils.java +++ b/core/java/com/android/internal/widget/LockPatternUtils.java @@ -33,6 +33,7 @@ import android.provider.Settings; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; +import android.view.View; import android.widget.Button; import java.io.File; @@ -775,6 +776,16 @@ public class LockPatternUtils { setBoolean(LOCKOUT_PERMANENT_KEY, locked); } + public boolean isEmergencyCallCapable() { + return mContext.getResources().getBoolean( + com.android.internal.R.bool.config_voice_capable); + } + + public boolean isPukUnlockScreenEnable() { + return mContext.getResources().getBoolean( + com.android.internal.R.bool.config_enable_puk_unlock_screen); + } + /** * @return A formatted string of the next alarm (for showing on the lock screen), * or null if there is no next alarm. @@ -827,11 +838,22 @@ public class LockPatternUtils { } /** - * Sets the text on the emergency button to indicate what action will be taken. + * Sets the emergency button visibility based on isEmergencyCallCapable(). + * + * If the emergency button is visible, sets the text on the emergency button + * to indicate what action will be taken. + * * If there's currently a call in progress, the button will take them to the call * @param button the button to update */ public void updateEmergencyCallButtonState(Button button) { + if (isEmergencyCallCapable()) { + button.setVisibility(View.VISIBLE); + } else { + button.setVisibility(View.GONE); + return; + } + int newState = TelephonyManager.getDefault().getCallState(); int textId; if (newState == TelephonyManager.CALL_STATE_OFFHOOK) { diff --git a/core/res/res/layout/keyguard_screen_sim_puk_landscape.xml b/core/res/res/layout/keyguard_screen_sim_puk_landscape.xml new file mode 100644 index 0000000000000..d58fb232e310f --- /dev/null +++ b/core/res/res/layout/keyguard_screen_sim_puk_landscape.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +