aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sample/src/com/example/sampletvinput/LocalTvInputService.java10
-rw-r--r--src/com/android/tv/util/TvInputManagerHelper.java7
2 files changed, 9 insertions, 8 deletions
diff --git a/sample/src/com/example/sampletvinput/LocalTvInputService.java b/sample/src/com/example/sampletvinput/LocalTvInputService.java
index 9d231942..7e2fbefb 100644
--- a/sample/src/com/example/sampletvinput/LocalTvInputService.java
+++ b/sample/src/com/example/sampletvinput/LocalTvInputService.java
@@ -65,21 +65,15 @@ public class LocalTvInputService extends BaseTvInputService {
return sSampleChannels;
}
sSampleChannels = new ArrayList<ChannelInfo>();
- TvContentRating[] contentRatings = new TvContentRating[] {
- TvContentRating.unflattenFromString(TvContentRating.RATING_US_TV_G),
- TvContentRating.unflattenFromString(TvContentRating.RATING_KR_ALL)};
sSampleChannels.add(
new ChannelInfo(CHANNEL_1_NUMBER, CHANNEL_1_NAME, null, 640, 480, 2, false,
new ProgramInfo(PROGRAM_1_TITLE, null, PROGRAM_1_DESC, 0, 3600,
- contentRatings, null, RESOURCE_1)));
+ null, null, RESOURCE_1)));
- contentRatings = new TvContentRating[] {
- new TvContentRating(TvContentRating.RATING_US_TV_MA,
- new String[] { TvContentRating.SUBRATING_US_S })};
sSampleChannels.add(
new ChannelInfo(CHANNEL_2_NUMBER, CHANNEL_2_NAME, null, 1280, 720, 6, true,
new ProgramInfo(PROGRAM_2_TITLE, null, PROGRAM_2_DESC, 0, 3600,
- contentRatings, null, RESOURCE_2)));
+ null, null, RESOURCE_2)));
return sSampleChannels;
}
}
diff --git a/src/com/android/tv/util/TvInputManagerHelper.java b/src/com/android/tv/util/TvInputManagerHelper.java
index 6e152970..6ce7a42c 100644
--- a/src/com/android/tv/util/TvInputManagerHelper.java
+++ b/src/com/android/tv/util/TvInputManagerHelper.java
@@ -19,6 +19,7 @@ package com.android.tv.util;
import android.media.tv.TvInputInfo;
import android.media.tv.TvInputManager;
import android.media.tv.TvInputManager.TvInputListener;
+import android.net.Uri;
import android.os.Handler;
import android.util.Log;
@@ -54,6 +55,7 @@ public class TvInputManagerHelper {
private final Handler mHandler = new Handler();
private boolean mStarted;
private final HashSet<TvInputListener> mListeners = new HashSet<TvInputListener>();
+ private List<Uri> mTvContentRatingSystemXmls;
public TvInputManagerHelper(TvInputManager tvInputManager) {
mTvInputManager = tvInputManager;
@@ -87,6 +89,7 @@ public class TvInputManagerHelper {
mInputStateMap.put(inputId, state);
}
Assert.assertEquals(mInputStateMap.size(), mInputMap.size());
+ mTvContentRatingSystemXmls = mTvInputManager.getTvContentRatingSystemXmls();
}
public void stop() {
@@ -155,6 +158,10 @@ public class TvInputManagerHelper {
return state;
}
+ public List<Uri> getTvContentRatingSystemXmls() {
+ return mTvContentRatingSystemXmls;
+ }
+
public void addListener(TvInputListener listener) {
mListeners.add(listener);
}