diff options
author | Dongwon Kang <dwkang@google.com> | 2015-06-05 00:27:01 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-06-05 00:27:02 +0000 |
commit | 9e7ac352ebc023527e2f6745d35d39e05c2bad60 (patch) | |
tree | d9f0ea57938f57bbe640f9043c205208e1e9098b /media | |
parent | 733f147401f180b14acb13137cf99e65da1d72cc (diff) | |
parent | bb3e2674b5ad095d9c1e5e6069cd6b8ee1c1c11e (diff) | |
download | frameworks_base-9e7ac352ebc023527e2f6745d35d39e05c2bad60.zip frameworks_base-9e7ac352ebc023527e2f6745d35d39e05c2bad60.tar.gz frameworks_base-9e7ac352ebc023527e2f6745d35d39e05c2bad60.tar.bz2 |
Merge "TIF: Add sanitization code for the current position" into mnc-dev
Diffstat (limited to 'media')
-rw-r--r-- | media/java/android/media/tv/TvInputService.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java index 4b84090..d480696 100644 --- a/media/java/android/media/tv/TvInputService.java +++ b/media/java/android/media/tv/TvInputService.java @@ -933,6 +933,10 @@ public abstract class TvInputService extends Service { * Returns {@link TvInputManager#TIME_SHIFT_INVALID_TIME} if the position is unknown at the * moment. * + * <p>Note that the current playback position should be equal to or greater than the start + * playback position reported by {@link #onTimeShiftGetStartPosition}. Failure to notifying + * the correct current position might lead to bad user experience. + * * @see #onTimeShiftResume * @see #onTimeShiftPause * @see #onTimeShiftSeekTo @@ -1396,6 +1400,12 @@ public abstract class TvInputService extends Service { notifyTimeShiftStartPositionChanged(startPositionMs); } long currentPositionMs = onTimeShiftGetCurrentPosition(); + if (currentPositionMs < mStartPositionMs) { + Log.w(TAG, "Current position (" + currentPositionMs + ") cannot be earlier than" + + " start position (" + mStartPositionMs + "). Reset to the start " + + "position."); + currentPositionMs = mStartPositionMs; + } if (mCurrentPositionMs != currentPositionMs) { mCurrentPositionMs = currentPositionMs; notifyTimeShiftCurrentPositionChanged(currentPositionMs); |