am 5b0fca67: am 76f8d671: Block logging watched histories for passthrough inputs

* commit '5b0fca67b75204fb886e541719e6f049ed932dc5':
  Block logging watched histories for passthrough inputs
This commit is contained in:
Youngsang Cho
2014-07-23 12:58:34 +00:00
committed by Android Git Automerger
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);