summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVenkateshwarlu Domakonda <vdomak@codeaurora.org>2015-06-29 19:07:07 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2015-07-05 23:07:11 -0700
commitb6ffaa6f7b025c64cb0ab1ba8043c3d8fe1f5c20 (patch)
tree99e68f2317e91efaf3f3641abbb4da19b78da62f
parent2681b2f63403b17417c0add92dca0bb397361ae7 (diff)
downloadandroid_hardware_qcom_fm-b6ffaa6f7b025c64cb0ab1ba8043c3d8fe1f5c20.tar.gz
android_hardware_qcom_fm-b6ffaa6f7b025c64cb0ab1ba8043c3d8fe1f5c20.tar.bz2
android_hardware_qcom_fm-b6ffaa6f7b025c64cb0ab1ba8043c3d8fe1f5c20.zip
FM: Fix the issue with AVRCP commands
- AVRCP commands are not working on FM as FM is handling in reverse way for PLAY/PAUSE commands. - Handle the AVRCP commands in proper way. Change-Id: I7f4e8c77dfe7d9f38ce1a6794ad33d57ff5a0fbd CRs-Fixed: 863152
-rw-r--r--fmapp2/src/com/caf/fmradio/FMRadioService.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/fmapp2/src/com/caf/fmradio/FMRadioService.java b/fmapp2/src/com/caf/fmradio/FMRadioService.java
index 853347c..f9d9b7f 100644
--- a/fmapp2/src/com/caf/fmradio/FMRadioService.java
+++ b/fmapp2/src/com/caf/fmradio/FMRadioService.java
@@ -842,9 +842,9 @@ public class FMRadioService extends Service
mKeyActionDownCount = 0;
}
return true;
- } else if((event != null) && (event.getKeyCode() == KeyEvent.KEYCODE_MEDIA_PAUSE)
+ } else if((event != null) && (event.getKeyCode() == KeyEvent.KEYCODE_MEDIA_PLAY)
&& (key_action == KeyEvent.ACTION_DOWN)) {
- Log.d(LOGTAG, "SessionCallback: MEDIA_PAUSE");
+ Log.d(LOGTAG, "SessionCallback: MEDIA_PLAY");
if (mServiceInUse ) {
fmOn();
try {
@@ -856,9 +856,10 @@ public class FMRadioService extends Service
}
return true;
}
- } else if ((event != null) && (event.getKeyCode() == KeyEvent.KEYCODE_MEDIA_PLAY)
- && (key_action == KeyEvent.ACTION_DOWN)) {
- Log.d(LOGTAG, "SessionCallback: MEDIA_PLAY");
+ } else if ((event != null) && ((event.getKeyCode() == KeyEvent.KEYCODE_MEDIA_PAUSE) ||
+ (event.getKeyCode() == KeyEvent.KEYCODE_MEDIA_STOP))
+ && (key_action == KeyEvent.ACTION_DOWN)) {
+ Log.d(LOGTAG, "SessionCallback: MEDIA_PAUSE");
if (isFmOn()){
//FM should be off when Headset hook pressed.
fmOff();