From 832860fb9f6b3a7188a6af2d5d67806593595800 Mon Sep 17 00:00:00 2001 From: Youngsang Cho Date: Wed, 21 May 2014 20:54:03 +0900 Subject: Add a path for generic event from a session to an application in Tv Input Framework. Plus, Video size changed event is also added. Bug: 14126559 Change-Id: I04c553481fbaf8d92adbcc34f3c9d26acc87b361 --- .../android/server/tv/TvInputManagerService.java | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'services') diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java index 6c38a4c..e52f218 100644 --- a/services/core/java/com/android/server/tv/TvInputManagerService.java +++ b/services/core/java/com/android/server/tv/TvInputManagerService.java @@ -33,6 +33,7 @@ import android.database.Cursor; import android.graphics.Rect; import android.net.Uri; import android.os.Binder; +import android.os.Bundle; import android.os.Handler; import android.os.IBinder; import android.os.Looper; @@ -338,6 +339,41 @@ public final class TvInputManagerService extends SystemService { channels[0].dispose(); } } + + @Override + public void onVideoSizeChanged(int width, int height) throws RemoteException { + synchronized (mLock) { + if (DEBUG) { + Slog.d(TAG, "onVideoSizeChanged(" + width + ", " + height + ")"); + } + if (sessionState.mSession == null || sessionState.mClient == null) { + return; + } + try { + sessionState.mClient.onVideoSizeChanged(width, height, sessionState.mSeq); + } catch (RemoteException e) { + Slog.e(TAG, "error in onSessionEvent"); + } + } + } + + @Override + public void onSessionEvent(String eventType, Bundle eventArgs) { + synchronized (mLock) { + if (DEBUG) { + Slog.d(TAG, "onEvent(what=" + eventType + ", data=" + eventArgs + ")"); + } + if (sessionState.mSession == null || sessionState.mClient == null) { + return; + } + try { + sessionState.mClient.onSessionEvent(eventType, eventArgs, + sessionState.mSeq); + } catch (RemoteException e) { + Slog.e(TAG, "error in onSessionEvent"); + } + } + } }; // Create a session. When failed, send a null token immediately. -- cgit v1.1