From 22a70a5e15e5db167aa77fcc968d9361ec8ba3c1 Mon Sep 17 00:00:00 2001 From: Bonian Chen Date: Wed, 8 Jul 2020 21:56:13 +0800 Subject: [PATCH] [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 --- .../settings/network/telephony/MobileNetworkActivity.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/android/settings/network/telephony/MobileNetworkActivity.java b/src/com/android/settings/network/telephony/MobileNetworkActivity.java index 7f7dc3a192c..a7928245b18 100644 --- a/src/com/android/settings/network/telephony/MobileNetworkActivity.java +++ b/src/com/android/settings/network/telephony/MobileNetworkActivity.java @@ -158,6 +158,11 @@ public class MobileNetworkActivity extends SettingsBaseActivity // Remove the dialog if the subscription associated with this activity changes. if (info == null) { + // Close the activity when subscription removed + if ((oldSubIndex != SUB_ID_NULL) + && (!isFinishing()) && (!isDestroyed())) { + finish(); + } return; } int subIndex = info.getSubscriptionId();