1 /*
2  * Copyright (C) 2012 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.keyguard;
18 
19 import android.content.Context;
20 import android.content.res.Configuration;
21 import android.util.AttributeSet;
22 
23 import com.android.systemui.R;
24 
25 /**
26  * Displays a PIN pad for unlocking.
27  */
28 public class KeyguardSimPinView extends KeyguardSimInputView {
29     public static final String TAG = "KeyguardSimPinView";
30 
KeyguardSimPinView(Context context)31     public KeyguardSimPinView(Context context) {
32         this(context, null);
33     }
34 
KeyguardSimPinView(Context context, AttributeSet attrs)35     public KeyguardSimPinView(Context context, AttributeSet attrs) {
36         super(context, attrs);
37     }
38 
39     @Override
onConfigurationChanged(Configuration newConfig)40     protected void onConfigurationChanged(Configuration newConfig) {
41         super.onConfigurationChanged(newConfig);
42         resetState();
43     }
44 
45     @Override
getPromptReasonStringRes(int reason)46     protected int getPromptReasonStringRes(int reason) {
47         // No message on SIM Pin
48         return 0;
49     }
50 
51     @Override
getPasswordTextViewId()52     protected int getPasswordTextViewId() {
53         return R.id.simPinEntry;
54     }
55 
56     @Override
onFinishInflate()57     protected void onFinishInflate() {
58         super.onFinishInflate();
59 
60         if (mEcaView instanceof EmergencyCarrierArea) {
61             ((EmergencyCarrierArea) mEcaView).setCarrierTextVisible(true);
62         }
63     }
64 
65     @Override
startAppearAnimation()66     public void startAppearAnimation() {
67         // noop.
68     }
69 
70     @Override
getTitle()71     public CharSequence getTitle() {
72         return getContext().getString(
73                 com.android.internal.R.string.keyguard_accessibility_sim_pin_unlock);
74     }
75 }
76