Merge "HDMICEC: Add setarc shell command" am: 565f3fe51c am: 4f7105a12b am: 585a63abbe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1572280 Change-Id: I053a618940d426b89151165ab1a4f17432551ec9
This commit is contained in:
@@ -90,6 +90,8 @@ final class HdmiControlShellCommand extends ShellCommand {
|
||||
pw.println(" Set the value of a CEC setting");
|
||||
pw.println(" setsystemaudiomode, setsam [on|off]");
|
||||
pw.println(" Sets the System Audio Mode feature on or off on TV devices");
|
||||
pw.println(" setarc [on|off]");
|
||||
pw.println(" Sets the ARC feature on or off on TV devices");
|
||||
}
|
||||
|
||||
private int handleShellCommand(String cmd) throws RemoteException {
|
||||
@@ -106,6 +108,8 @@ final class HdmiControlShellCommand extends ShellCommand {
|
||||
case "setsystemaudiomode":
|
||||
case "setsam":
|
||||
return setSystemAudioMode(pw);
|
||||
case "setarc":
|
||||
return setArcMode(pw);
|
||||
}
|
||||
|
||||
getErrPrintWriter().println("Unhandled command: " + cmd);
|
||||
@@ -229,6 +233,27 @@ final class HdmiControlShellCommand extends ShellCommand {
|
||||
return mCecResult.get() == HdmiControlManager.RESULT_SUCCESS ? 0 : 1;
|
||||
}
|
||||
|
||||
private int setArcMode(PrintWriter pw) throws RemoteException {
|
||||
if (1 > getRemainingArgsCount()) {
|
||||
throw new IllegalArgumentException(
|
||||
"Please indicate if ARC mode should be turned \"on\" or \"off\".");
|
||||
}
|
||||
|
||||
String arg = getNextArg();
|
||||
if (arg.equals("on")) {
|
||||
pw.println("Setting ARC mode on");
|
||||
mBinderService.setArcMode(true);
|
||||
} else if (arg.equals("off")) {
|
||||
pw.println("Setting ARC mode off");
|
||||
mBinderService.setArcMode(false);
|
||||
} else {
|
||||
throw new IllegalArgumentException(
|
||||
"Please indicate if ARC mode should be turned \"on\" or \"off\".");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private boolean receiveCallback(String command) {
|
||||
try {
|
||||
if (!mLatch.await(HdmiConfig.TIMEOUT_MS, TimeUnit.MILLISECONDS)) {
|
||||
|
||||
Reference in New Issue
Block a user