summaryrefslogtreecommitdiff
path: root/src/com/android/stk
diff options
context:
space:
mode:
authorarunvoddu <arunvoddu@google.com>2022-05-23 09:38:20 +0000
committerarunvoddu <arunvoddu@google.com>2022-05-23 09:45:32 +0000
commit8c8f504895ac4ea0339e6047c0bdf8b1c70d0b99 (patch)
treefef8b0a68ccdc20d08d7d871305820d2757f3de5 /src/com/android/stk
parentcbede31a14b7db9fa8a3a87f00277feaa0074f80 (diff)
downloadStk-8c8f504895ac4ea0339e6047c0bdf8b1c70d0b99.tar.gz
Dismissing the AlertDialog upon simremoval and app uninstall
Bug: 231930192 Test: Manual Verification done Change-Id: Ie90512001b49062daeceac6e2f2b3c80614716b1
Diffstat (limited to 'src/com/android/stk')
-rw-r--r--src/com/android/stk/StkAppService.java14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index 2e26a8e..52b06fb 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -175,6 +175,7 @@ public class StkAppService extends Service implements Runnable {
private TonePlayer mTonePlayer = null;
private Vibrator mVibrator = null;
private BroadcastReceiver mUserActivityReceiver = null;
+ private AlertDialog mAlertDialog = null;
// Used for setting FLAG_ACTIVITY_NO_USER_ACTION when
// creating an intent.
@@ -404,6 +405,11 @@ public class StkAppService extends Service implements Runnable {
unregisterHomeVisibilityObserver();
unregisterLocaleChangeReceiver();
unregisterHomeKeyEventReceiver();
+ // close the AlertDialog if any is showing upon sim remove etc cases
+ if (mAlertDialog != null && mAlertDialog.isShowing()) {
+ mAlertDialog.dismiss();
+ mAlertDialog = null;
+ }
sInstance = null;
waitForLooper();
PhoneConfigurationManager.unregisterForMultiSimConfigChange(mServiceHandler);
@@ -2356,7 +2362,7 @@ public class StkAppService extends Service implements Runnable {
msg.text = getResources().getString(R.string.default_open_channel_msg);
}
- final AlertDialog dialog = new AlertDialog.Builder(mContext)
+ mAlertDialog = new AlertDialog.Builder(mContext)
.setIconAttribute(android.R.attr.alertDialogIcon)
.setTitle(msg.title)
.setMessage(msg.text)
@@ -2381,13 +2387,13 @@ public class StkAppService extends Service implements Runnable {
})
.create();
- dialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
+ mAlertDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT);
if (!mContext.getResources().getBoolean(
R.bool.config_sf_slowBlur)) {
- dialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
+ mAlertDialog.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
}
- dialog.show();
+ mAlertDialog.show();
}
private void launchTransientEventMessage(int slotId) {