author | Zhiwei Yan <zhiwei.yan@amlogic.com> | 2018-01-17 07:02:32 (GMT) |
---|---|---|
committer | Zhiwei Yan <zhiwei.yan@amlogic.com> | 2018-01-18 06:29:19 (GMT) |
commit | e260d9677d4ea3b53ec4d1d1f36aead268ea2882 (patch) | |
tree | 580dcf594d0aa162208ee6648ed7468894e1480f | |
parent | 77e0761a0efd34c2431e8332d779d31983b9c870 (diff) | |
download | TvInput-e260d9677d4ea3b53ec4d1d1f36aead268ea2882.zip TvInput-e260d9677d4ea3b53ec4d1d1f36aead268ea2882.tar.gz TvInput-e260d9677d4ea3b53ec4d1d1f36aead268ea2882.tar.bz2 |
DroidLogicTvInput: init currentrating when begain to play [1/2]
PD# 158904
init currentrating when begain to play
Change-Id: Iefe889e71800caff815bb1e5deab2e70c26e2a8d
-rw-r--r-- | DroidLogicTvInput/src/com/droidlogic/tvinput/services/DTVInputService.java | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/DroidLogicTvInput/src/com/droidlogic/tvinput/services/DTVInputService.java b/DroidLogicTvInput/src/com/droidlogic/tvinput/services/DTVInputService.java index 09f25d6..21a3b47 100644 --- a/DroidLogicTvInput/src/com/droidlogic/tvinput/services/DTVInputService.java +++ b/DroidLogicTvInput/src/com/droidlogic/tvinput/services/DTVInputService.java @@ -837,7 +837,7 @@ public class DTVInputService extends DroidLogicTvInputService implements TvContr protected boolean tryPlayProgram(ChannelInfo info) { mCurrentChannel = info; mCurrentPmtContentRatings = null; - mCurrentCCContentRatings = null; + mCurrentCCContentRatings = Program.stringToContentRatings(info.getContentRatings()); if ((mLastChannel != null) && (mCurrentChannel != null)) { if ((mLastChannel.getFrequency() != mCurrentChannel.getFrequency()) || mUpdateTsFlag) { @@ -923,7 +923,6 @@ public class DTVInputService extends DroidLogicTvInputService implements TvContr notifyTracks(info); tryStartSubtitle(info); - startAudioADByMain(info, audioAuto); isUnlockCurrent_NR = false; return true; @@ -978,6 +977,7 @@ public class DTVInputService extends DroidLogicTvInputService implements TvContr mLastBlockedRating = contentRating; if (!isTvPlaying) { playProgram(mCurrentChannel);//play after notifyContentBlocked to avoid paly after unblock + mTvControlManager.setAmAudioPreMute(TvControlManager.AUDIO_MUTE_FOR_TV);//need mute immediately } } else { synchronized(mLock) { @@ -1038,12 +1038,24 @@ public class DTVInputService extends DroidLogicTvInputService implements TvContr /*pmt ratings 2nd*/ if (ratings == null) { ratings = mCurrentPmtContentRatings; - saveCurrentChannelRatings(); + if (ratings != null && ratings.length > 0) { + if (DEBUG) Log.d(TAG, "mCurrentPmtContentRatings = " + Program.contentRatingsToString(ratings)); + saveCurrentChannelRatings(); + } } /*cc ratings 3rd*/ if (ratings == null) { ratings = mCurrentCCContentRatings; - saveCurrentChannelRatings(); + if (ratings != null && ratings.length > 0) { + if (DEBUG) Log.d(TAG, "mCurrentCCContentRatings = " + Program.contentRatingsToString(ratings)); + saveCurrentChannelRatings(); + } + } + if (ratings == null && mCurrentChannel != null) { + ratings = Program.stringToContentRatings(mCurrentChannel.getContentRatings()); + if (ratings != null && ratings.length > 0) { + if (DEBUG) Log.d(TAG, "mCurrentChannel = " + Program.contentRatingsToString(ratings)); + } } return ratings; |