Loading services/core/java/com/android/server/hdmi/DevicePowerStatusAction.java +2 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,8 @@ final class DevicePowerStatusAction extends HdmiCecFeatureAction { @Override boolean processCommand(HdmiCecMessage cmd) { if (mState != STATE_WAITING_FOR_REPORT_POWER_STATUS) { if (mState != STATE_WAITING_FOR_REPORT_POWER_STATUS || mTargetAddress != cmd.getSource()) { return false; } if (cmd.getOpcode() == Constants.MESSAGE_REPORT_POWER_STATUS) { Loading services/core/java/com/android/server/hdmi/DeviceSelectAction.java +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ final class DeviceSelectAction extends HdmiCecFeatureAction { sendCommand(mGivePowerStatus, new SendMessageCallback() { @Override public void onSendCompleted(int error) { if (error == Constants.SEND_RESULT_NAK) { if (error != Constants.SEND_RESULT_SUCCESS) { invokeCallback(HdmiControlManager.RESULT_COMMUNICATION_FAILED); finish(); return; Loading services/core/java/com/android/server/hdmi/HdmiCecFeatureAction.java +1 −2 Original line number Diff line number Diff line Loading @@ -84,8 +84,7 @@ abstract class HdmiCecFeatureAction { * Process the command. Called whenever a new command arrives. * * @param cmd command to process * @return true if the command was consumed in the process; Otherwise false, which * indicates that the command shall be handled by other actions. * @return true if the command was consumed in the process; Otherwise false. */ abstract boolean processCommand(HdmiCecMessage cmd); Loading services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java +9 −8 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ import com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.List; /** Loading Loading @@ -125,7 +124,7 @@ abstract class HdmiCecLocalDevice { // A collection of FeatureAction. // Note that access to this collection should happen in service thread. private final LinkedList<HdmiCecFeatureAction> mActions = new LinkedList<>(); private final ArrayList<HdmiCecFeatureAction> mActions = new ArrayList<>(); private final Handler mHandler = new Handler () { @Override Loading Loading @@ -290,12 +289,14 @@ abstract class HdmiCecLocalDevice { @ServiceThreadOnly private boolean dispatchMessageToAction(HdmiCecMessage message) { assertRunOnServiceThread(); for (HdmiCecFeatureAction action : mActions) { if (action.processCommand(message)) { return true; } } return false; boolean processed = false; // Use copied action list in that processCommand may remove itself. for (HdmiCecFeatureAction action : new ArrayList<>(mActions)) { // Iterates all actions to check whether incoming message is consumed. boolean result = action.processCommand(message); processed = processed || result; } return processed; } @ServiceThreadOnly Loading services/core/java/com/android/server/hdmi/OneTouchPlayAction.java +2 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,8 @@ final class OneTouchPlayAction extends HdmiCecFeatureAction { @Override boolean processCommand(HdmiCecMessage cmd) { if (mState != STATE_WAITING_FOR_REPORT_POWER_STATUS) { if (mState != STATE_WAITING_FOR_REPORT_POWER_STATUS || mTargetAddress != cmd.getSource()) { return false; } if (cmd.getOpcode() == Constants.MESSAGE_REPORT_POWER_STATUS) { Loading Loading
services/core/java/com/android/server/hdmi/DevicePowerStatusAction.java +2 −1 Original line number Diff line number Diff line Loading @@ -70,7 +70,8 @@ final class DevicePowerStatusAction extends HdmiCecFeatureAction { @Override boolean processCommand(HdmiCecMessage cmd) { if (mState != STATE_WAITING_FOR_REPORT_POWER_STATUS) { if (mState != STATE_WAITING_FOR_REPORT_POWER_STATUS || mTargetAddress != cmd.getSource()) { return false; } if (cmd.getOpcode() == Constants.MESSAGE_REPORT_POWER_STATUS) { Loading
services/core/java/com/android/server/hdmi/DeviceSelectAction.java +1 −1 Original line number Diff line number Diff line Loading @@ -95,7 +95,7 @@ final class DeviceSelectAction extends HdmiCecFeatureAction { sendCommand(mGivePowerStatus, new SendMessageCallback() { @Override public void onSendCompleted(int error) { if (error == Constants.SEND_RESULT_NAK) { if (error != Constants.SEND_RESULT_SUCCESS) { invokeCallback(HdmiControlManager.RESULT_COMMUNICATION_FAILED); finish(); return; Loading
services/core/java/com/android/server/hdmi/HdmiCecFeatureAction.java +1 −2 Original line number Diff line number Diff line Loading @@ -84,8 +84,7 @@ abstract class HdmiCecFeatureAction { * Process the command. Called whenever a new command arrives. * * @param cmd command to process * @return true if the command was consumed in the process; Otherwise false, which * indicates that the command shall be handled by other actions. * @return true if the command was consumed in the process; Otherwise false. */ abstract boolean processCommand(HdmiCecMessage cmd); Loading
services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java +9 −8 Original line number Diff line number Diff line Loading @@ -34,7 +34,6 @@ import com.android.server.hdmi.HdmiAnnotations.ServiceThreadOnly; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.LinkedList; import java.util.List; /** Loading Loading @@ -125,7 +124,7 @@ abstract class HdmiCecLocalDevice { // A collection of FeatureAction. // Note that access to this collection should happen in service thread. private final LinkedList<HdmiCecFeatureAction> mActions = new LinkedList<>(); private final ArrayList<HdmiCecFeatureAction> mActions = new ArrayList<>(); private final Handler mHandler = new Handler () { @Override Loading Loading @@ -290,12 +289,14 @@ abstract class HdmiCecLocalDevice { @ServiceThreadOnly private boolean dispatchMessageToAction(HdmiCecMessage message) { assertRunOnServiceThread(); for (HdmiCecFeatureAction action : mActions) { if (action.processCommand(message)) { return true; } } return false; boolean processed = false; // Use copied action list in that processCommand may remove itself. for (HdmiCecFeatureAction action : new ArrayList<>(mActions)) { // Iterates all actions to check whether incoming message is consumed. boolean result = action.processCommand(message); processed = processed || result; } return processed; } @ServiceThreadOnly Loading
services/core/java/com/android/server/hdmi/OneTouchPlayAction.java +2 −1 Original line number Diff line number Diff line Loading @@ -92,7 +92,8 @@ final class OneTouchPlayAction extends HdmiCecFeatureAction { @Override boolean processCommand(HdmiCecMessage cmd) { if (mState != STATE_WAITING_FOR_REPORT_POWER_STATUS) { if (mState != STATE_WAITING_FOR_REPORT_POWER_STATUS || mTargetAddress != cmd.getSource()) { return false; } if (cmd.getOpcode() == Constants.MESSAGE_REPORT_POWER_STATUS) { Loading