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

Commit 008f6d4e authored by Youngsang Cho's avatar Youngsang Cho
Browse files

Block logging watched histories for passthrough inputs

Added a system API TvContract.isChannelUriForPassthroughTvInput

Change-Id: I933482831ae2a8b4d6000c4d16520387b5b6a13f
parent 9d744068
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package android.media.tv;

import android.annotation.SystemApi;
import android.content.ComponentName;
import android.content.ContentResolver;
import android.content.ContentUris;
@@ -119,6 +120,15 @@ public final class TvContract {
                .appendPath(PATH_PASSTHROUGH).build();
    }

    /**
     * Returns true, if {@code channelUri} is a channel URI for a passthrough TV input.
     * @hide
     */
    @SystemApi
    public static final boolean isChannelUriForPassthroughTvInput(Uri channelUri) {
        return channelUri.toString().endsWith(PATH_PASSTHROUGH);
    }

    /**
     * Builds a URI that points to a channel logo. See {@link Channels.Logo}.
     *
+4 −1
Original line number Diff line number Diff line
@@ -993,7 +993,10 @@ public final class TvInputManagerService extends SystemService {
                synchronized (mLock) {
                    try {
                        getSessionLocked(sessionToken, callingUid, resolvedUserId).tune(channelUri);

                        if (TvContract.isChannelUriForPassthroughTvInput(channelUri)) {
                            // Do not log the watch history for passthrough inputs.
                            return;
                        }
                        long currentTime = System.currentTimeMillis();
                        long channelId = ContentUris.parseId(channelUri);