summaryrefslogtreecommitdiffstats
path: root/core/java/android/tv
diff options
context:
space:
mode:
authorYoungsang Cho <youngsang@google.com>2014-04-15 21:32:16 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-04-15 21:32:16 +0000
commit7ec8b21a06364357976b6b60a12a49b255ac39eb (patch)
treeb682c248162bcfecd91d88f882ffcc9fccb64f7a /core/java/android/tv
parent31e052bfc4c81f0aa682d723a88cd9b716b6cace (diff)
parent674e96216d6a60f0d87d3a6a0d62f358a101532b (diff)
downloadframeworks_base-7ec8b21a06364357976b6b60a12a49b255ac39eb.zip
frameworks_base-7ec8b21a06364357976b6b60a12a49b255ac39eb.tar.gz
frameworks_base-7ec8b21a06364357976b6b60a12a49b255ac39eb.tar.bz2
Merge "Remove TvInputSession"
Diffstat (limited to 'core/java/android/tv')
-rw-r--r--core/java/android/tv/ITvInputSessionWrapper.java5
-rw-r--r--core/java/android/tv/TvInputManager.java2
-rw-r--r--core/java/android/tv/TvInputService.java43
-rw-r--r--core/java/android/tv/TvInputSession.java55
4 files changed, 17 insertions, 88 deletions
diff --git a/core/java/android/tv/ITvInputSessionWrapper.java b/core/java/android/tv/ITvInputSessionWrapper.java
index fd4e1e3..66fe5e1 100644
--- a/core/java/android/tv/ITvInputSessionWrapper.java
+++ b/core/java/android/tv/ITvInputSessionWrapper.java
@@ -19,6 +19,7 @@ package android.tv;
import android.content.Context;
import android.net.Uri;
import android.os.Message;
+import android.tv.TvInputService.TvInputSessionImpl;
import android.util.Log;
import android.view.Surface;
@@ -38,10 +39,10 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand
private static final int DO_SET_VOLUME = 3;
private static final int DO_TUNE = 4;
- private TvInputSession mTvInputSession;
+ private TvInputSessionImpl mTvInputSession;
private final HandlerCaller mCaller;
- public ITvInputSessionWrapper(Context context, TvInputSession session) {
+ public ITvInputSessionWrapper(Context context, TvInputSessionImpl session) {
mCaller = new HandlerCaller(context, null, this, true /* asyncHandler */);
mTvInputSession = session;
}
diff --git a/core/java/android/tv/TvInputManager.java b/core/java/android/tv/TvInputManager.java
index 0b6ab64..4cf2b35 100644
--- a/core/java/android/tv/TvInputManager.java
+++ b/core/java/android/tv/TvInputManager.java
@@ -282,7 +282,7 @@ public final class TvInputManager {
}
/**
- * Creates a {@link TvInputSession} interface for a given TV input.
+ * Creates a {@link Session} for a given TV input.
* <p>
* The number of sessions that can be created at the same time is limited by the capability of
* the given TV input.
diff --git a/core/java/android/tv/TvInputService.java b/core/java/android/tv/TvInputService.java
index e43cc95..d7f6c32 100644
--- a/core/java/android/tv/TvInputService.java
+++ b/core/java/android/tv/TvInputService.java
@@ -123,7 +123,7 @@ public abstract class TvInputService extends Service {
public abstract TvInputSessionImpl onCreateSession();
/**
- * Base class for derived classes to implement to provide {@link TvInputSession}.
+ * Base class for derived classes to implement to provide {@link TvInputManager.Session}.
*/
public abstract static class TvInputSessionImpl {
/**
@@ -155,52 +155,35 @@ public abstract class TvInputService extends Service {
* @return {@code true} the tuning was successful, {@code false} otherwise.
*/
public abstract boolean onTune(Uri channelUri);
- }
-
- /**
- * Internal implementation of {@link TvInputSession}. This takes care of basic maintenance of
- * the TV input session but most behavior must be implemented in {@link TvInputSessionImpl}
- * returned by {@link TvInputService#onCreateSession}.
- */
- private static class TvInputSessionImplInternal extends TvInputSession {
- private final TvInputSessionImpl mSessionImpl;
-
- public TvInputSessionImplInternal(TvInputSessionImpl sessionImpl) {
- mSessionImpl = sessionImpl;
- }
/**
* This method is called when the application would like to stop using the current input
* session.
*/
- @Override
- public final void release() {
- mSessionImpl.onRelease();
+ void release() {
+ onRelease();
}
/**
- * Calls {@link TvInputSessionImpl#onSetSurface}.
+ * Calls {@link onSetSurface}.
*/
- @Override
- public final void setSurface(Surface surface) {
- mSessionImpl.onSetSurface(surface);
+ void setSurface(Surface surface) {
+ onSetSurface(surface);
// TODO: Handle failure.
}
/**
- * Calls {@link TvInputSessionImpl#onSetVolume}.
+ * Calls {@link onSetVolume}.
*/
- @Override
- public final void setVolume(float volume) {
- mSessionImpl.onSetVolume(volume);
+ void setVolume(float volume) {
+ onSetVolume(volume);
}
/**
- * Calls {@link TvInputSessionImpl#onTune}.
+ * Calls {@link onTune}.
*/
- @Override
- public final void tune(Uri channelUri) {
- mSessionImpl.onTune(channelUri);
+ void tune(Uri channelUri) {
+ onTune(channelUri);
// TODO: Handle failure.
}
}
@@ -222,7 +205,7 @@ public abstract class TvInputService extends Service {
return;
}
ITvInputSession stub = new ITvInputSessionWrapper(TvInputService.this,
- new TvInputSessionImplInternal(sessionImpl));
+ sessionImpl);
cb.onSessionCreated(stub);
} catch (RemoteException e) {
Log.e(TAG, "error in onSessionCreated");
diff --git a/core/java/android/tv/TvInputSession.java b/core/java/android/tv/TvInputSession.java
deleted file mode 100644
index cdd363b..0000000
--- a/core/java/android/tv/TvInputSession.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.tv;
-
-import android.net.Uri;
-import android.view.Surface;
-
-/**
- * The TvInputSession provides the per-session functionality of TvInputService.
- */
-public abstract class TvInputSession {
- /**
- * This method is called when the application would like to stop using the current input
- * session.
- */
- public void release() { }
-
- /**
- * Sets the {@link Surface} for the current input session on which the TV input renders video.
- *
- * @param surface {@link Surface} to be used for the video playback of this session.
- */
- public void setSurface(Surface surface) { }
-
- /**
- * This method is called when the application needs to handle the change of audio focus by
- * setting the relative volume of the current TV input service session.
- *
- * @param volume Volume scale from 0.0 to 1.0.
- */
- // TODO: Remove this once it becomes irrelevant for applications to handle audio focus. The plan
- // is to introduce some new concepts that will solve a number of problems in audio policy today.
- public void setVolume(float volume) { }
-
- /**
- * Tunes to a given channel.
- *
- * @param channelUri The URI of the channel.
- */
- public void tune(Uri channelUri) { }
-}