Merge "Exit dream mode on CEC wake message received" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
a31ca4d9d6
@@ -262,18 +262,6 @@ public class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource {
|
|||||||
return super.handleUserControlPressed(message);
|
return super.handleUserControlPressed(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void wakeUpIfActiveSource() {
|
|
||||||
if (!isActiveSource()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
// Wake up the device if the power is in standby mode, or its screen is off -
|
|
||||||
// which can happen if the device is holding a partial lock.
|
|
||||||
if (mService.isPowerStandbyOrTransient() || !mService.getPowerManager().isScreenOn()) {
|
|
||||||
mService.wakeUp();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ServiceThreadOnly
|
@ServiceThreadOnly
|
||||||
@Constants.HandleMessageResult
|
@Constants.HandleMessageResult
|
||||||
protected int handleSetMenuLanguage(HdmiCecMessage message) {
|
protected int handleSetMenuLanguage(HdmiCecMessage message) {
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ abstract class HdmiCecLocalDeviceSource extends HdmiCecLocalDevice {
|
|||||||
if (!isActiveSource()) {
|
if (!isActiveSource()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Wake up the device
|
// Wake up the device. This will also exit dream mode.
|
||||||
mService.wakeUp();
|
mService.wakeUp();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3030,6 +3030,7 @@ public class HdmiControlService extends SystemService {
|
|||||||
@ServiceThreadOnly
|
@ServiceThreadOnly
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
protected void onStandby(final int standbyAction) {
|
protected void onStandby(final int standbyAction) {
|
||||||
|
mWakeUpMessageReceived = false;
|
||||||
assertRunOnServiceThread();
|
assertRunOnServiceThread();
|
||||||
mPowerStatusController.setPowerStatus(HdmiControlManager.POWER_STATUS_TRANSIENT_TO_STANDBY,
|
mPowerStatusController.setPowerStatus(HdmiControlManager.POWER_STATUS_TRANSIENT_TO_STANDBY,
|
||||||
false);
|
false);
|
||||||
|
|||||||
@@ -136,6 +136,11 @@ public class HdmiCecLocalDevicePlaybackTest {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
boolean isPowerStandbyOrTransient() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected PowerManager getPowerManager() {
|
protected PowerManager getPowerManager() {
|
||||||
return new PowerManager(context, mIPowerManagerMock,
|
return new PowerManager(context, mIPowerManagerMock,
|
||||||
@@ -1334,6 +1339,22 @@ public class HdmiCecLocalDevicePlaybackTest {
|
|||||||
assertThat(mHdmiCecLocalDevicePlayback.isActiveSource()).isTrue();
|
assertThat(mHdmiCecLocalDevicePlayback.isActiveSource()).isTrue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void handleSetStreamPath_Dreaming() throws RemoteException {
|
||||||
|
when(mIPowerManagerMock.isInteractive()).thenReturn(true);
|
||||||
|
|
||||||
|
mWokenUp = false;
|
||||||
|
|
||||||
|
HdmiCecMessage message =
|
||||||
|
HdmiCecMessageBuilder.buildSetStreamPath(ADDR_TV,
|
||||||
|
mPlaybackPhysicalAddress);
|
||||||
|
|
||||||
|
assertThat(mHdmiCecLocalDevicePlayback.handleSetStreamPath(message))
|
||||||
|
.isEqualTo(Constants.HANDLED);
|
||||||
|
mTestLooper.dispatchAll();
|
||||||
|
assertThat(mWokenUp).isTrue();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void handleSetStreamPath_otherDevice_None() {
|
public void handleSetStreamPath_otherDevice_None() {
|
||||||
mHdmiCecLocalDevicePlayback.mService.getHdmiCecConfig().setStringValue(
|
mHdmiCecLocalDevicePlayback.mService.getHdmiCecConfig().setStringValue(
|
||||||
|
|||||||
Reference in New Issue
Block a user