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

Commit 145abb7d authored by Yixiao Luo's avatar Yixiao Luo Committed by Automerger Merge Worker
Browse files

Merge "Add API to register AttributionSource of TV App to TIS" am: 9a2db083 am: 8efed016

parents 08253726 8efed016
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -25917,6 +25917,7 @@ package android.media.tv {
    method @Nullable public android.media.tv.TvInputService.RecordingSession onCreateRecordingSession(@NonNull String, @NonNull String);
    method @Nullable public android.media.tv.TvInputService.RecordingSession onCreateRecordingSession(@NonNull String, @NonNull String);
    method @Nullable public abstract android.media.tv.TvInputService.Session onCreateSession(@NonNull String);
    method @Nullable public abstract android.media.tv.TvInputService.Session onCreateSession(@NonNull String);
    method @Nullable public android.media.tv.TvInputService.Session onCreateSession(@NonNull String, @NonNull String);
    method @Nullable public android.media.tv.TvInputService.Session onCreateSession(@NonNull String, @NonNull String);
    method @Nullable public android.media.tv.TvInputService.Session onCreateSession(@NonNull String, @NonNull String, @NonNull android.content.AttributionSource);
    field public static final int PRIORITY_HINT_USE_CASE_TYPE_BACKGROUND = 100; // 0x64
    field public static final int PRIORITY_HINT_USE_CASE_TYPE_BACKGROUND = 100; // 0x64
    field public static final int PRIORITY_HINT_USE_CASE_TYPE_LIVE = 400; // 0x190
    field public static final int PRIORITY_HINT_USE_CASE_TYPE_LIVE = 400; // 0x190
    field public static final int PRIORITY_HINT_USE_CASE_TYPE_PLAYBACK = 300; // 0x12c
    field public static final int PRIORITY_HINT_USE_CASE_TYPE_PLAYBACK = 300; // 0x12c
@@ -26077,6 +26078,7 @@ package android.media.tv {
    method public String getSelectedTrack(int);
    method public String getSelectedTrack(int);
    method public java.util.List<android.media.tv.TvTrackInfo> getTracks(int);
    method public java.util.List<android.media.tv.TvTrackInfo> getTracks(int);
    method public boolean onUnhandledInputEvent(android.view.InputEvent);
    method public boolean onUnhandledInputEvent(android.view.InputEvent);
    method public void overrideTvAppAttributionSource(@NonNull android.content.AttributionSource);
    method public void reset();
    method public void reset();
    method public void selectTrack(int, String);
    method public void selectTrack(int, String);
    method public void sendAppPrivateCommand(@NonNull String, android.os.Bundle);
    method public void sendAppPrivateCommand(@NonNull String, android.os.Bundle);
+2 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.media.tv;
package android.media.tv;


import android.content.AttributionSource;
import android.content.ComponentName;
import android.content.ComponentName;
import android.content.Intent;
import android.content.Intent;
import android.graphics.Rect;
import android.graphics.Rect;
@@ -62,7 +63,7 @@ interface ITvInputManager {
    void addBlockedRating(in String rating, int userId);
    void addBlockedRating(in String rating, int userId);
    void removeBlockedRating(in String rating, int userId);
    void removeBlockedRating(in String rating, int userId);


    void createSession(in ITvInputClient client, in String inputId, boolean isRecordingSession,
    void createSession(in ITvInputClient client, in String inputId, in AttributionSource tvAppAttributionSource, boolean isRecordingSession,
            int seq, int userId);
            int seq, int userId);
    void releaseSession(in IBinder sessionToken, int userId);
    void releaseSession(in IBinder sessionToken, int userId);
    int getClientPid(in String sessionId);
    int getClientPid(in String sessionId);
+2 −1
Original line number Original line Diff line number Diff line
@@ -16,6 +16,7 @@


package android.media.tv;
package android.media.tv;


import android.content.AttributionSource;
import android.hardware.hdmi.HdmiDeviceInfo;
import android.hardware.hdmi.HdmiDeviceInfo;
import android.media.tv.ITvInputServiceCallback;
import android.media.tv.ITvInputServiceCallback;
import android.media.tv.ITvInputSessionCallback;
import android.media.tv.ITvInputSessionCallback;
@@ -30,7 +31,7 @@ interface ITvInputService {
    oneway void registerCallback(in ITvInputServiceCallback callback);
    oneway void registerCallback(in ITvInputServiceCallback callback);
    oneway void unregisterCallback(in ITvInputServiceCallback callback);
    oneway void unregisterCallback(in ITvInputServiceCallback callback);
    oneway void createSession(in InputChannel channel, in ITvInputSessionCallback callback,
    oneway void createSession(in InputChannel channel, in ITvInputSessionCallback callback,
            in String inputId, in String sessionId);
            in String inputId, in String sessionId, in AttributionSource tvAppAttributionSource);
    oneway void createRecordingSession(in ITvInputSessionCallback callback, in String inputId,
    oneway void createRecordingSession(in ITvInputSessionCallback callback, in String inputId,
            in String sessionId);
            in String sessionId);
    List<String> getAvailableExtensionInterfaceNames();
    List<String> getAvailableExtensionInterfaceNames();
+0 −1
Original line number Original line Diff line number Diff line
@@ -30,7 +30,6 @@ import android.view.InputChannel;
import android.view.InputEvent;
import android.view.InputEvent;
import android.view.InputEventReceiver;
import android.view.InputEventReceiver;
import android.view.Surface;
import android.view.Surface;

import com.android.internal.os.HandlerCaller;
import com.android.internal.os.HandlerCaller;
import com.android.internal.os.SomeArgs;
import com.android.internal.os.SomeArgs;


+14 −12
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@ import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.annotation.TestApi;
import android.content.AttributionSource;
import android.content.Context;
import android.content.Context;
import android.content.Intent;
import android.content.Intent;
import android.graphics.Rect;
import android.graphics.Rect;
@@ -53,9 +54,7 @@ import android.view.InputEventSender;
import android.view.KeyEvent;
import android.view.KeyEvent;
import android.view.Surface;
import android.view.Surface;
import android.view.View;
import android.view.View;

import com.android.internal.util.Preconditions;
import com.android.internal.util.Preconditions;

import java.lang.annotation.Retention;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.RetentionPolicy;
import java.util.ArrayList;
import java.util.ArrayList;
@@ -1835,13 +1834,15 @@ public final class TvInputManager {
     * of the given TV input.
     * of the given TV input.
     *
     *
     * @param inputId The ID of the TV input.
     * @param inputId The ID of the TV input.
     * @param tvAppAttributionSource The Attribution Source of the TV App.
     * @param callback A callback used to receive the created session.
     * @param callback A callback used to receive the created session.
     * @param handler A {@link Handler} that the session creation will be delivered to.
     * @param handler A {@link Handler} that the session creation will be delivered to.
     * @hide
     * @hide
     */
     */
    public void createSession(@NonNull String inputId, @NonNull final SessionCallback callback,
    public void createSession(@NonNull String inputId,
            @NonNull Handler handler) {
            @NonNull AttributionSource tvAppAttributionSource,
        createSessionInternal(inputId, false, callback, handler);
            @NonNull final SessionCallback callback, @NonNull Handler handler) {
        createSessionInternal(inputId, tvAppAttributionSource, false, callback, handler);
    }
    }


    /**
    /**
@@ -1866,7 +1867,7 @@ public final class TvInputManager {
     * @param useCase the use case type of the client.
     * @param useCase the use case type of the client.
     *        {@see TvInputService#PriorityHintUseCaseType}.
     *        {@see TvInputService#PriorityHintUseCaseType}.
     * @param sessionId the unique id of the session owned by the client.
     * @param sessionId the unique id of the session owned by the client.
     *        {@see TvInputService#onCreateSession(String, String)}.
     *        {@see TvInputService#onCreateSession(String, String, AttributionSource)}.
     *
     *
     * @return the use case priority value for the given use case type and the client's foreground
     * @return the use case priority value for the given use case type and the client's foreground
     *         or background status.
     *         or background status.
@@ -1917,11 +1918,11 @@ public final class TvInputManager {
     */
     */
    public void createRecordingSession(@NonNull String inputId,
    public void createRecordingSession(@NonNull String inputId,
            @NonNull final SessionCallback callback, @NonNull Handler handler) {
            @NonNull final SessionCallback callback, @NonNull Handler handler) {
        createSessionInternal(inputId, true, callback, handler);
        createSessionInternal(inputId, null, true, callback, handler);
    }
    }


    private void createSessionInternal(String inputId, boolean isRecordingSession,
    private void createSessionInternal(String inputId, AttributionSource tvAppAttributionSource,
            SessionCallback callback, Handler handler) {
            boolean isRecordingSession, SessionCallback callback, Handler handler) {
        Preconditions.checkNotNull(inputId);
        Preconditions.checkNotNull(inputId);
        Preconditions.checkNotNull(callback);
        Preconditions.checkNotNull(callback);
        Preconditions.checkNotNull(handler);
        Preconditions.checkNotNull(handler);
@@ -1930,7 +1931,8 @@ public final class TvInputManager {
            int seq = mNextSeq++;
            int seq = mNextSeq++;
            mSessionCallbackRecordMap.put(seq, record);
            mSessionCallbackRecordMap.put(seq, record);
            try {
            try {
                mService.createSession(mClient, inputId, isRecordingSession, seq, mUserId);
                mService.createSession(
                        mClient, inputId, tvAppAttributionSource, isRecordingSession, seq, mUserId);
            } catch (RemoteException e) {
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
                throw e.rethrowFromSystemServer();
            }
            }
@@ -2101,8 +2103,8 @@ public final class TvInputManager {
     * @param deviceId The device ID to acquire Hardware for.
     * @param deviceId The device ID to acquire Hardware for.
     * @param info The TV input which will use the acquired Hardware.
     * @param info The TV input which will use the acquired Hardware.
     * @param tvInputSessionId a String returned to TIS when the session was created.
     * @param tvInputSessionId a String returned to TIS when the session was created.
     *        {@see TvInputService#onCreateSession(String, String)}. If null, the client will be
     *        {@see TvInputService#onCreateSession(String, String, AttributionSource)}. If null, the
     *        treated as a background app.
     *        client will be treated as a background app.
     * @param priorityHint The use case of the client. {@see TvInputService#PriorityHintUseCaseType}
     * @param priorityHint The use case of the client. {@see TvInputService#PriorityHintUseCaseType}
     * @param executor the executor on which the listener would be invoked.
     * @param executor the executor on which the listener would be invoked.
     * @param callback A callback to receive updates on Hardware.
     * @param callback A callback to receive updates on Hardware.
Loading