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

Commit bd9b1587 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "HDMI: Ignore unit-tests on non-CEC devices" into main

parents 72dbc2ac 2cb1faa4
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -16,12 +16,15 @@

package com.android.server.hdmi;

import static android.content.pm.PackageManager.FEATURE_HDMI_CEC;

import static com.android.server.SystemService.PHASE_SYSTEM_SERVICES_READY;
import static com.android.server.hdmi.Constants.ADDR_TV;
import static com.android.server.hdmi.HdmiControlService.INITIATED_BY_ENABLE_CEC;

import static com.google.common.truth.Truth.assertThat;

import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.spy;

import android.annotation.RequiresPermission;
@@ -60,6 +63,9 @@ public class ActiveSourceActionTest {

    @Before
    public void setUp() throws Exception {
        assumeTrue("Test requires FEATURE_HDMI_CEC",
                InstrumentationRegistry.getTargetContext().getPackageManager()
                        .hasSystemFeature(FEATURE_HDMI_CEC));
        mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext()));

        FakeAudioFramework audioFramework = new FakeAudioFramework();
+6 −0
Original line number Diff line number Diff line
@@ -15,11 +15,14 @@
 */
package com.android.server.hdmi;

import static android.content.pm.PackageManager.FEATURE_HDMI_CEC;

import static com.android.server.SystemService.PHASE_SYSTEM_SERVICES_READY;
import static com.android.server.hdmi.HdmiControlService.INITIATED_BY_ENABLE_CEC;

import static com.google.common.truth.Truth.assertThat;

import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.spy;

import android.annotation.RequiresPermission;
@@ -59,6 +62,9 @@ public class ArcInitiationActionFromAvrTest {

    @Before
    public void setUp() throws Exception {
        assumeTrue("Test requires FEATURE_HDMI_CEC",
                InstrumentationRegistry.getTargetContext().getPackageManager()
                        .hasSystemFeature(FEATURE_HDMI_CEC));
        mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext()));

        FakeAudioFramework audioFramework = new FakeAudioFramework();
+6 −0
Original line number Diff line number Diff line
@@ -15,11 +15,14 @@
 */
package com.android.server.hdmi;

import static android.content.pm.PackageManager.FEATURE_HDMI_CEC;

import static com.android.server.SystemService.PHASE_SYSTEM_SERVICES_READY;
import static com.android.server.hdmi.HdmiControlService.INITIATED_BY_ENABLE_CEC;

import static com.google.common.truth.Truth.assertThat;

import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.spy;

import android.annotation.RequiresPermission;
@@ -64,6 +67,9 @@ public class ArcTerminationActionFromAvrTest {

    @Before
    public void setUp() throws Exception {
        assumeTrue("Test requires FEATURE_HDMI_CEC",
                InstrumentationRegistry.getTargetContext().getPackageManager()
                        .hasSystemFeature(FEATURE_HDMI_CEC));
        MockitoAnnotations.initMocks(this);

        mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext()));
+6 −0
Original line number Diff line number Diff line
@@ -16,12 +16,15 @@

package com.android.server.hdmi;

import static android.content.pm.PackageManager.FEATURE_HDMI_CEC;

import static com.android.server.SystemService.PHASE_SYSTEM_SERVICES_READY;
import static com.android.server.hdmi.Constants.ADDR_BROADCAST;
import static com.android.server.hdmi.Constants.ADDR_TV;

import static com.google.common.truth.Truth.assertThat;

import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;

@@ -73,6 +76,9 @@ public class DevicePowerStatusActionTest {

    @Before
    public void setUp() throws Exception {
        assumeTrue("Test requires FEATURE_HDMI_CEC",
                InstrumentationRegistry.getTargetContext().getPackageManager()
                        .hasSystemFeature(FEATURE_HDMI_CEC));
        MockitoAnnotations.initMocks(this);

        mContextSpy = spy(new ContextWrapper(InstrumentationRegistry.getTargetContext()));
+6 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.hdmi;

import static android.content.pm.PackageManager.FEATURE_HDMI_CEC;
import static android.hardware.hdmi.HdmiControlManager.POWER_STATUS_ON;
import static android.hardware.hdmi.HdmiControlManager.POWER_STATUS_STANDBY;
import static android.hardware.hdmi.HdmiControlManager.POWER_STATUS_TRANSIENT_TO_ON;
@@ -30,6 +31,8 @@ import static com.android.server.hdmi.DeviceSelectActionFromPlayback.STATE_WAIT_

import static com.google.common.truth.Truth.assertThat;

import static org.junit.Assume.assumeTrue;

import android.annotation.RequiresPermission;
import android.content.Context;
import android.content.Intent;
@@ -94,6 +97,9 @@ public class DeviceSelectActionFromPlaybackTest {

    @Before
    public void setUp() {
        assumeTrue("Test requires FEATURE_HDMI_CEC",
                InstrumentationRegistry.getTargetContext().getPackageManager()
                        .hasSystemFeature(FEATURE_HDMI_CEC));
        MockitoAnnotations.initMocks(this);

        Context context = InstrumentationRegistry.getTargetContext();
Loading