Fix comparison of SIM State values.
A recent change was made for sim personalization; the comparison of
bag.mIccStatus was using the == operator, when realistically it should use
the .equals() method. mIccStatus originates from an intent's extras
so we cannot guarantee that it is the exact same instance of the constant.
However, using .equals ensures we are comparing the actual value, which is
what we did prior to the sim personalization changes. As a result the
PUK progress dialog would NOT be hidden when the sim became ready.
Also, added some more log statements for the show/hide of this activity
just in case this was a red-herring and was not REALLY the cause of the
bug being seen.
Test: Manual
Fixes: 154672821
Change-Id: I66063d09cf38d223e8dac882521cf610715b1e23
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index df1f470..98bb766 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -265,16 +265,18 @@
// Right now, this is only used for the PUK-unlocking
// process.
EventSimStateChangedBag bag = (EventSimStateChangedBag)msg.obj;
- if (bag.mIccStatus == IccCardConstants.INTENT_VALUE_ICC_READY
- || bag.mIccStatus == IccCardConstants.INTENT_VALUE_ICC_LOADED) {
+ if (IccCardConstants.INTENT_VALUE_ICC_READY.equals(bag.mIccStatus)
+ || IccCardConstants.INTENT_VALUE_ICC_LOADED.equals(bag.mIccStatus)) {
// when the right event is triggered and there
// are UI objects in the foreground, we close
// them to display the lock panel.
if (mPUKEntryActivity != null) {
+ Log.i(LOG_TAG, "Dismiss puk entry activity");
mPUKEntryActivity.finish();
mPUKEntryActivity = null;
}
if (mPUKEntryProgressDialog != null) {
+ Log.i(LOG_TAG, "Dismiss puk progress dialog");
mPUKEntryProgressDialog.dismiss();
mPUKEntryProgressDialog = null;
}
@@ -527,6 +529,7 @@
* or SIM READYing process is over.
*/
void setPukEntryActivity(Activity activity) {
+ Log.i(LOG_TAG, "setPukEntryActivity - set to " + (activity == null ? "null" : "activity"));
mPUKEntryActivity = activity;
}
@@ -544,6 +547,8 @@
* READYing process
*/
void setPukEntryProgressDialog(ProgressDialog dialog) {
+ Log.i(LOG_TAG, "setPukEntryProgressDialog - set to "
+ + (dialog == null ? "null" : "activity"));
mPUKEntryProgressDialog = dialog;
}