Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 09e85676 authored by David Zhao's avatar David Zhao
Browse files

Unhide SSL Signing and Certificate APIs

Bug: 309569044
Test: atest TvInteractiveAppServiceTest
Change-Id: I1d9c1ef7b9433863d4f9fe3c903e9bad0d91d91a
parent 72dc708c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -27796,6 +27796,7 @@ package android.media.tv.interactive {
    method public void onAdResponse(@NonNull android.media.tv.AdResponse);
    method public void onAvailableSpeeds(@NonNull float[]);
    method public void onBroadcastInfoResponse(@NonNull android.media.tv.BroadcastInfoResponse);
    method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onCertificate(@NonNull String, int, @NonNull android.net.http.SslCertificate);
    method public void onContentAllowed();
    method public void onContentBlocked(@NonNull android.media.tv.TvContentRating);
    method public void onCreateBiInteractiveAppRequest(@NonNull android.net.Uri, @Nullable android.os.Bundle);
@@ -27850,6 +27851,7 @@ package android.media.tv.interactive {
    method @CallSuper public void requestAd(@NonNull android.media.tv.AdRequest);
    method @CallSuper public void requestAvailableSpeeds();
    method @CallSuper public void requestBroadcastInfo(@NonNull android.media.tv.BroadcastInfoRequest);
    method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") @CallSuper public void requestCertificate(@NonNull String, int);
    method @CallSuper public void requestCurrentChannelLcn();
    method @CallSuper public void requestCurrentChannelUri();
    method @CallSuper public void requestCurrentTvInputId();
@@ -27858,6 +27860,7 @@ package android.media.tv.interactive {
    method @CallSuper public void requestScheduleRecording(@NonNull String, @NonNull String, @NonNull android.net.Uri, long, long, int, @NonNull android.os.Bundle);
    method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") @CallSuper public void requestSelectedTrackInfo();
    method @CallSuper public void requestSigning(@NonNull String, @NonNull String, @NonNull String, @NonNull byte[]);
    method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") @CallSuper public void requestSigning(@NonNull String, @NonNull String, @NonNull String, int, @NonNull byte[]);
    method @CallSuper public void requestStartRecording(@NonNull String, @Nullable android.net.Uri);
    method @CallSuper public void requestStopRecording(@NonNull String);
    method @CallSuper public void requestStreamVolume();
@@ -27917,6 +27920,7 @@ package android.media.tv.interactive {
    method public void reset();
    method public void resetInteractiveApp();
    method public void sendAvailableSpeeds(@NonNull float[]);
    method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void sendCertificate(@NonNull String, int, @NonNull android.net.http.SslCertificate);
    method public void sendCurrentChannelLcn(int);
    method public void sendCurrentChannelUri(@Nullable android.net.Uri);
    method public void sendCurrentTvInputId(@Nullable String);
@@ -27951,6 +27955,7 @@ package android.media.tv.interactive {
    method public void onBiInteractiveAppCreated(@NonNull String, @NonNull android.net.Uri, @Nullable String);
    method public void onPlaybackCommandRequest(@NonNull String, @NonNull String, @NonNull android.os.Bundle);
    method public void onRequestAvailableSpeeds(@NonNull String);
    method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onRequestCertificate(@NonNull String, @NonNull String, int);
    method public void onRequestCurrentChannelLcn(@NonNull String);
    method public void onRequestCurrentChannelUri(@NonNull String);
    method public void onRequestCurrentTvInputId(@NonNull String);
@@ -27959,6 +27964,7 @@ package android.media.tv.interactive {
    method public void onRequestScheduleRecording(@NonNull String, @NonNull String, @NonNull String, @NonNull android.net.Uri, long, long, int, @NonNull android.os.Bundle);
    method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onRequestSelectedTrackInfo(@NonNull String);
    method public void onRequestSigning(@NonNull String, @NonNull String, @NonNull String, @NonNull String, @NonNull byte[]);
    method @FlaggedApi("android.media.tv.flags.tiaf_v_apis") public void onRequestSigning(@NonNull String, @NonNull String, @NonNull String, @NonNull String, int, @NonNull byte[]);
    method public void onRequestStartRecording(@NonNull String, @NonNull String, @Nullable android.net.Uri);
    method public void onRequestStopRecording(@NonNull String, @NonNull String);
    method public void onRequestStreamVolume(@NonNull String);
+2 −4
Original line number Diff line number Diff line
@@ -2634,8 +2634,8 @@ public final class TvInteractiveAppManager {

        /**
         * This is called when
         * {@link TvInteractiveAppService.Session#requestSigning(String, String, String, int, byte[])} is
         * called.
         * {@link TvInteractiveAppService.Session#requestSigning(String, String, String, int, byte[])}
         * is called.
         *
         * @param session A {@link TvInteractiveAppService.Session} associated with this callback.
         * @param signingId the ID to identify the request.
@@ -2644,7 +2644,6 @@ public final class TvInteractiveAppManager {
         * @param host The host of the SSL CLient Authentication Server
         * @param port The port of the SSL Client Authentication Server
         * @param data the original bytes to be signed.
         * @hide
         */
        public void onRequestSigning(
                Session session, String signingId, String algorithm, String host,
@@ -2657,7 +2656,6 @@ public final class TvInteractiveAppManager {
         * @param session A {@link TvInteractiveAppService.Session} associated with this callback.
         * @param host the host name of the SSL authentication server.
         * @param port the port of the SSL authentication server. E.g., 443
         * @hide
         */
        public void onRequestCertificate(Session session, String host, int port) {
        }
+4 −3
Original line number Diff line number Diff line
@@ -742,8 +742,8 @@ public abstract class TvInteractiveAppService extends Service {
         * @param host the host name of the SSL authentication server.
         * @param port the port of the SSL authentication server. E.g., 443
         * @param cert the SSL certificate received.
         * @hide
         */
        @FlaggedApi(Flags.FLAG_TIAF_V_APIS)
        public void onCertificate(@NonNull String host, int port, @NonNull SslCertificate cert) {
        }

@@ -1666,9 +1666,9 @@ public abstract class TvInteractiveAppService extends Service {
         * @see #onSigningResult(String, byte[])
         * @see TvInteractiveAppView#createBiInteractiveApp(Uri, Bundle)
         * @see TvInteractiveAppView#BI_INTERACTIVE_APP_KEY_ALIAS
         * @hide
         */
        @CallSuper
        @FlaggedApi(Flags.FLAG_TIAF_V_APIS)
        public void requestSigning(@NonNull String signingId, @NonNull String algorithm,
                @NonNull String host, int port, @NonNull byte[] data) {
            executeOrPostRunnableOnMainThread(new Runnable() {
@@ -1695,8 +1695,9 @@ public abstract class TvInteractiveAppService extends Service {
         *
         * @param host the host name of the SSL authentication server.
         * @param port the port of the SSL authentication server. E.g., 443
         * @hide
         */
        @CallSuper
        @FlaggedApi(Flags.FLAG_TIAF_V_APIS)
        public void requestCertificate(@NonNull String host, int port) {
            executeOrPostRunnableOnMainThread(new Runnable() {
                @MainThread
+62 −2
Original line number Diff line number Diff line
@@ -760,12 +760,12 @@ public class TvInteractiveAppView extends ViewGroup {
    }

    /**
     * Send the requested SSL certificate to the TV Interactive App
     * Sends the requested SSL certificate to the TV Interactive App
     * @param host the host name of the SSL authentication server.
     * @param port the port of the SSL authentication server. E.g., 443
     * @param cert the SSL certificate requested
     * @hide
     */
    @FlaggedApi(Flags.FLAG_TIAF_V_APIS)
    public void sendCertificate(@NonNull String host, int port, @NonNull SslCertificate cert) {
        if (DEBUG) {
            Log.d(TAG, "sendCertificate");
@@ -1389,6 +1389,37 @@ public class TvInteractiveAppView extends ViewGroup {
                @NonNull String algorithm, @NonNull String alias, @NonNull byte[] data) {
        }

        /**
         * This is called when
         * {@link TvInteractiveAppService.Session#requestSigning(String, String, String, int, byte[])}
         * is called.
         *
         * @param iAppServiceId The ID of the TV interactive app service bound to this view.
         * @param signingId the ID to identify the request.
         * @param algorithm the standard name of the signature algorithm requested, such as
         *                  MD5withRSA, SHA256withDSA, etc.
         * @param host The hostname of the SSL authentication server.
         * @param port The port of the SSL authentication server.
         * @param data the original bytes to be signed.
         */
        @FlaggedApi(Flags.FLAG_TIAF_V_APIS)
        public void onRequestSigning(@NonNull String iAppServiceId, @NonNull String signingId,
                @NonNull String algorithm, @NonNull String host, int port, @NonNull byte[] data) {
        }

        /**
         * This is called when
         * {@link TvInteractiveAppService.Session#requestCertificate(String, int)} is called.
         *
         * @param iAppServiceId The ID of the TV interactive app service bound to this view.
         * @param host The hostname of the SSL authentication server.
         * @param port The port of the SSL authentication server.
         */
        @FlaggedApi(Flags.FLAG_TIAF_V_APIS)
        public void onRequestCertificate(@NonNull String iAppServiceId, @NonNull String host,
                int port) {
        }

        /**
         * This is called when {@link TvInteractiveAppService.Session#setTvRecordingInfo(String,
         * TvRecordingInfo)} is called.
@@ -1957,5 +1988,34 @@ public class TvInteractiveAppView extends ViewGroup {
                mCallback.onRequestSigning(mIAppServiceId, id, algorithm, alias, data);
            }
        }

        @Override
        public void onRequestSigning(
                Session session, String id, String algorithm, String host, int port, byte[] data) {
            if (DEBUG) {
                Log.d(TAG, "onRequestSigning");
            }
            if (this != mSessionCallback) {
                Log.w(TAG, "onRequestSigning - session not created");
                return;
            }
            if (mCallback != null && Flags.tiafVApis()) {
                mCallback.onRequestSigning(mIAppServiceId, id, algorithm, host, port, data);
            }
        }

        @Override
        public void onRequestCertificate(Session session, String host, int port) {
            if (DEBUG) {
                Log.d(TAG, "onRequestCertificate");
            }
            if (this != mSessionCallback) {
                Log.w(TAG, "onRequestCertificate - session not created");
                return;
            }
            if (mCallback != null && Flags.tiafVApis()) {
                mCallback.onRequestCertificate(mIAppServiceId, host, port);
            }
        }
    }
}