Block logging watched histories for passthrough inputs

Added a system API TvContract.isChannelUriForPassthroughTvInput

Change-Id: I933482831ae2a8b4d6000c4d16520387b5b6a13f
This commit is contained in:
Youngsang Cho
2014-07-22 21:29:47 -07:00
parent 9d744068f9
commit 008f6d4e32
2 changed files with 14 additions and 1 deletions

View File

@@ -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}.
*

View File

@@ -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);