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

Commit d2fe5a39 authored by Shubang Lu's avatar Shubang Lu Committed by Android (Google) Code Review
Browse files

Merge changes Ic8f92bd4,Ia130985e

* changes:
  TIAF: Add IApp setup & start flow
  TIAF: handle overlay media view
parents 45450c2b 938ec458
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 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.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.media.tv;

parcelable AitInfo;
+87 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 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.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.media.tv;

import android.annotation.NonNull;
import android.os.Parcel;
import android.os.Parcelable;

/**
 * AIT info.
 * @hide
 */
public final class AitInfo implements Parcelable {
    static final String TAG = "AitInfo";

    public static final Creator<AitInfo> CREATOR = new Creator<AitInfo>() {
        @Override
        public AitInfo createFromParcel(Parcel in) {
            return new AitInfo(in);
        }

        @Override
        public AitInfo[] newArray(int size) {
            return new AitInfo[size];
        }
    };

    private final int mType;
    private final int mVersion;

    private AitInfo(Parcel in) {
        mType = in.readInt();
        mVersion = in.readInt();
    }

    /**
     * Constructs AIT info.
     */
    public AitInfo(int type, int version) {
        mType = type;
        mVersion = version;
    }

    /**
     * Gets type.
     */
    public int getType() {
        return mType;
    }

    /**
     * Gets version.
     */
    public int getVersion() {
        return mVersion;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(@NonNull Parcel dest, int flags) {
        dest.writeInt(mType);
        dest.writeInt(mVersion);
    }

    @Override
    public String toString() {
        return "type=" + mType + ";version=" + mVersion;
    }
}
+4 −2
Original line number Diff line number Diff line
@@ -17,12 +17,13 @@
package android.media.tv;

import android.content.ComponentName;
import android.media.tv.AitInfo;
import android.media.tv.BroadcastInfoResponse;
import android.media.tv.ITvInputSession;
import android.net.Uri;
import android.media.tv.TvTrackInfo;
import android.os.Bundle;
import android.view.InputChannel;
import android.media.tv.BroadcastInfoResponse;

/**
 * Interface a client of the ITvInputManager implements, to identify itself and receive information
@@ -44,9 +45,10 @@ oneway interface ITvInputClient {
    void onTimeShiftStatusChanged(int status, int seq);
    void onTimeShiftStartPositionChanged(long timeMs, int seq);
    void onTimeShiftCurrentPositionChanged(long timeMs, int seq);
    void onAitInfoUpdated(in AitInfo aitInfo, int seq);

    void onTuned(in Uri channelUri, int seq);
    // For the recording session
    void onTuned(int seq, in Uri channelUri);
    void onRecordingStopped(in Uri recordedProgramUri, int seq);
    void onError(int error, int seq);

+3 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.ComponentName;
import android.content.Intent;
import android.graphics.Rect;
import android.media.PlaybackParams;
import android.media.tv.BroadcastInfoRequest;
import android.media.tv.DvbDeviceInfo;
import android.media.tv.ITvInputClient;
import android.media.tv.ITvInputHardware;
@@ -35,7 +36,6 @@ import android.net.Uri;
import android.os.Bundle;
import android.os.ParcelFileDescriptor;
import android.view.Surface;
import android.media.tv.BroadcastInfoRequest;

/**
 * Interface to the TV input manager service.
@@ -73,6 +73,8 @@ interface ITvInputManager {
    void setCaptionEnabled(in IBinder sessionToken, boolean enabled, int userId);
    void selectTrack(in IBinder sessionToken, int type, in String trackId, int userId);

    void setIAppNotificationEnabled(in IBinder sessionToken, boolean enabled, int userId);

    void sendAppPrivateCommand(in IBinder sessionToken, in String action, in Bundle data,
            int userId);

+3 −1
Original line number Diff line number Diff line
@@ -18,11 +18,11 @@ package android.media.tv;

import android.graphics.Rect;
import android.media.PlaybackParams;
import android.media.tv.BroadcastInfoRequest;
import android.media.tv.TvTrackInfo;
import android.net.Uri;
import android.os.Bundle;
import android.view.Surface;
import android.media.tv.BroadcastInfoRequest;

/**
 * Sub-interface of ITvInputService which is created per session and has its own context.
@@ -41,6 +41,8 @@ oneway interface ITvInputSession {
    void setCaptionEnabled(boolean enabled);
    void selectTrack(int type, in String trackId);

    void setIAppNotificationEnabled(boolean enable);

    void appPrivateCommand(in String action, in Bundle data);

    void createOverlayView(in IBinder windowToken, in Rect frame);
Loading