Merge pull request #384 from VictorBG/master

Headset bug solved for Android Oreo (double and triple click)
This commit is contained in:
Karim Abou Zeid 2017-12-24 01:14:13 +01:00 committed by GitHub
commit e7d964a90f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,7 +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.
if (keycode == KeyEvent.KEYCODE_HEADSETHOOK) { if (keycode == KeyEvent.KEYCODE_HEADSETHOOK || keycode == KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
if (eventTime - mLastClickTime >= DOUBLE_CLICK) { if (eventTime - mLastClickTime >= DOUBLE_CLICK) {
mClickCounter = 0; mClickCounter = 0;
} }
@ -198,4 +198,4 @@ public class MediaButtonIntentReceiver extends BroadcastReceiver {
mWakeLock = null; mWakeLock = null;
} }
} }
} }