@Test @SmallTest @SdkSuppress(minSdkVersion = Build.VERSION_CODES.LOLLIPOP) public void testIsPlayingWithNotPlayingState() { long positionForTest = 0L; boolean notPlayingStatus = false; createPlaybackStateNotPlaying(positionForTest); assertEquals(mMediaControllerAdapter.isPlaying(), notPlayingStatus); }
@Override public boolean isPlaying() { if (mController.getPlaybackState() == null) { return false; } return mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_PLAYING || mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_FAST_FORWARDING || mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_REWINDING; }
MediaControllerAdapter extends PlayerAdapter { @Override public boolean isPlaying() { if (mController.getPlaybackState() == null) { return false; } return mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_PLAYING || mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_FAST_FORWARDING || mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_REWINDING; } }
MediaControllerAdapter extends PlayerAdapter { @Override public boolean isPlaying() { if (mController.getPlaybackState() == null) { return false; } return mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_PLAYING || mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_FAST_FORWARDING || mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_REWINDING; } MediaControllerAdapter(MediaControllerCompat controller); }
MediaControllerAdapter extends PlayerAdapter { @Override public boolean isPlaying() { if (mController.getPlaybackState() == null) { return false; } return mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_PLAYING || mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_FAST_FORWARDING || mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_REWINDING; } MediaControllerAdapter(MediaControllerCompat controller); MediaControllerCompat getMediaController(); @Override void play(); @Override void pause(); @Override void seekTo(long positionInMs); @Override void next(); @Override void previous(); @Override void fastForward(); @Override void rewind(); @Override void setRepeatAction(int repeatActionIndex); @Override void setShuffleAction(int shuffleActionIndex); @Override boolean isPlaying(); @Override long getCurrentPosition(); @Override long getBufferedPosition(); CharSequence getMediaTitle(); CharSequence getMediaSubtitle(); Drawable getMediaArt(Context context); @Override long getDuration(); @Override void onAttachedToHost(PlaybackGlueHost host); @Override void onDetachedFromHost(); @Override void setProgressUpdatingEnabled(boolean enabled); @Override long getSupportedActions(); }
MediaControllerAdapter extends PlayerAdapter { @Override public boolean isPlaying() { if (mController.getPlaybackState() == null) { return false; } return mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_PLAYING || mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_FAST_FORWARDING || mController.getPlaybackState().getState() == PlaybackStateCompat.STATE_REWINDING; } MediaControllerAdapter(MediaControllerCompat controller); MediaControllerCompat getMediaController(); @Override void play(); @Override void pause(); @Override void seekTo(long positionInMs); @Override void next(); @Override void previous(); @Override void fastForward(); @Override void rewind(); @Override void setRepeatAction(int repeatActionIndex); @Override void setShuffleAction(int shuffleActionIndex); @Override boolean isPlaying(); @Override long getCurrentPosition(); @Override long getBufferedPosition(); CharSequence getMediaTitle(); CharSequence getMediaSubtitle(); Drawable getMediaArt(Context context); @Override long getDuration(); @Override void onAttachedToHost(PlaybackGlueHost host); @Override void onDetachedFromHost(); @Override void setProgressUpdatingEnabled(boolean enabled); @Override long getSupportedActions();  }