Merge "Add permission CHANGE_HDMI_CEC_ACTIVE_SOURCE"

This commit is contained in:
TreeHugger Robot
2017-06-08 04:45:04 +00:00
committed by Android (Google) Code Review
2 changed files with 12 additions and 0 deletions

View File

@@ -2616,6 +2616,12 @@
<permission android:name="android.permission.TV_VIRTUAL_REMOTE_CONTROLLER"
android:protectionLevel="signature|privileged" />
<!-- Allows an application to change HDMI CEC active source.
<p>Not for use by third-party applications.
@hide -->
<permission android:name="android.permission.CHANGE_HDMI_CEC_ACTIVE_SOURCE"
android:protectionLevel="signature|privileged" />
<!-- @SystemApi Allows an application to modify parental controls
<p>Not for use by third-party applications.
@hide -->

View File

@@ -1218,6 +1218,12 @@ public final class TvInputManagerService extends SystemService {
@Override
public void setMainSession(IBinder sessionToken, int userId) {
if (mContext.checkCallingPermission(
android.Manifest.permission.CHANGE_HDMI_CEC_ACTIVE_SOURCE)
!= PackageManager.PERMISSION_GRANTED) {
throw new SecurityException(
"The caller does not have CHANGE_HDMI_CEC_ACTIVE_SOURCE permission");
}
if (DEBUG) {
Slog.d(TAG, "setMainSession(sessionToken=" + sessionToken + ")");
}