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

Commit ca83ccb9 authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Add support for TvInputManager.acquireTvInputHardware CTS" into...

Merge "Merge "Add support for TvInputManager.acquireTvInputHardware CTS" into rvc-dev am: f49fa1a9 am: b7e62faf" into rvc-d1-dev-plus-aosp
parents cd602a82 4b05833b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -1728,6 +1728,15 @@ package android.media.audiopolicy {

}

package android.media.tv {

  public final class TvInputManager {
    method public void addHardwareDevice(int);
    method public void removeHardwareDevice(int);
  }

}

package android.metrics {

  public class LogMaker {
+2 −0
Original line number Diff line number Diff line
@@ -409,6 +409,8 @@ applications that come with the platform
        <permission name="android.permission.ACCESS_TV_DESCRAMBLER" />
        <permission name="android.permission.ACCESS_TV_TUNER" />
        <permission name="android.permission.TUNER_RESOURCE_ACCESS" />
        <!-- Permissions required for CTS test - TVInputManagerTest -->
        <permission name="android.permission.TV_INPUT_HARDWARE" />
    </privapp-permissions>

    <privapp-permissions package="com.android.statementservice">
+4 −0
Original line number Diff line number Diff line
@@ -111,4 +111,8 @@ interface ITvInputManager {
    // For preview channels and programs
    void sendTvInputNotifyIntent(in Intent intent, int userId);
    void requestChannelBrowsable(in Uri channelUri, int userId);

    // For CTS purpose only. Add/remove a TvInputHardware device
    void addHardwareDevice(in int deviceId);
    void removeHardwareDevice(in int deviceId);
}
+35 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import android.annotation.Nullable;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.SystemService;
import android.annotation.TestApi;
import android.content.Context;
import android.content.Intent;
import android.graphics.Rect;
@@ -1801,6 +1802,40 @@ public final class TvInputManager {
                executor, callback);
    }

    /**
     * API to add a hardware device in the TvInputHardwareManager for CTS testing
     * purpose.
     *
     * @param deviceId Id of the adding hardware device.
     *
     * @hide
     */
    @TestApi
    public void addHardwareDevice(int deviceId) {
        try {
            mService.addHardwareDevice(deviceId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * API to remove a hardware device in the TvInputHardwareManager for CTS testing
     * purpose.
     *
     * @param deviceId Id of the removing hardware device.
     *
     * @hide
     */
    @TestApi
    public void removeHardwareDevice(int deviceId) {
        try {
            mService.removeHardwareDevice(deviceId);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    private Hardware acquireTvInputHardwareInternal(int deviceId, TvInputInfo info,
            String tvInputSessionId, int priorityHint,
            Executor executor, final HardwareCallback callback) {
+3 −0
Original line number Diff line number Diff line
@@ -300,6 +300,9 @@
    <!-- Permissions needed to test shared libraries -->
    <uses-permission android:name="android.permission.ACCESS_SHARED_LIBRARIES" />

    <!-- Permissions required for CTS test - TVInputManagerTest -->
    <uses-permission android:name="android.permission.TV_INPUT_HARDWARE" />

    <application android:label="@string/app_label"
                android:theme="@android:style/Theme.DeviceDefault.DayNight"
                android:defaultToDeviceProtectedStorage="true"
Loading