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

Commit 3cdd8184 authored by Venkatarama NG. Avadhani's avatar Venkatarama NG. Avadhani Committed by Nathalie Le Clair
Browse files

Add onBootPhase call to tests that use AudioDevice

Audio Device now checks for the screen on status when logical address
allocation completes. Any test that depends on this feature will have to
make sure that the onBootPhase is called so that mDisplayManager is not
null in isScreenOff() of HdmiControlService

Bug: 194790930
Test: atest com.android.server.hdmi
Change-Id: I7137f4e5d9978a4bc997a0ab6b03621ec3f2bb25
parent 8256a398
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.server.hdmi;

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;

@@ -153,6 +154,7 @@ public class ActiveSourceActionTest {
                mHdmiControlService);
        audioDevice.init();
        mLocalDevices.add(audioDevice);
        mHdmiControlService.onBootPhase(PHASE_SYSTEM_SERVICES_READY);
        mHdmiControlService.allocateLogicalAddress(mLocalDevices, INITIATED_BY_ENABLE_CEC);
        mTestLooper.dispatchAll();

+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.server.hdmi;

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;
@@ -115,6 +116,7 @@ public class ArcInitiationActionFromAvrTest {
        mAction = new ArcInitiationActionFromAvr(mHdmiCecLocalDeviceAudioSystem);

        mLocalDevices.add(mHdmiCecLocalDeviceAudioSystem);
        hdmiControlService.onBootPhase(PHASE_SYSTEM_SERVICES_READY);
        hdmiControlService.allocateLogicalAddress(mLocalDevices, INITIATED_BY_ENABLE_CEC);
        mTestLooper.dispatchAll();
    }
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.server.hdmi;

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;
@@ -114,6 +115,7 @@ public class ArcTerminationActionFromAvrTest {
        mAction = new ArcTerminationActionFromAvr(mHdmiCecLocalDeviceAudioSystem);

        mLocalDevices.add(mHdmiCecLocalDeviceAudioSystem);
        hdmiControlService.onBootPhase(PHASE_SYSTEM_SERVICES_READY);
        hdmiControlService.allocateLogicalAddress(mLocalDevices, INITIATED_BY_ENABLE_CEC);
        mHdmiCecLocalDeviceAudioSystem.setArcStatus(true);
        mTestLooper.dispatchAll();
+2 −0
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
 */
package com.android.server.hdmi;

import static com.android.server.SystemService.PHASE_SYSTEM_SERVICES_READY;
import static com.android.server.hdmi.Constants.ADDR_AUDIO_SYSTEM;
import static com.android.server.hdmi.Constants.ADDR_BROADCAST;
import static com.android.server.hdmi.Constants.ADDR_PLAYBACK_1;
@@ -206,6 +207,7 @@ public class HdmiCecLocalDeviceAudioSystemTest {
                4, HdmiPortInfo.PORT_INPUT, HDMI_3_PHYSICAL_ADDRESS, true, false, false);
        mNativeWrapper.setPortInfo(mHdmiPortInfo);
        mHdmiControlService.initService();
        mHdmiControlService.onBootPhase(PHASE_SYSTEM_SERVICES_READY);
        mPowerManager = new FakePowerManagerWrapper(context);
        mHdmiControlService.setPowerManager(mPowerManager);
        // No TV device interacts with AVR so system audio control won't be turned on here