Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de8d07de authored by [1;3's avatar [1;3 Committed by Yixiao Luo
Browse files

TIAF: add permission BIND_TV_INTERACTIVE_APP

Similar to BIND_TV_INPUT, in the manifest declaration, specifying
the BIND_TV_INTERACTIVE_APP permission to allow the service to
connect the TV interactive app to the system.
A system service performs the binding and has the
BIND_TV_INTERACTIVE_APP permission.

Link of BIND_TV_INPUT as a reference:
https://developer.android.com/training/tv/tif/tvinput#manifest

Bug: 215773542
Change-Id: Id185e0495420e67b2566a848dd81e0f72ad6d083
parent 30a0a6de
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ package android {
    field public static final String BIND_TELECOM_CONNECTION_SERVICE = "android.permission.BIND_TELECOM_CONNECTION_SERVICE";
    field public static final String BIND_TEXT_SERVICE = "android.permission.BIND_TEXT_SERVICE";
    field public static final String BIND_TV_INPUT = "android.permission.BIND_TV_INPUT";
    field public static final String BIND_TV_INTERACTIVE_APP = "android.permission.BIND_TV_INTERACTIVE_APP";
    field public static final String BIND_VISUAL_VOICEMAIL_SERVICE = "android.permission.BIND_VISUAL_VOICEMAIL_SERVICE";
    field public static final String BIND_VOICE_INTERACTION = "android.permission.BIND_VOICE_INTERACTION";
    field public static final String BIND_VPN_SERVICE = "android.permission.BIND_VPN_SERVICE";
+7 −0
Original line number Diff line number Diff line
@@ -4130,6 +4130,13 @@
    <permission android:name="android.permission.BIND_TV_INPUT"
        android:protectionLevel="signature|privileged" />

    <!-- Must be required by a {@link android.media.tv.interactive.TvInteractiveAppService}
         to ensure that only the system can bind to it.
         <p>Protection level: signature|privileged
    -->
    <permission android:name="android.permission.BIND_TV_INTERACTIVE_APP"
                android:protectionLevel="signature|privileged" />

    <!-- @SystemApi
         Must be required by a {@link com.android.media.tv.remoteprovider.TvRemoteProvider}
         to ensure that only the system can bind to it.
+6 −1
Original line number Diff line number Diff line
@@ -129,7 +129,12 @@ public class TvInteractiveAppManagerService extends SystemService {

        for (ResolveInfo ri : services) {
            ServiceInfo si = ri.serviceInfo;
            // TODO: add BIND_TV_INTERACTIVE_APP permission and check it here
            if (!android.Manifest.permission.BIND_TV_INTERACTIVE_APP.equals(si.permission)) {
                Slog.w(TAG, "Skipping TV interactiva app service " + si.name
                        + ": it does not require the permission "
                        + android.Manifest.permission.BIND_TV_INTERACTIVE_APP);
                continue;
            }

            ComponentName component = new ComponentName(si.packageName, si.name);
            try {