[Settings] subscription UI should be closed when SIM is removed

When SIM is removed, subscription UI should actively be closed (instead of
waiting for user to leave UI).

Bug: 160197149
Test: manual
Merged-In: I2854147c956faa633a9682eee0028db6cd2d3912
Change-Id: I920b88879a225f1d6ce696c7784d1f6f279c16d9
This commit is contained in:
Bonian Chen
2020-07-08 21:56:13 +08:00
parent 36cfa7db8e
commit 22a70a5e15

View File

@@ -158,6 +158,11 @@ public class MobileNetworkActivity extends SettingsBaseActivity
// Remove the dialog if the subscription associated with this activity changes. // Remove the dialog if the subscription associated with this activity changes.
if (info == null) { if (info == null) {
// Close the activity when subscription removed
if ((oldSubIndex != SUB_ID_NULL)
&& (!isFinishing()) && (!isDestroyed())) {
finish();
}
return; return;
} }
int subIndex = info.getSubscriptionId(); int subIndex = info.getSubscriptionId();