am 598b3dd8: am 8e36a0a6: am 3420f3cc: Merge "No response sent when backlight is OFF"
* commit '598b3dd80f8f575c953cf8c64fb5be80d530de9a':
No response sent when backlight is OFF
diff --git a/src/com/android/stk/ToneDialog.java b/src/com/android/stk/ToneDialog.java
index 3251aba..0370939 100644
--- a/src/com/android/stk/ToneDialog.java
+++ b/src/com/android/stk/ToneDialog.java
@@ -38,6 +38,7 @@
TextMessage toneMsg = null;
ToneSettings settings = null;
TonePlayer player = null;
+ boolean mIsResponseSent = false;
/**
* Handler used to stop tones from playing when the duration ends.
@@ -98,8 +99,9 @@
@Override
protected void onDestroy() {
super.onDestroy();
-
- mToneStopper.removeMessages(MSG_ID_STOP_TONE);
+ if (mIsResponseSent) {
+ mToneStopper.removeMessages(MSG_ID_STOP_TONE);
+ }
player.stop();
player.release();
mVibrator.cancel();
@@ -129,5 +131,6 @@
args.putInt(StkAppService.OPCODE, StkAppService.OP_RESPONSE);
args.putInt(StkAppService.RES_ID, resId);
startService(new Intent(this, StkAppService.class).putExtras(args));
+ mIsResponseSent = true;
}
}