FileDocCategorySizeDatePackage
SimNetworkDepersonalizationPanel.javaAPI DocAndroid 1.5 API6455Wed May 06 22:42:46 BST 2009com.android.phone

SimNetworkDepersonalizationPanel

public class SimNetworkDepersonalizationPanel extends SimPanel
"SIM network unlock" PIN entry screen.
see
PhoneApp.EVENT_SIM_NETWORK_LOCKED

Fields Summary
private static final boolean
DBG
private static final int
EVENT_SIM_NTWRK_DEPERSONALIZATION_RESULT
private com.android.internal.telephony.Phone
mPhone
private android.widget.EditText
mPinEntry
private android.widget.LinearLayout
mEntryPanel
private android.widget.LinearLayout
mStatusPanel
private android.widget.TextView
mStatusText
private android.widget.Button
mUnlockButton
private android.text.TextWatcher
mPinEntryWatcher
private android.os.Handler
mHandler
View.OnClickListener
mUnlockListener
Constructors Summary
public SimNetworkDepersonalizationPanel(android.content.Context context)

    
    //constructor
       
        super(context);
    
Methods Summary
private voidhideAlert()

        mEntryPanel.setVisibility(View.VISIBLE);
        mStatusPanel.setVisibility(View.GONE);
    
private voidindicateBusy()


       
        mStatusText.setText(R.string.requesting_unlock);
        mEntryPanel.setVisibility(View.GONE);
        mStatusPanel.setVisibility(View.VISIBLE);
    
private voidindicateError()

        mStatusText.setText(R.string.unlock_failed);
        mEntryPanel.setVisibility(View.GONE);
        mStatusPanel.setVisibility(View.VISIBLE);
    
private voidindicateSuccess()

        mStatusText.setText(R.string.unlock_success);
        mEntryPanel.setVisibility(View.GONE);
        mStatusPanel.setVisibility(View.VISIBLE);
    
private voidlog(java.lang.String msg)

        Log.v(TAG, "[SimNetworkDepersonalizationPanel] " + msg);
    
protected voidonCreate(android.os.Bundle icicle)

        super.onCreate(icicle);
        setContentView(R.layout.sim_ndp);

        // PIN entry text field
        mPinEntry = (EditText) findViewById(R.id.pin_entry);
        mPinEntry.setKeyListener(DialerKeyListener.getInstance());
        mPinEntry.setOnClickListener(mUnlockListener);

        // Attach the textwatcher
        CharSequence text = mPinEntry.getText();
        Spannable span = (Spannable) text;
        span.setSpan(mPinEntryWatcher, 0, text.length(), Spannable.SPAN_INCLUSIVE_INCLUSIVE);
        
        mEntryPanel = (LinearLayout) findViewById(R.id.entry_panel);

        mUnlockButton = (Button) findViewById(R.id.ndp_unlock);
        mUnlockButton.setOnClickListener(mUnlockListener);

        //status panel is used since we're having problems with the alert dialog.
        mStatusPanel = (LinearLayout) findViewById(R.id.status_panel);
        mStatusText = (TextView) findViewById(R.id.status_text);
        
        mPhone = PhoneFactory.getDefaultPhone();
    
public booleanonKeyDown(int keyCode, android.view.KeyEvent event)

        if (keyCode == KeyEvent.KEYCODE_BACK) {
            return true;
        }

        return super.onKeyDown(keyCode, event);
    
protected voidonStart()

        super.onStart();