Block logging watched histories for passthrough inputs
Added a system API TvContract.isChannelUriForPassthroughTvInput Change-Id: I933482831ae2a8b4d6000c4d16520387b5b6a13f
This commit is contained in:
@@ -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}.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user