Loading core/java/android/provider/Settings.java +1 −11 Original line number Diff line number Diff line Loading @@ -9369,8 +9369,7 @@ public final class Settings { "hdmi_control_auto_wakeup_enabled"; /** * Whether TV or Audio System will also turn off other CEC devices when it goes to standby * mode. * Whether TV will also turn off other CEC devices when it goes to standby mode. * (0 = false, 1 = true) * * @hide Loading @@ -9378,15 +9377,6 @@ public final class Settings { public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = "hdmi_control_auto_device_off_enabled"; /** * Whether Audio System will also turn off TV when it goes to standby mode. * (0 = false, 1 = true) * * @hide */ public static final String HDMI_CONTROL_AUTO_TV_OFF_ENABLED = "hdmi_control_auto_tv_off_enabled"; /** * If <b>true</b>, enables out-of-the-box execution for priv apps. * Default: false Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +0 −38 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.media.AudioManager; import android.media.AudioSystem; import android.media.tv.TvContract; import android.os.SystemProperties; import android.provider.Settings.Global; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -55,11 +54,6 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { private boolean mTvSystemAudioModeSupport; // Whether the auido system will turn TV off when it's powering off private boolean mAutoTvOff; // Whether the auido system will broadcast standby to the system when it's powering off private boolean mAutoDeviceOff; // Whether ARC is available or not. "true" means that ARC is established between TV and // AVR as audio receiver. @ServiceThreadOnly private boolean mArcEstablished = false; Loading @@ -81,10 +75,6 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { // TODO(amyjojo) make System Audio Control controllable by users /*mSystemAudioControlFeatureEnabled = mService.readBooleanSetting(Global.HDMI_SYSTEM_AUDIO_CONTROL_ENABLED, true);*/ mAutoDeviceOff = mService.readBooleanSetting( Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED, true); mAutoTvOff = mService.readBooleanSetting( Global.HDMI_CONTROL_AUTO_TV_OFF_ENABLED, true); // TODO(amyjojo): make the map ro property. mTvInputs.put(Constants.CEC_SWITCH_HDMI1, "com.droidlogic.tvinput/.services.Hdmi1InputService/HW5"); Loading @@ -106,21 +96,6 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { mSystemAudioActivated ? "true" : "false"); } terminateSystemAudioMode(); HdmiLogger.debug(TAG + " onStandby, initiatedByCec:" + initiatedByCec + ", mAutoDeviceOff: " + mAutoDeviceOff + ", mAutoTvOff: " + mAutoTvOff); if (!mService.isControlEnabled() || initiatedByCec) { return; } if (mAutoDeviceOff) { mService.sendCecCommand( HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_BROADCAST)); } else if (mAutoTvOff) { mService.sendCecCommand( HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_TV)); } return; } @Override Loading Loading @@ -594,19 +569,6 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { } } @ServiceThreadOnly protected void setAutoTvOff(boolean autoTvOff) { assertRunOnServiceThread(); mAutoTvOff = autoTvOff; } @Override @ServiceThreadOnly void setAutoDeviceOff(boolean autoDeviceOff) { assertRunOnServiceThread(); mAutoDeviceOff = autoDeviceOff; } @Override protected void switchInputOnReceivingNewActivePath(int physicalAddress) { int port = getLocalPortFromPhysicalAddress(physicalAddress); Loading services/core/java/com/android/server/hdmi/HdmiControlService.java +0 −5 Original line number Diff line number Diff line Loading @@ -596,11 +596,6 @@ public class HdmiControlService extends SystemService { } // No need to propagate to HAL. break; case Global.HDMI_CONTROL_AUTO_TV_OFF_ENABLED: if (isAudioSystemDevice()) { audioSystem().setAutoTvOff(enabled); } break; case Global.HDMI_SYSTEM_AUDIO_CONTROL_ENABLED: if (isTvDeviceEnabled()) { tv().setSystemAudioControlFeatureEnabled(enabled); Loading services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java +0 −18 Original line number Diff line number Diff line Loading @@ -126,11 +126,6 @@ public class HdmiCecLocalDeviceAudioSystemTest { @Override void wakeUp() {} @Override boolean isControlEnabled() { return true; } }; mMyLooper = mTestLooper.getLooper(); Loading Loading @@ -297,8 +292,6 @@ public class HdmiCecLocalDeviceAudioSystemTest { @Test public void onStandbyAudioSystem_currentSystemAudioControlOn() throws Exception { mHdmiCecLocalDeviceAudioSystem.setAutoDeviceOff(false); mHdmiCecLocalDeviceAudioSystem.setAutoTvOff(false); // Set system audio control on first mHdmiCecLocalDeviceAudioSystem.checkSupportAndSetSystemAudioMode(true); // Check if standby correctly turns off the feature Loading Loading @@ -518,17 +511,6 @@ public class HdmiCecLocalDeviceAudioSystemTest { assertThat(mNativeWrapper.getOnlyResultMessage()).isEqualTo(expectedMessage); } @Test public void onStandby_setAutoDeviceOff_true() throws Exception { HdmiCecMessage expectedMessage = HdmiCecMessageBuilder.buildStandby(ADDR_AUDIO_SYSTEM, ADDR_BROADCAST); mHdmiCecLocalDeviceAudioSystem.setAutoDeviceOff(true); mHdmiCecLocalDeviceAudioSystem.onStandby(false, STANDBY_SCREEN_OFF); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getOnlyResultMessage()).isEqualTo(expectedMessage); } public void handleSystemAudioModeRequest_fromNonTV_tVNotSupport() { HdmiCecMessage message = HdmiCecMessageBuilder.buildSystemAudioModeRequest( Loading Loading
core/java/android/provider/Settings.java +1 −11 Original line number Diff line number Diff line Loading @@ -9369,8 +9369,7 @@ public final class Settings { "hdmi_control_auto_wakeup_enabled"; /** * Whether TV or Audio System will also turn off other CEC devices when it goes to standby * mode. * Whether TV will also turn off other CEC devices when it goes to standby mode. * (0 = false, 1 = true) * * @hide Loading @@ -9378,15 +9377,6 @@ public final class Settings { public static final String HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED = "hdmi_control_auto_device_off_enabled"; /** * Whether Audio System will also turn off TV when it goes to standby mode. * (0 = false, 1 = true) * * @hide */ public static final String HDMI_CONTROL_AUTO_TV_OFF_ENABLED = "hdmi_control_auto_tv_off_enabled"; /** * If <b>true</b>, enables out-of-the-box execution for priv apps. * Default: false Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +0 −38 Original line number Diff line number Diff line Loading @@ -27,7 +27,6 @@ import android.media.AudioManager; import android.media.AudioSystem; import android.media.tv.TvContract; import android.os.SystemProperties; import android.provider.Settings.Global; import com.android.internal.annotations.GuardedBy; import com.android.internal.annotations.VisibleForTesting; Loading Loading @@ -55,11 +54,6 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { private boolean mTvSystemAudioModeSupport; // Whether the auido system will turn TV off when it's powering off private boolean mAutoTvOff; // Whether the auido system will broadcast standby to the system when it's powering off private boolean mAutoDeviceOff; // Whether ARC is available or not. "true" means that ARC is established between TV and // AVR as audio receiver. @ServiceThreadOnly private boolean mArcEstablished = false; Loading @@ -81,10 +75,6 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { // TODO(amyjojo) make System Audio Control controllable by users /*mSystemAudioControlFeatureEnabled = mService.readBooleanSetting(Global.HDMI_SYSTEM_AUDIO_CONTROL_ENABLED, true);*/ mAutoDeviceOff = mService.readBooleanSetting( Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED, true); mAutoTvOff = mService.readBooleanSetting( Global.HDMI_CONTROL_AUTO_TV_OFF_ENABLED, true); // TODO(amyjojo): make the map ro property. mTvInputs.put(Constants.CEC_SWITCH_HDMI1, "com.droidlogic.tvinput/.services.Hdmi1InputService/HW5"); Loading @@ -106,21 +96,6 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { mSystemAudioActivated ? "true" : "false"); } terminateSystemAudioMode(); HdmiLogger.debug(TAG + " onStandby, initiatedByCec:" + initiatedByCec + ", mAutoDeviceOff: " + mAutoDeviceOff + ", mAutoTvOff: " + mAutoTvOff); if (!mService.isControlEnabled() || initiatedByCec) { return; } if (mAutoDeviceOff) { mService.sendCecCommand( HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_BROADCAST)); } else if (mAutoTvOff) { mService.sendCecCommand( HdmiCecMessageBuilder.buildStandby(mAddress, Constants.ADDR_TV)); } return; } @Override Loading Loading @@ -594,19 +569,6 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { } } @ServiceThreadOnly protected void setAutoTvOff(boolean autoTvOff) { assertRunOnServiceThread(); mAutoTvOff = autoTvOff; } @Override @ServiceThreadOnly void setAutoDeviceOff(boolean autoDeviceOff) { assertRunOnServiceThread(); mAutoDeviceOff = autoDeviceOff; } @Override protected void switchInputOnReceivingNewActivePath(int physicalAddress) { int port = getLocalPortFromPhysicalAddress(physicalAddress); Loading
services/core/java/com/android/server/hdmi/HdmiControlService.java +0 −5 Original line number Diff line number Diff line Loading @@ -596,11 +596,6 @@ public class HdmiControlService extends SystemService { } // No need to propagate to HAL. break; case Global.HDMI_CONTROL_AUTO_TV_OFF_ENABLED: if (isAudioSystemDevice()) { audioSystem().setAutoTvOff(enabled); } break; case Global.HDMI_SYSTEM_AUDIO_CONTROL_ENABLED: if (isTvDeviceEnabled()) { tv().setSystemAudioControlFeatureEnabled(enabled); Loading
services/tests/servicestests/src/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystemTest.java +0 −18 Original line number Diff line number Diff line Loading @@ -126,11 +126,6 @@ public class HdmiCecLocalDeviceAudioSystemTest { @Override void wakeUp() {} @Override boolean isControlEnabled() { return true; } }; mMyLooper = mTestLooper.getLooper(); Loading Loading @@ -297,8 +292,6 @@ public class HdmiCecLocalDeviceAudioSystemTest { @Test public void onStandbyAudioSystem_currentSystemAudioControlOn() throws Exception { mHdmiCecLocalDeviceAudioSystem.setAutoDeviceOff(false); mHdmiCecLocalDeviceAudioSystem.setAutoTvOff(false); // Set system audio control on first mHdmiCecLocalDeviceAudioSystem.checkSupportAndSetSystemAudioMode(true); // Check if standby correctly turns off the feature Loading Loading @@ -518,17 +511,6 @@ public class HdmiCecLocalDeviceAudioSystemTest { assertThat(mNativeWrapper.getOnlyResultMessage()).isEqualTo(expectedMessage); } @Test public void onStandby_setAutoDeviceOff_true() throws Exception { HdmiCecMessage expectedMessage = HdmiCecMessageBuilder.buildStandby(ADDR_AUDIO_SYSTEM, ADDR_BROADCAST); mHdmiCecLocalDeviceAudioSystem.setAutoDeviceOff(true); mHdmiCecLocalDeviceAudioSystem.onStandby(false, STANDBY_SCREEN_OFF); mTestLooper.dispatchAll(); assertThat(mNativeWrapper.getOnlyResultMessage()).isEqualTo(expectedMessage); } public void handleSystemAudioModeRequest_fromNonTV_tVNotSupport() { HdmiCecMessage message = HdmiCecMessageBuilder.buildSystemAudioModeRequest( Loading