Dismiss the "no service" notification if SIM is removed
Test: atest PhoneGlobalsTest, NotificationMgrTest
Bug: 281848802
Change-Id: I40b949e90e88068775dc9f12513888b34d0522b1
diff --git a/src/com/android/phone/PhoneGlobals.java b/src/com/android/phone/PhoneGlobals.java
index abbd816..c902e68 100644
--- a/src/com/android/phone/PhoneGlobals.java
+++ b/src/com/android/phone/PhoneGlobals.java
@@ -323,17 +323,20 @@
break;
case EVENT_SIM_STATE_CHANGED:
- // Marks the event where the SIM goes into ready state.
- // Right now, this is only used for the PUK-unlocking
- // process.
EventSimStateChangedBag bag = (EventSimStateChangedBag)msg.obj;
+ // Dismiss the "No services" notification if the SIM is removed.
+ if (IccCardConstants.INTENT_VALUE_ICC_ABSENT.equals(bag.mIccStatus)) {
+ notificationMgr.dismissNetworkSelectionNotificationForInactiveSubId();
+ }
+
+ // Marks the event where the SIM goes into ready state.
+ // Right now, this is only used for the PUK-unlocking process.
if (IccCardConstants.INTENT_VALUE_ICC_READY.equals(bag.mIccStatus)
|| IccCardConstants.INTENT_VALUE_ICC_LOADED.equals(bag.mIccStatus)
|| IccCardConstants.INTENT_VALUE_ICC_NOT_READY.equals(bag.mIccStatus)
|| IccCardConstants.INTENT_VALUE_ICC_ABSENT.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.
+ // 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();