Loading packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java +22 −14 Original line number Diff line number Diff line Loading @@ -200,21 +200,25 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi private boolean canSeekMedia() { if (mMediaController == null || mMediaController.getPlaybackState() == null) { Log.d(TAG, "Cannot seek media because the controller is invalid"); return false; } long actions = mMediaController.getPlaybackState().getActions(); Log.d(TAG, "Playback state actions are " + actions); return (actions == 0 || (actions & PlaybackState.ACTION_SEEK_TO) != 0); } protected final Runnable mUpdatePlaybackUi = new Runnable() { @Override public void run() { if (mMediaController != null && mMediaController.getMetadata() != null && mSeekBar != null) { long position = mMediaController.getPlaybackState().getPosition(); long duration = mMediaController.getMetadata().getLong( MediaMetadata.METADATA_KEY_DURATION); if (mMediaController != null && mSeekBar != null) { MediaMetadata metadata = mMediaController.getMetadata(); PlaybackState playbackState = mMediaController.getPlaybackState(); if (metadata != null && playbackState != null) { long position = playbackState.getPosition(); long duration = metadata.getLong(MediaMetadata.METADATA_KEY_DURATION); if (mDuration != duration) { mDuration = duration; Loading @@ -225,7 +229,11 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi mSeekBarElapsedTime.setText(millisecondsToTimeString(position)); } else { // We no longer have a media session / notification Log.d(TAG, "Controller missing data " + metadata + " " + playbackState); clearTimer(); } } else { Log.d(TAG, "No longer have a valid media controller"); clearTimer(); } } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/notification/row/wrapper/NotificationMediaTemplateViewWrapper.java +22 −14 Original line number Diff line number Diff line Loading @@ -200,21 +200,25 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi private boolean canSeekMedia() { if (mMediaController == null || mMediaController.getPlaybackState() == null) { Log.d(TAG, "Cannot seek media because the controller is invalid"); return false; } long actions = mMediaController.getPlaybackState().getActions(); Log.d(TAG, "Playback state actions are " + actions); return (actions == 0 || (actions & PlaybackState.ACTION_SEEK_TO) != 0); } protected final Runnable mUpdatePlaybackUi = new Runnable() { @Override public void run() { if (mMediaController != null && mMediaController.getMetadata() != null && mSeekBar != null) { long position = mMediaController.getPlaybackState().getPosition(); long duration = mMediaController.getMetadata().getLong( MediaMetadata.METADATA_KEY_DURATION); if (mMediaController != null && mSeekBar != null) { MediaMetadata metadata = mMediaController.getMetadata(); PlaybackState playbackState = mMediaController.getPlaybackState(); if (metadata != null && playbackState != null) { long position = playbackState.getPosition(); long duration = metadata.getLong(MediaMetadata.METADATA_KEY_DURATION); if (mDuration != duration) { mDuration = duration; Loading @@ -225,7 +229,11 @@ public class NotificationMediaTemplateViewWrapper extends NotificationTemplateVi mSeekBarElapsedTime.setText(millisecondsToTimeString(position)); } else { // We no longer have a media session / notification Log.d(TAG, "Controller missing data " + metadata + " " + playbackState); clearTimer(); } } else { Log.d(TAG, "No longer have a valid media controller"); clearTimer(); } } Loading