Merge "TIAF API review: rename onCreateBiInteractiveApp" into tm-dev

This commit is contained in:
Shubang Lu
2022-03-18 20:43:14 +00:00
committed by Android (Google) Code Review
16 changed files with 52 additions and 25 deletions

View File

@@ -26221,12 +26221,12 @@ package android.media.tv.interactive {
method public void onBroadcastInfoResponse(@NonNull android.media.tv.BroadcastInfoResponse);
method public void onContentAllowed();
method public void onContentBlocked(@NonNull android.media.tv.TvContentRating);
method public void onCreateBiInteractiveApp(@NonNull android.net.Uri, @Nullable android.os.Bundle);
method public void onCreateBiInteractiveAppRequest(@NonNull android.net.Uri, @Nullable android.os.Bundle);
method @Nullable public android.view.View onCreateMediaView();
method public void onCurrentChannelLcn(int);
method public void onCurrentChannelUri(@Nullable android.net.Uri);
method public void onCurrentTvInputId(@Nullable String);
method public void onDestroyBiInteractiveApp(@NonNull String);
method public void onDestroyBiInteractiveAppRequest(@NonNull String);
method public boolean onGenericMotionEvent(@NonNull android.view.MotionEvent);
method public boolean onKeyDown(int, @NonNull android.view.KeyEvent);
method public boolean onKeyLongPress(int, @NonNull android.view.KeyEvent);
@@ -26311,6 +26311,8 @@ package android.media.tv.interactive {
method public void stopInteractiveApp();
field public static final String BI_INTERACTIVE_APP_KEY_ALIAS = "alias";
field public static final String BI_INTERACTIVE_APP_KEY_CERTIFICATE = "certificate";
field public static final String BI_INTERACTIVE_APP_KEY_HTTP_ADDITIONAL_HEADERS = "http_additional_headers";
field public static final String BI_INTERACTIVE_APP_KEY_HTTP_USER_AGENT = "http_user_agent";
field public static final String BI_INTERACTIVE_APP_KEY_PRIVATE_KEY = "private_key";
}

View File

@@ -163,7 +163,11 @@ public final class AdRequest implements Parcelable {
/**
* Gets the metadata of the media file.
* <p>This includes additional information the TV input needs to play the AD media.
*
* <p>This includes additional information the TV input needs to play the AD media. This may
* include fields in {@link android.media.MediaFormat} like
* {@link android.media.MediaFormat#KEY_SAMPLE_RATE}, or integrity information like SHA. What
* data is included depends on the format of the media file.
*
* @return The metadata of the media file. Can be an empty bundle for
* {@link #REQUEST_TYPE_STOP}.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.
@@ -407,9 +407,10 @@ public abstract class TvInteractiveAppService extends Service {
* no matter if it's created successfully or not.
*
* @see #notifyBiInteractiveAppCreated(Uri, String)
* @see #onDestroyBiInteractiveApp(String)
* @see #onDestroyBiInteractiveAppRequest(String)
*/
public void onCreateBiInteractiveApp(@NonNull Uri biIAppUri, @Nullable Bundle params) {
public void onCreateBiInteractiveAppRequest(
@NonNull Uri biIAppUri, @Nullable Bundle params) {
}
@@ -417,11 +418,11 @@ public abstract class TvInteractiveAppService extends Service {
* Destroys broadcast-independent(BI) interactive application.
*
* @param biIAppId the BI interactive app ID from
* {@link #onCreateBiInteractiveApp(Uri, Bundle)}}
* {@link #onCreateBiInteractiveAppRequest(Uri, Bundle)}
*
* @see #onCreateBiInteractiveApp(Uri, Bundle)
* @see #onCreateBiInteractiveAppRequest(Uri, Bundle)
*/
public void onDestroyBiInteractiveApp(@NonNull String biIAppId) {
public void onDestroyBiInteractiveAppRequest(@NonNull String biIAppId) {
}
/**
@@ -978,11 +979,11 @@ public abstract class TvInteractiveAppService extends Service {
}
void createBiInteractiveApp(@NonNull Uri biIAppUri, @Nullable Bundle params) {
onCreateBiInteractiveApp(biIAppUri, params);
onCreateBiInteractiveAppRequest(biIAppUri, params);
}
void destroyBiInteractiveApp(@NonNull String biIAppId) {
onDestroyBiInteractiveApp(biIAppId);
onDestroyBiInteractiveAppRequest(biIAppId);
}
void setTeletextAppEnabled(boolean enable) {
@@ -1142,7 +1143,7 @@ public abstract class TvInteractiveAppService extends Service {
* @param biIAppId BI interactive app ID, which can be used to destroy the BI interactive
* app. {@code null} if it's not created successfully.
*
* @see #onCreateBiInteractiveApp(Uri, Bundle)
* @see #onCreateBiInteractiveAppRequest(Uri, Bundle)
*/
@CallSuper
public final void notifyBiInteractiveAppCreated(

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021 The Android Open Source Project
* Copyright 2021 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.
@@ -83,6 +83,19 @@ public class TvInteractiveAppView extends ViewGroup {
* @see java.security.PrivateKey
*/
public static final String BI_INTERACTIVE_APP_KEY_PRIVATE_KEY = "private_key";
/**
* Additional HTTP headers to be used by {@link TvInteractiveAppService} to load the
* broadcast-independent interactive application.
* @see #createBiInteractiveApp(Uri, Bundle)
*/
public static final String BI_INTERACTIVE_APP_KEY_HTTP_ADDITIONAL_HEADERS =
"http_additional_headers";
/**
* HTTP user agent to be used by {@link TvInteractiveAppService} for broadcast-independent
* interactive application.
* @see #createBiInteractiveApp(Uri, Bundle)
*/
public static final String BI_INTERACTIVE_APP_KEY_HTTP_USER_AGENT = "http_user_agent";
private final TvInteractiveAppManager mTvInteractiveAppManager;
private final Handler mHandler = new Handler();
@@ -595,7 +608,14 @@ public class TvInteractiveAppView extends ViewGroup {
* <p>{@link TvInteractiveAppCallback#onBiInteractiveAppCreated(String, Uri, String)} will be
* called for the result.
*
* @param biIAppUri URI associated this BI interactive app.
* @param params optional parameters for broadcast-independent interactive application, such as
* {@link #BI_INTERACTIVE_APP_KEY_CERTIFICATE}.
*
* @see TvInteractiveAppCallback#onBiInteractiveAppCreated(String, Uri, String)
* @see #BI_INTERACTIVE_APP_KEY_CERTIFICATE
* @see #BI_INTERACTIVE_APP_KEY_HTTP_ADDITIONAL_HEADERS
* @see #BI_INTERACTIVE_APP_KEY_HTTP_USER_AGENT
*/
public void createBiInteractiveApp(@NonNull Uri biIAppUri, @Nullable Bundle params) {
if (DEBUG) {