Android auto skip button (#4865)
This commit is contained in:
parent
a36d66bf35
commit
c32239be0e
|
@ -1240,7 +1240,8 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||
capabilities = capabilities | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS;
|
||||
}
|
||||
|
||||
UiModeManager uiModeManager = (UiModeManager) getApplicationContext().getSystemService(Context.UI_MODE_SERVICE);
|
||||
UiModeManager uiModeManager = (UiModeManager) getApplicationContext()
|
||||
.getSystemService(Context.UI_MODE_SERVICE);
|
||||
if (uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR) {
|
||||
sessionState.addCustomAction(
|
||||
new PlaybackStateCompat.CustomAction.Builder(
|
||||
|
@ -1908,7 +1909,10 @@ public class PlaybackService extends MediaBrowserServiceCompat {
|
|||
@Override
|
||||
public void onSkipToNext() {
|
||||
Log.d(TAG, "onSkipToNext()");
|
||||
if (UserPreferences.shouldHardwareButtonSkip()) {
|
||||
UiModeManager uiModeManager = (UiModeManager) getApplicationContext()
|
||||
.getSystemService(Context.UI_MODE_SERVICE);
|
||||
if (UserPreferences.shouldHardwareButtonSkip()
|
||||
|| uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_CAR) {
|
||||
mediaPlayer.skip();
|
||||
} else {
|
||||
seekDelta(UserPreferences.getFastForwardSecs() * 1000);
|
||||
|
|
Loading…
Reference in New Issue