summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYoshiaki Naka <yoshiaki.naka@sony.com>2020-01-22 19:49:27 +0900
committerYoshiaki Naka <yoshiaki.naka@sony.com>2020-01-24 11:16:08 +0900
commitfac708c060b16ca49da2586c561b9059d237481e (patch)
tree89c9135dbdde04e8b52f6d33a81b96c720e6c528 /src
parent4f5cc5e43da1ca2df851cf12f1408fcb846cb840 (diff)
downloadStk-fac708c060b16ca49da2586c561b9059d237481e.tar.gz
Close Tone Dialog if the requested tone has already been stopped
It is theoretically possible that the tone requested by PLAY TONE command has already been stopped before Tone Dialog is created if the specified duration is too short. To avoid keep displaying Tone Dialog in that scenario, Tone Dialog must finish itself if the tone has already been stopped. Bug: 148244769 Test: Manual Change-Id: I105b2a16ace6a554d475c653ac982d2c339a7fec
Diffstat (limited to 'src')
-rw-r--r--src/com/android/stk/StkAppService.java4
-rw-r--r--src/com/android/stk/ToneDialog.java6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java
index 4140d15..e03487c 100644
--- a/src/com/android/stk/StkAppService.java
+++ b/src/com/android/stk/StkAppService.java
@@ -2343,6 +2343,10 @@ public class StkAppService extends Service implements Runnable {
}
}
+ boolean isNoTonePlaying() {
+ return mTonePlayer == null ? true : false;
+ }
+
private void launchOpenChannelDialog(final int slotId) {
TextMessage msg = mStkContext[slotId].mCurrentCmd.geTextMessage();
if (msg == null) {
diff --git a/src/com/android/stk/ToneDialog.java b/src/com/android/stk/ToneDialog.java
index 2efeecd..639a216 100644
--- a/src/com/android/stk/ToneDialog.java
+++ b/src/com/android/stk/ToneDialog.java
@@ -92,6 +92,12 @@ public class ToneDialog extends Activity {
mAlertDialog = alertDialogBuilder.create();
mAlertDialog.show();
+
+ StkAppService appService = StkAppService.getInstance();
+ // Finish the activity if the specified duration is too short and timed-out already.
+ if (appService != null && (appService.isNoTonePlaying())) {
+ finish();
+ }
}
@Override