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

Commit fc5c0be9 authored by Yixiao Luo's avatar Yixiao Luo
Browse files

Update feature flag config of unbinding inactive TIS

Control unbinding TIS functionality and related permission under the same feature flag, and update flag name

Bug: 332201346
Change-Id: Ib748439f99e733be01ed897c2df7f0e07f0f491d
Test: m and vendor verification
Flag: android.media.tv.flags.tif_unbind_inactive_tis
parent 01de9dad
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -5606,12 +5606,13 @@
    <!-- This permission is required among systems services to always keep the
         binding with TvInputManagerService.
         <p>This should only be used by the OEM TvInputService.
         @FlaggedApi("android.media.tv.flags.tif_unbind_inactive_tis")
         <p>Protection level: signature|privileged|vendorPrivileged
         @hide
    -->
    <permission android:name="android.permission.ALWAYS_BOUND_TV_INPUT"
        android:protectionLevel="signature|privileged|vendorPrivileged"
        android:featureFlag="android.media.tv.flags.tis_always_bound_permission"/>
        android:featureFlag="android.media.tv.flags.tif_unbind_inactive_tis"/>

    <!-- Must be required by a {@link android.media.tv.interactive.TvInteractiveAppService}
         to ensure that only the system can bind to it.
+3 −3
Original line number Diff line number Diff line
@@ -26,11 +26,11 @@ flag {
}

flag {
    name: "tis_always_bound_permission"
    name: "tif_unbind_inactive_tis"
    is_exported: true
    namespace: "media_tv"
    description: "Introduce ALWAYS_BOUND_TV_INPUT for TIS."
    bug: "332201346"
    description: "Unbind hardware TIS when not needed"
    bug: "279189366"
}

flag {
+8 −5
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.server.tv;
import static android.media.AudioManager.DEVICE_NONE;
import static android.media.tv.TvInputManager.INPUT_STATE_CONNECTED;
import static android.media.tv.TvInputManager.INPUT_STATE_CONNECTED_STANDBY;
import static android.media.tv.flags.Flags.tifUnbindInactiveTis;
import static android.media.tv.flags.Flags.kidsModeTvdbSharing;

import android.annotation.NonNull;
@@ -4514,12 +4515,14 @@ public final class TvInputManagerService extends SystemService {
                    break;
                }
                case MSG_UPDATE_HARDWARE_TIS_BINDING:
                    if (tifUnbindInactiveTis()) {
                        SomeArgs args = (SomeArgs) msg.obj;
                        int userId = (int) args.arg1;
                        synchronized (mLock) {
                            updateHardwareTvInputServiceBindingLocked(userId);
                        }
                        args.recycle();
                    }
                    break;
                default: {
                    Slog.w(TAG, "unhandled message code: " + msg.what);