summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJae Seo <jaeseo@google.com>2014-07-14 16:07:19 -0700
committerJae Seo <jaeseo@google.com>2014-07-17 16:29:36 -0700
commit6057102dbb746593a7d59cf377c969b62e38c664 (patch)
treea146b1d3e7e953aeee8bbd122f7dcb586db4fd45 /services
parentf83ccb964796ee9b2eca2e50fdf652f3aff0e333 (diff)
downloadframeworks_base-6057102dbb746593a7d59cf377c969b62e38c664.zip
frameworks_base-6057102dbb746593a7d59cf377c969b62e38c664.tar.gz
frameworks_base-6057102dbb746593a7d59cf377c969b62e38c664.tar.bz2
TIF: Add TvParentalControlManager
Each TV input service is now required to query the system whether the user is allowed to watch the current program before showing it to the user if the parental control is turned on, which can be checked by calling TvParentalControlManager.isEnabled(). Whether the TV input service should block the content or not is determined by invoking TvParentalControlManager.isRatingBlocked() with the content rating for the current program. Then the TvParentalControlManager makes a judgment based on the user blocked ratings stored in the secure settings and returns the result. If the rating in question turns out to be blocked, the TV input service must immediately block the content and call this method with the content rating of the current program to prompt the PIN verification screen. Each TV input service also needs to continuously listen to any changes made to the parental control settings by registering a TvParentalControlManager.ParentalControlCallback() to the manager and immediately reevaluate the current program with the new parental control settings. Bug: 13172379 Change-Id: I8e1900d4b8d28c56798986d5c3906bd418ab97ac
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/tv/TvInputManagerService.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java
index 20fdefa..c2d5052 100644
--- a/services/core/java/com/android/server/tv/TvInputManagerService.java
+++ b/services/core/java/com/android/server/tv/TvInputManagerService.java
@@ -520,6 +520,23 @@ public final class TvInputManagerService extends SystemService {
}
@Override
+ public void onContentBlocked(String rating) {
+ synchronized (mLock) {
+ if (DEBUG) {
+ Slog.d(TAG, "onContentBlocked()");
+ }
+ if (sessionState.mSession == null || sessionState.mClient == null) {
+ return;
+ }
+ try {
+ sessionState.mClient.onContentBlocked(rating, sessionState.mSeq);
+ } catch (RemoteException e) {
+ Slog.e(TAG, "error in onContentBlocked");
+ }
+ }
+ }
+
+ @Override
public void onSessionEvent(String eventType, Bundle eventArgs) {
synchronized (mLock) {
if (DEBUG) {