Closed GoogleCodeExporter closed 9 years ago
in my case , this is not an Issue , it's a benefit !
Original comment by justsad.eng@gmail.com
on 13 Apr 2011 at 2:01
you're at the office talking to your chief, you've Eve in your pocket,
unfortunately music button is pressed and your hard rock song starts.
It's a real benefit? :)
Original comment by andreabe...@gmail.com
on 13 Apr 2011 at 2:04
sorry, i didn't read all above carefully , you are right cause (music
application is closed)!!
sorry again man ..
Original comment by justsad.eng@gmail.com
on 13 Apr 2011 at 2:07
https://github.com/OpenEtna/android_frameworks_policies_base/commit/f69f61d70468
d60e8e283e5afd1fb3808f61a183
but It seems to me a little hackish.
Original comment by wkp...@gmail.com
on 13 Apr 2011 at 2:36
Just like last time with OpenEtna, I would ask that this be made a switchable
option, because I like this feature.
I would rather be able to choose if I want this function to work or not, not
have it forced disabled.
Original comment by rais...@gmail.com
on 13 Apr 2011 at 6:05
Original comment by wkp...@gmail.com
on 15 Apr 2011 at 2:26
In OpenEtna this was happening too..
Original comment by lfg.1...@gmail.com
on 17 Apr 2011 at 10:44
there is a workaround.
you can disable music button by editing /system/usr/eve_qwerty.kl:
comment out the following like
...
#key 202 MEDIA_PLAY_PAUSE
..
Original comment by wkp...@gmail.com
on 30 Apr 2011 at 11:29
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -1941,6 +1941,20 @@ public class PhoneWindowManager implements
WindowManagerPolicy {
}
/**
+ * @return Whether headset or bluetooth is being used.
+ */
+ boolean isWired() {
+ final AudioManager am =
(AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
+ if (am == null) {
+ return false;
+ }
+ if (am.isWiredHeadsetOn() || am.isBluetoothA2dpOn()) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
* Tell the audio service to adjust the volume appropriate to the event.
* @param keycode
*/
@@ -2058,6 +2072,10 @@ public class PhoneWindowManager implements
WindowManagerPolicy {
result |= ACTION_POKE_USER_ACTIVITY;
}
}
+ if (down && (policyFlags & WindowManagerPolicy.FLAG_WAKE_DROPPED)
!= 0) {
+ // ignore
+ if (!isWired()) return result;
+ }
}
// Handle special keys.
Original comment by wkp...@gmail.com
on 30 Apr 2011 at 2:49
above patch do not work. this is fixed patch.
--- a/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+++ b/policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
@@ -2017,6 +2017,20 @@ public class PhoneWindowManager implements
WindowManagerPolicy {
}
/**
+ * @return Whether headset or bluetooth is being used.
+ */
+ boolean isWired() {
+ final AudioManager am =
(AudioManager)mContext.getSystemService(Context.AUDIO_SERVICE);
+ if (am == null) {
+ return false;
+ }
+ if (am.isWiredHeadsetOn() || am.isBluetoothA2dpOn()) {
+ return true;
+ }
+ return false;
+ }
+
+ /**
* Tell the audio service to adjust the volume appropriate to the event.
* @param keycode
*/
@@ -2134,6 +2148,10 @@ public class PhoneWindowManager implements
WindowManagerPolicy {
result |= ACTION_POKE_USER_ACTIVITY;
}
}
+
+ if (down && keyCode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
+ if (!isWired()) return result;
+ }
}
// Handle special keys.
Original comment by wkp...@gmail.com
on 12 May 2011 at 9:57
Original comment by wkp...@gmail.com
on 21 May 2011 at 5:15
Original comment by wkp...@gmail.com
on 29 May 2011 at 12:58
Original issue reported on code.google.com by
andreabe...@gmail.com
on 13 Apr 2011 at 1:59