diff --git a/core/api/current.txt b/core/api/current.txt index 303e238ea2ba7..dd7a805c9d7ac 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -27432,7 +27432,7 @@ package android.media.tv { method public void notifyTvMessage(@NonNull String, @NonNull android.os.Bundle); method public void notifyVideoAvailable(); method public void notifyVideoUnavailable(int); - method public void onAdBuffer(@NonNull android.media.tv.AdBuffer); + method public void onAdBufferReady(@NonNull android.media.tv.AdBuffer); method public void onAppPrivateCommand(@NonNull String, android.os.Bundle); method public android.view.View onCreateOverlayView(); method public boolean onGenericMotionEvent(android.view.MotionEvent); @@ -27743,7 +27743,7 @@ package android.media.tv.interactive { ctor public TvInteractiveAppService.Session(@NonNull android.content.Context); method public boolean isMediaViewEnabled(); method @CallSuper public void layoutSurface(int, int, int, int); - method @CallSuper public void notifyAdBuffer(@NonNull android.media.tv.AdBuffer); + method @CallSuper public void notifyAdBufferReady(@NonNull android.media.tv.AdBuffer); method @CallSuper public final void notifyBiInteractiveAppCreated(@NonNull android.net.Uri, @Nullable String); method @CallSuper public void notifySessionStateChanged(int, int); method @CallSuper public final void notifyTeletextAppStateChanged(int); diff --git a/media/java/android/media/tv/ITvInputManager.aidl b/media/java/android/media/tv/ITvInputManager.aidl index 113c85802fa28..3b00f20e724ac 100644 --- a/media/java/android/media/tv/ITvInputManager.aidl +++ b/media/java/android/media/tv/ITvInputManager.aidl @@ -116,7 +116,7 @@ interface ITvInputManager { // For ad request void requestAd(in IBinder sessionToken, in AdRequest request, int userId); - void notifyAdBuffer(in IBinder sessionToken, in AdBuffer buffer, int userId); + void notifyAdBufferReady(in IBinder sessionToken, in AdBuffer buffer, int userId); // For TV Message void notifyTvMessage(in IBinder sessionToken, in String type, in Bundle data, int userId); diff --git a/media/java/android/media/tv/ITvInputSession.aidl b/media/java/android/media/tv/ITvInputSession.aidl index 165a9ddc26e9c..6d65e1f95271a 100644 --- a/media/java/android/media/tv/ITvInputSession.aidl +++ b/media/java/android/media/tv/ITvInputSession.aidl @@ -75,7 +75,7 @@ oneway interface ITvInputSession { // For ad request void requestAd(in AdRequest request); - void notifyAdBuffer(in AdBuffer buffer); + void notifyAdBufferReady(in AdBuffer buffer); // For TV messages void notifyTvMessage(in String type, in Bundle data); diff --git a/media/java/android/media/tv/ITvInputSessionWrapper.java b/media/java/android/media/tv/ITvInputSessionWrapper.java index 8389706b501c4..2810a7e650677 100644 --- a/media/java/android/media/tv/ITvInputSessionWrapper.java +++ b/media/java/android/media/tv/ITvInputSessionWrapper.java @@ -275,7 +275,7 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand break; } case DO_NOTIFY_AD_BUFFER: { - mTvInputSessionImpl.notifyAdBuffer((AdBuffer) msg.obj); + mTvInputSessionImpl.notifyAdBufferReady((AdBuffer) msg.obj); break; } case DO_NOTIFY_TV_MESSAGE: { @@ -465,7 +465,7 @@ public class ITvInputSessionWrapper extends ITvInputSession.Stub implements Hand } @Override - public void notifyAdBuffer(AdBuffer buffer) { + public void notifyAdBufferReady(AdBuffer buffer) { mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_NOTIFY_AD_BUFFER, buffer)); } diff --git a/media/java/android/media/tv/TvInputManager.java b/media/java/android/media/tv/TvInputManager.java index 55a753f663c80..97403a44f75fc 100644 --- a/media/java/android/media/tv/TvInputManager.java +++ b/media/java/android/media/tv/TvInputManager.java @@ -3642,13 +3642,13 @@ public final class TvInputManager { /** * Notifies when the advertisement buffer is filled and ready to be read. */ - public void notifyAdBuffer(AdBuffer buffer) { + public void notifyAdBufferReady(AdBuffer buffer) { if (mToken == null) { Log.w(TAG, "The session has been already released"); return; } try { - mService.notifyAdBuffer(mToken, buffer, mUserId); + mService.notifyAdBufferReady(mToken, buffer, mUserId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } diff --git a/media/java/android/media/tv/TvInputService.java b/media/java/android/media/tv/TvInputService.java index 9f40d704f7ac7..afc124028ce2b 100644 --- a/media/java/android/media/tv/TvInputService.java +++ b/media/java/android/media/tv/TvInputService.java @@ -1351,7 +1351,7 @@ public abstract class TvInputService extends Service { * * @param buffer The {@link AdBuffer} that became ready for playback. */ - public void onAdBuffer(@NonNull AdBuffer buffer) { + public void onAdBufferReady(@NonNull AdBuffer buffer) { } /** @@ -2050,8 +2050,8 @@ public abstract class TvInputService extends Service { onRequestAd(request); } - void notifyAdBuffer(AdBuffer buffer) { - onAdBuffer(buffer); + void notifyAdBufferReady(AdBuffer buffer) { + onAdBufferReady(buffer); } void onTvMessageReceived(String type, Bundle data) { diff --git a/media/java/android/media/tv/interactive/ITvInteractiveAppClient.aidl b/media/java/android/media/tv/interactive/ITvInteractiveAppClient.aidl index 36954ad00f5f3..77391841c6fed 100644 --- a/media/java/android/media/tv/interactive/ITvInteractiveAppClient.aidl +++ b/media/java/android/media/tv/interactive/ITvInteractiveAppClient.aidl @@ -39,7 +39,7 @@ oneway interface ITvInteractiveAppClient { void onSessionStateChanged(int state, int err, int seq); void onBiInteractiveAppCreated(in Uri biIAppUri, in String biIAppId, int seq); void onTeletextAppStateChanged(int state, int seq); - void onAdBuffer(in AdBuffer buffer, int seq); + void onAdBufferReady(in AdBuffer buffer, int seq); void onCommandRequest(in String cmdType, in Bundle parameters, int seq); void onTimeShiftCommandRequest(in String cmdType, in Bundle parameters, int seq); void onSetVideoBounds(in Rect rect, int seq); diff --git a/media/java/android/media/tv/interactive/ITvInteractiveAppSessionCallback.aidl b/media/java/android/media/tv/interactive/ITvInteractiveAppSessionCallback.aidl index 7db860489e8a5..9e43e79144fd2 100644 --- a/media/java/android/media/tv/interactive/ITvInteractiveAppSessionCallback.aidl +++ b/media/java/android/media/tv/interactive/ITvInteractiveAppSessionCallback.aidl @@ -38,7 +38,7 @@ oneway interface ITvInteractiveAppSessionCallback { void onSessionStateChanged(int state, int err); void onBiInteractiveAppCreated(in Uri biIAppUri, in String biIAppId); void onTeletextAppStateChanged(int state); - void onAdBuffer(in AdBuffer buffer); + void onAdBufferReady(in AdBuffer buffer); void onCommandRequest(in String cmdType, in Bundle parameters); void onTimeShiftCommandRequest(in String cmdType, in Bundle parameters); void onSetVideoBounds(in Rect rect); diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppManager.java b/media/java/android/media/tv/interactive/TvInteractiveAppManager.java index 3e31bce30baa0..1b26deff38226 100755 --- a/media/java/android/media/tv/interactive/TvInteractiveAppManager.java +++ b/media/java/android/media/tv/interactive/TvInteractiveAppManager.java @@ -681,14 +681,14 @@ public final class TvInteractiveAppManager { } @Override - public void onAdBuffer(AdBuffer buffer, int seq) { + public void onAdBufferReady(AdBuffer buffer, int seq) { synchronized (mSessionCallbackRecordMap) { SessionCallbackRecord record = mSessionCallbackRecordMap.get(seq); if (record == null) { Log.e(TAG, "Callback not found for seq " + seq); return; } - record.postAdBuffer(buffer); + record.postAdBufferReady(buffer); } } }; @@ -2245,12 +2245,12 @@ public final class TvInteractiveAppManager { }); } - void postAdBuffer(AdBuffer buffer) { + void postAdBufferReady(AdBuffer buffer) { mHandler.post(new Runnable() { @Override public void run() { if (mSession.getInputSession() != null) { - mSession.getInputSession().notifyAdBuffer(buffer); + mSession.getInputSession().notifyAdBufferReady(buffer); } } }); diff --git a/media/java/android/media/tv/interactive/TvInteractiveAppService.java b/media/java/android/media/tv/interactive/TvInteractiveAppService.java index 1ad40a46027aa..d78d277edd8a6 100755 --- a/media/java/android/media/tv/interactive/TvInteractiveAppService.java +++ b/media/java/android/media/tv/interactive/TvInteractiveAppService.java @@ -1941,7 +1941,7 @@ public abstract class TvInteractiveAppService extends Service { * @param buffer The {@link AdBuffer} to be received */ @CallSuper - public void notifyAdBuffer(@NonNull AdBuffer buffer) { + public void notifyAdBufferReady(@NonNull AdBuffer buffer) { executeOrPostRunnableOnMainThread(new Runnable() { @MainThread @Override @@ -1949,10 +1949,10 @@ public abstract class TvInteractiveAppService extends Service { try { if (DEBUG) { Log.d(TAG, - "notifyAdBuffer(buffer=" + buffer + ")"); + "notifyAdBufferReady(buffer=" + buffer + ")"); } if (mSessionCallback != null) { - mSessionCallback.onAdBuffer(buffer); + mSessionCallback.onAdBufferReady(buffer); } } catch (RemoteException e) { Log.w(TAG, "error in notifyAdBuffer", e); diff --git a/services/core/java/com/android/server/tv/TvInputManagerService.java b/services/core/java/com/android/server/tv/TvInputManagerService.java index c6684dfdb6e0a..11294b7c46fc5 100644 --- a/services/core/java/com/android/server/tv/TvInputManagerService.java +++ b/services/core/java/com/android/server/tv/TvInputManagerService.java @@ -2590,7 +2590,7 @@ public final class TvInputManagerService extends SystemService { } @Override - public void notifyAdBuffer( + public void notifyAdBufferReady( IBinder sessionToken, AdBuffer buffer, int userId) { final int callingUid = Binder.getCallingUid(); final int callingPid = Binder.getCallingPid(); @@ -2602,7 +2602,7 @@ public final class TvInputManagerService extends SystemService { try { SessionState sessionState = getSessionStateLocked(sessionToken, callingUid, resolvedUserId); - getSessionLocked(sessionState).notifyAdBuffer(buffer); + getSessionLocked(sessionState).notifyAdBufferReady(buffer); } catch (RemoteException | SessionNotFoundException e) { Slog.e(TAG, "error in notifyAdBuffer", e); } diff --git a/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java b/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java index 61c137ed1c5b2..bef349f177aab 100644 --- a/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java +++ b/services/core/java/com/android/server/tv/interactive/TvInteractiveAppManagerService.java @@ -3047,16 +3047,16 @@ public class TvInteractiveAppManagerService extends SystemService { } @Override - public void onAdBuffer(AdBuffer buffer) { + public void onAdBufferReady(AdBuffer buffer) { synchronized (mLock) { if (DEBUG) { - Slogf.d(TAG, "onAdBuffer(buffer=" + buffer + ")"); + Slogf.d(TAG, "onAdBufferReady(buffer=" + buffer + ")"); } if (mSessionState.mSession == null || mSessionState.mClient == null) { return; } try { - mSessionState.mClient.onAdBuffer(buffer, mSessionState.mSeq); + mSessionState.mClient.onAdBufferReady(buffer, mSessionState.mSeq); } catch (RemoteException e) { Slogf.e(TAG, "error in onAdBuffer", e); }