Update MediaButtonIntentReceiver.java
This commit is contained in:
parent
3ef5aee2fb
commit
bbfdfae430
1 changed files with 2 additions and 6 deletions
|
|
@ -133,11 +133,7 @@ public class MediaButtonIntentReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
// The service may or may not be running, but we need to send it
|
// The service may or may not be running, but we need to send it
|
||||||
// a command.
|
// a command.
|
||||||
int keycodeToCompare = KeyEvent.KEYCODE_HEADSETHOOK;
|
if (keycode == KeyEvent.KEYCODE_HEADSETHOOK || keycode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
||||||
keycodeToCompare = KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE;
|
|
||||||
}
|
|
||||||
if (keycode == keycodeToCompare) {
|
|
||||||
if (eventTime - mLastClickTime >= DOUBLE_CLICK) {
|
if (eventTime - mLastClickTime >= DOUBLE_CLICK) {
|
||||||
mClickCounter = 0;
|
mClickCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -203,4 +199,4 @@ public class MediaButtonIntentReceiver extends BroadcastReceiver {
|
||||||
mWakeLock = null;
|
mWakeLock = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue