diff options
author | Preeti Ahuja <preetia@codeaurora.org> | 2015-09-29 16:56:40 -0700 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2015-10-06 11:49:36 -0700 |
commit | cac87a046b7720ef2cdcb1095a1d621d087ca058 (patch) | |
tree | d45ae78c524aa067b4309af395e5c409fbe3f027 | |
parent | 6c62c66331dfa97ad11013ce816512a3a7f7c29f (diff) | |
download | android_packages_apps_Stk-cac87a046b7720ef2cdcb1095a1d621d087ca058.tar.gz android_packages_apps_Stk-cac87a046b7720ef2cdcb1095a1d621d087ca058.tar.bz2 android_packages_apps_Stk-cac87a046b7720ef2cdcb1095a1d621d087ca058.zip |
Send the correct Message object for the Play Tone command.
When stopping the tone that is playing due to the Play Tone command,
a delayed Message is sent to StkAppService with its 'arg2' field
containing a flag that indicates if tone dialog activity needs to be
closed. But when handling the received messages, StkAppService expects
the Message object's 'arg2' field to contain the slot Id on which the
command is received. This causes unexpected behavior when executing
the Play Tone command.
Use a different field in the Message object to send the the value of
the flag which indicates if tone dialog activity needs to be closed.
Change-Id: Ib25986efe1d7c26976015f666580a3deb28bb328
CRs-Fixed: 915779
-rwxr-xr-x | src/com/android/stk/StkAppService.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/com/android/stk/StkAppService.java b/src/com/android/stk/StkAppService.java index 97ee9a5..c50ed5e 100755 --- a/src/com/android/stk/StkAppService.java +++ b/src/com/android/stk/StkAppService.java @@ -1713,7 +1713,7 @@ public class StkAppService extends Service implements Runnable { Message msg = mServiceHandler.obtainMessage(); msg.arg1 = OP_STOP_TONE; - msg.arg2 = (showUserInfo) ? 1 : 0; + msg.obj = (Integer)(showUserInfo ? 1 : 0); msg.what = STOP_TONE_WHAT; mServiceHandler.sendMessageDelayed(msg, timeout); if (settings.vibrate) { @@ -1745,13 +1745,14 @@ public class StkAppService extends Service implements Runnable { private void handleStopTone(Message msg, int slotId) { int resId = 0; - // Stop the play tone in following cases, + // Stop the play tone in following cases: // 1.OP_STOP_TONE: play tone timer expires. // 2.STOP_TONE_USER: user pressed the back key. if (msg.arg1 == OP_STOP_TONE) { resId = RES_ID_DONE; // Dismiss Tone dialog, after finishing off playing the tone. - if (msg.arg2 == 1) finishToneDialogActivity(); + int finishActivity = (Integer) msg.obj; + if (finishActivity == 1) finishToneDialogActivity(); } else if (msg.arg1 == OP_STOP_TONE_USER) { resId = RES_ID_END_SESSION; } |