Commit d533f129 authored by Geoffrey Métais's avatar Geoffrey Métais

Do not filter DOWN remote input events

Close #526
parent 4471bcc9
......@@ -115,8 +115,8 @@ public class PlaybackService extends MediaBrowserServiceCompat{
private static final int SHOW_TOAST = 1;
private static final int END_MEDIASESSION = 2;
private static final int DELAY_DOUBLE_CLICK = 800;
private static final int DELAY_LONG_CLICK = 1000;
private static final long DELAY_DOUBLE_CLICK = 800L;
private static final long DELAY_LONG_CLICK = 1000L;
public interface Callback {
void update();
......@@ -803,8 +803,8 @@ public class PlaybackService extends MediaBrowserServiceCompat{
}
private final class MediaSessionCallback extends MediaSessionCompat.Callback {
private long mHeadsetDownTime = 0;
private long mHeadsetUpTime = 0;
private long mHeadsetDownTime = 0L;
private long mHeadsetUpTime = 0L;
@Override
public boolean onMediaButtonEvent(Intent mediaButtonEvent) {
......@@ -817,8 +817,7 @@ public class PlaybackService extends MediaBrowserServiceCompat{
final long time = SystemClock.uptimeMillis();
switch (event.getAction()) {
case KeyEvent.ACTION_DOWN:
if (event.getRepeatCount() <= 0)
mHeadsetDownTime = time;
if (event.getRepeatCount() <= 0) mHeadsetDownTime = time;
if (!hasMedia()) {
loadLastAudioPlaylist();
return true;
......
......@@ -49,8 +49,7 @@ public class RemoteControlClientReceiver extends MediaButtonReceiver {
if (event != null && action.equalsIgnoreCase(Intent.ACTION_MEDIA_BUTTON)) {
if (event.getKeyCode() != KeyEvent.KEYCODE_HEADSETHOOK &&
event.getKeyCode() != KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE &&
event.getAction() != KeyEvent.ACTION_DOWN) {
event.getKeyCode() != KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE) {
super.onReceive(context, intent);
return;
}
......@@ -103,8 +102,7 @@ public class RemoteControlClientReceiver extends MediaButtonReceiver {
break;
}
if (isOrderedBroadcast())
abortBroadcast();
if (isOrderedBroadcast()) abortBroadcast();
if (i != null) {
Util.startService(context, i);
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment