Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java +7 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,8 @@ abstract class HdmiCecLocalDevice { protected int mLastKeycode = HdmiCecKeycode.UNSUPPORTED_KEYCODE; protected int mLastKeyRepeatCount = 0; HdmiCecStandbyModeHandler mStandbyHandler; // Stores recent changes to the active source in the CEC network. private final ArrayBlockingQueue<HdmiCecController.Dumpable> mActiveSourceHistory = new ArrayBlockingQueue<>(MAX_HDMI_ACTIVE_SOURCE_HISTORY); Loading Loading @@ -263,6 +265,11 @@ abstract class HdmiCecLocalDevice { if (dest != mAddress && dest != Constants.ADDR_BROADCAST) { return Constants.NOT_HANDLED; } if (mService.isPowerStandby() && !mService.isWakeUpMessageReceived() && mStandbyHandler.handleCommand(message)) { return Constants.HANDLED; } // Cache incoming message if it is included in the list of cacheable opcodes. mCecMessageCache.cacheMessage(message); return onMessage(message); Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +1 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { mService.readBooleanSetting(Global.HDMI_CEC_SWITCH_ENABLED, false); mSystemAudioControlFeatureEnabled = mService.readBooleanSetting(Global.HDMI_SYSTEM_AUDIO_CONTROL_ENABLED, true); mStandbyHandler = new HdmiCecStandbyModeHandler(service, this); } private static final String SHORT_AUDIO_DESCRIPTOR_CONFIG_PATH = "/vendor/etc/sadConfig.xml"; Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ public class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource { HdmiCecLocalDevicePlayback(HdmiControlService service) { super(service, HdmiDeviceInfo.DEVICE_PLAYBACK); mStandbyHandler = new HdmiCecStandbyModeHandler(service, this); } @Override Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +0 −2 Original line number Diff line number Diff line Loading @@ -91,8 +91,6 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { @GuardedBy("mLock") private boolean mSystemAudioMute = false; private final HdmiCecStandbyModeHandler mStandbyHandler; // If true, do not do routing control/send active source for internal source. // Set to true when the device was woken up by <Text/Image View On>. private boolean mSkipRoutingControl; Loading services/core/java/com/android/server/hdmi/HdmiCecStandbyModeHandler.java +33 −22 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.hdmi; import android.hardware.hdmi.HdmiDeviceInfo; import android.util.SparseArray; /** Loading Loading @@ -56,7 +57,8 @@ public final class HdmiCecStandbyModeHandler { private final class AutoOnHandler implements CecMessageHandler { @Override public boolean handle(HdmiCecMessage message) { if (!mTv.getAutoWakeup()) { HdmiCecLocalDeviceTv tv = (HdmiCecLocalDeviceTv) mDevice; if (!tv.getAutoWakeup()) { mAborterRefused.handle(message); return true; } Loading @@ -78,7 +80,7 @@ public final class HdmiCecStandbyModeHandler { } private final HdmiControlService mService; private final HdmiCecLocalDeviceTv mTv; private final HdmiCecLocalDevice mDevice; private final SparseArray<CecMessageHandler> mCecMessageHandlers = new SparseArray<>(); private final CecMessageHandler mDefaultHandler = new Aborter( Loading @@ -92,13 +94,7 @@ public final class HdmiCecStandbyModeHandler { private final UserControlProcessedHandler mUserControlProcessedHandler = new UserControlProcessedHandler(); public HdmiCecStandbyModeHandler(HdmiControlService service, HdmiCecLocalDeviceTv tv) { mService = service; mTv = tv; addHandler(Constants.MESSAGE_IMAGE_VIEW_ON, mAutoOnHandler); addHandler(Constants.MESSAGE_TEXT_VIEW_ON, mAutoOnHandler); private void addCommonHandlers() { addHandler(Constants.MESSAGE_ACTIVE_SOURCE, mBystander); addHandler(Constants.MESSAGE_REQUEST_ACTIVE_SOURCE, mBystander); addHandler(Constants.MESSAGE_ROUTING_CHANGE, mBystander); Loading @@ -112,19 +108,6 @@ public final class HdmiCecStandbyModeHandler { addHandler(Constants.MESSAGE_SYSTEM_AUDIO_MODE_STATUS, mBystander); addHandler(Constants.MESSAGE_REPORT_AUDIO_STATUS, mBystander); // If TV supports the following messages during power-on, ignore them and do nothing, // else reply with <Feature Abort>["Unrecognized Opcode"] // <Deck Status>, <Tuner Device Status>, <Tuner Cleared Status>, <Timer Status> addHandler(Constants.MESSAGE_RECORD_STATUS, mBystander); // If TV supports the following messages during power-on, reply with <Feature Abort>["Not // in correct mode to respond"], else reply with <Feature Abort>["Unrecognized Opcode"] // <Give Tuner Device Status>, <Select Digital Service>, <Tuner Step Decrement>, // <Tuner Stem Increment>, <Menu Status>. addHandler(Constants.MESSAGE_RECORD_TV_SCREEN, mAborterIncorrectMode); addHandler(Constants.MESSAGE_INITIATE_ARC, mAborterIncorrectMode); addHandler(Constants.MESSAGE_TERMINATE_ARC, mAborterIncorrectMode); addHandler(Constants.MESSAGE_GIVE_PHYSICAL_ADDRESS, mBypasser); addHandler(Constants.MESSAGE_GET_MENU_LANGUAGE, mBypasser); addHandler(Constants.MESSAGE_REPORT_PHYSICAL_ADDRESS, mBypasser); Loading @@ -145,6 +128,34 @@ public final class HdmiCecStandbyModeHandler { addHandler(Constants.MESSAGE_SET_SYSTEM_AUDIO_MODE, mAborterIncorrectMode); } private void addTvHandlers() { addHandler(Constants.MESSAGE_IMAGE_VIEW_ON, mAutoOnHandler); addHandler(Constants.MESSAGE_TEXT_VIEW_ON, mAutoOnHandler); // If TV supports the following messages during power-on, ignore them and do nothing, // else reply with <Feature Abort>["Unrecognized Opcode"] // <Deck Status>, <Tuner Device Status>, <Tuner Cleared Status>, <Timer Status> addHandler(Constants.MESSAGE_RECORD_STATUS, mBystander); // If TV supports the following messages during power-on, reply with <Feature Abort>["Not // in correct mode to respond"], else reply with <Feature Abort>["Unrecognized Opcode"] // <Give Tuner Device Status>, <Select Digital Service>, <Tuner Step Decrement>, // <Tuner Stem Increment>, <Menu Status>. addHandler(Constants.MESSAGE_RECORD_TV_SCREEN, mAborterIncorrectMode); addHandler(Constants.MESSAGE_INITIATE_ARC, mAborterIncorrectMode); addHandler(Constants.MESSAGE_TERMINATE_ARC, mAborterIncorrectMode); } public HdmiCecStandbyModeHandler(HdmiControlService service, HdmiCecLocalDevice device) { mService = service; mDevice = device; addCommonHandlers(); if (mDevice.getType() == HdmiDeviceInfo.DEVICE_TV) { addTvHandlers(); } } private void addHandler(int opcode, CecMessageHandler handler) { mCecMessageHandlers.put(opcode, handler); } Loading Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java +7 −0 Original line number Diff line number Diff line Loading @@ -75,6 +75,8 @@ abstract class HdmiCecLocalDevice { protected int mLastKeycode = HdmiCecKeycode.UNSUPPORTED_KEYCODE; protected int mLastKeyRepeatCount = 0; HdmiCecStandbyModeHandler mStandbyHandler; // Stores recent changes to the active source in the CEC network. private final ArrayBlockingQueue<HdmiCecController.Dumpable> mActiveSourceHistory = new ArrayBlockingQueue<>(MAX_HDMI_ACTIVE_SOURCE_HISTORY); Loading Loading @@ -263,6 +265,11 @@ abstract class HdmiCecLocalDevice { if (dest != mAddress && dest != Constants.ADDR_BROADCAST) { return Constants.NOT_HANDLED; } if (mService.isPowerStandby() && !mService.isWakeUpMessageReceived() && mStandbyHandler.handleCommand(message)) { return Constants.HANDLED; } // Cache incoming message if it is included in the list of cacheable opcodes. mCecMessageCache.cacheMessage(message); return onMessage(message); Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +1 −0 Original line number Diff line number Diff line Loading @@ -112,6 +112,7 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { mService.readBooleanSetting(Global.HDMI_CEC_SWITCH_ENABLED, false); mSystemAudioControlFeatureEnabled = mService.readBooleanSetting(Global.HDMI_SYSTEM_AUDIO_CONTROL_ENABLED, true); mStandbyHandler = new HdmiCecStandbyModeHandler(service, this); } private static final String SHORT_AUDIO_DESCRIPTOR_CONFIG_PATH = "/vendor/etc/sadConfig.xml"; Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDevicePlayback.java +1 −0 Original line number Diff line number Diff line Loading @@ -64,6 +64,7 @@ public class HdmiCecLocalDevicePlayback extends HdmiCecLocalDeviceSource { HdmiCecLocalDevicePlayback(HdmiControlService service) { super(service, HdmiDeviceInfo.DEVICE_PLAYBACK); mStandbyHandler = new HdmiCecStandbyModeHandler(service, this); } @Override Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceTv.java +0 −2 Original line number Diff line number Diff line Loading @@ -91,8 +91,6 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice { @GuardedBy("mLock") private boolean mSystemAudioMute = false; private final HdmiCecStandbyModeHandler mStandbyHandler; // If true, do not do routing control/send active source for internal source. // Set to true when the device was woken up by <Text/Image View On>. private boolean mSkipRoutingControl; Loading
services/core/java/com/android/server/hdmi/HdmiCecStandbyModeHandler.java +33 −22 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.server.hdmi; import android.hardware.hdmi.HdmiDeviceInfo; import android.util.SparseArray; /** Loading Loading @@ -56,7 +57,8 @@ public final class HdmiCecStandbyModeHandler { private final class AutoOnHandler implements CecMessageHandler { @Override public boolean handle(HdmiCecMessage message) { if (!mTv.getAutoWakeup()) { HdmiCecLocalDeviceTv tv = (HdmiCecLocalDeviceTv) mDevice; if (!tv.getAutoWakeup()) { mAborterRefused.handle(message); return true; } Loading @@ -78,7 +80,7 @@ public final class HdmiCecStandbyModeHandler { } private final HdmiControlService mService; private final HdmiCecLocalDeviceTv mTv; private final HdmiCecLocalDevice mDevice; private final SparseArray<CecMessageHandler> mCecMessageHandlers = new SparseArray<>(); private final CecMessageHandler mDefaultHandler = new Aborter( Loading @@ -92,13 +94,7 @@ public final class HdmiCecStandbyModeHandler { private final UserControlProcessedHandler mUserControlProcessedHandler = new UserControlProcessedHandler(); public HdmiCecStandbyModeHandler(HdmiControlService service, HdmiCecLocalDeviceTv tv) { mService = service; mTv = tv; addHandler(Constants.MESSAGE_IMAGE_VIEW_ON, mAutoOnHandler); addHandler(Constants.MESSAGE_TEXT_VIEW_ON, mAutoOnHandler); private void addCommonHandlers() { addHandler(Constants.MESSAGE_ACTIVE_SOURCE, mBystander); addHandler(Constants.MESSAGE_REQUEST_ACTIVE_SOURCE, mBystander); addHandler(Constants.MESSAGE_ROUTING_CHANGE, mBystander); Loading @@ -112,19 +108,6 @@ public final class HdmiCecStandbyModeHandler { addHandler(Constants.MESSAGE_SYSTEM_AUDIO_MODE_STATUS, mBystander); addHandler(Constants.MESSAGE_REPORT_AUDIO_STATUS, mBystander); // If TV supports the following messages during power-on, ignore them and do nothing, // else reply with <Feature Abort>["Unrecognized Opcode"] // <Deck Status>, <Tuner Device Status>, <Tuner Cleared Status>, <Timer Status> addHandler(Constants.MESSAGE_RECORD_STATUS, mBystander); // If TV supports the following messages during power-on, reply with <Feature Abort>["Not // in correct mode to respond"], else reply with <Feature Abort>["Unrecognized Opcode"] // <Give Tuner Device Status>, <Select Digital Service>, <Tuner Step Decrement>, // <Tuner Stem Increment>, <Menu Status>. addHandler(Constants.MESSAGE_RECORD_TV_SCREEN, mAborterIncorrectMode); addHandler(Constants.MESSAGE_INITIATE_ARC, mAborterIncorrectMode); addHandler(Constants.MESSAGE_TERMINATE_ARC, mAborterIncorrectMode); addHandler(Constants.MESSAGE_GIVE_PHYSICAL_ADDRESS, mBypasser); addHandler(Constants.MESSAGE_GET_MENU_LANGUAGE, mBypasser); addHandler(Constants.MESSAGE_REPORT_PHYSICAL_ADDRESS, mBypasser); Loading @@ -145,6 +128,34 @@ public final class HdmiCecStandbyModeHandler { addHandler(Constants.MESSAGE_SET_SYSTEM_AUDIO_MODE, mAborterIncorrectMode); } private void addTvHandlers() { addHandler(Constants.MESSAGE_IMAGE_VIEW_ON, mAutoOnHandler); addHandler(Constants.MESSAGE_TEXT_VIEW_ON, mAutoOnHandler); // If TV supports the following messages during power-on, ignore them and do nothing, // else reply with <Feature Abort>["Unrecognized Opcode"] // <Deck Status>, <Tuner Device Status>, <Tuner Cleared Status>, <Timer Status> addHandler(Constants.MESSAGE_RECORD_STATUS, mBystander); // If TV supports the following messages during power-on, reply with <Feature Abort>["Not // in correct mode to respond"], else reply with <Feature Abort>["Unrecognized Opcode"] // <Give Tuner Device Status>, <Select Digital Service>, <Tuner Step Decrement>, // <Tuner Stem Increment>, <Menu Status>. addHandler(Constants.MESSAGE_RECORD_TV_SCREEN, mAborterIncorrectMode); addHandler(Constants.MESSAGE_INITIATE_ARC, mAborterIncorrectMode); addHandler(Constants.MESSAGE_TERMINATE_ARC, mAborterIncorrectMode); } public HdmiCecStandbyModeHandler(HdmiControlService service, HdmiCecLocalDevice device) { mService = service; mDevice = device; addCommonHandlers(); if (mDevice.getType() == HdmiDeviceInfo.DEVICE_TV) { addTvHandlers(); } } private void addHandler(int opcode, CecMessageHandler handler) { mCecMessageHandlers.put(opcode, handler); } Loading