/**
* Configure ARC circuit in the hardware logic to start or stop the feature.
*
+ * @param port ID of HDMI port to which AVR is connected
* @param enabled whether to enable/disable ARC
*/
@ServiceThreadOnly
- void setAudioReturnChannel(boolean enabled) {
+ void setAudioReturnChannel(int port, boolean enabled) {
assertRunOnServiceThread();
- nativeSetAudioReturnChannel(mNativePtr, enabled);
+ nativeSetAudioReturnChannel(mNativePtr, port, enabled);
}
/**
private static native int nativeGetVendorId(long controllerPtr);
private static native HdmiPortInfo[] nativeGetPortInfos(long controllerPtr);
private static native void nativeSetOption(long controllerPtr, int flag, int value);
- private static native void nativeSetAudioReturnChannel(long controllerPtr, boolean flag);
+ private static native void nativeSetAudioReturnChannel(long controllerPtr, int port, boolean flag);
private static native boolean nativeIsConnected(long controllerPtr, int port);
}
HdmiLogger.debug("Set Arc Status[old:%b new:%b]", mArcEstablished, enabled);
boolean oldStatus = mArcEstablished;
// 1. Enable/disable ARC circuit.
- mService.setAudioReturnChannel(enabled);
+ mService.setAudioReturnChannel(getAvrDeviceInfo().getPortId(), enabled);
// 2. Notify arc status to audio service.
notifyArcStatusToAudioService(enabled);
// 3. Update arc status;
// Set a flag and its value.
void setOption(int flag, int value);
// Set audio return channel status.
- void setAudioReturnChannel(bool flag);
+ void setAudioReturnChannel(int port, bool flag);
// Whether to hdmi device is connected to the given port.
bool isConnected(int port);
}
// Set audio return channel status.
-void HdmiCecController::setAudioReturnChannel(bool enabled) {
- mDevice->set_audio_return_channel(mDevice, enabled ? 1 : 0);
+ void HdmiCecController::setAudioReturnChannel(int port, bool enabled) {
+ mDevice->set_audio_return_channel(mDevice, port, enabled ? 1 : 0);
}
// Whether to hdmi device is connected to the given port.
}
static void nativeSetAudioReturnChannel(JNIEnv* env, jclass clazz, jlong controllerPtr,
- jboolean enabled) {
+ jint port, jboolean enabled) {
HdmiCecController* controller = reinterpret_cast<HdmiCecController*>(controllerPtr);
- controller->setAudioReturnChannel(enabled == JNI_TRUE);
+ controller->setAudioReturnChannel(port, enabled == JNI_TRUE);
}
static jboolean nativeIsConnected(JNIEnv* env, jclass clazz, jlong controllerPtr, jint port) {
"(J)[Landroid/hardware/hdmi/HdmiPortInfo;",
(void *) nativeGetPortInfos },
{ "nativeSetOption", "(JII)V", (void *) nativeSetOption },
- { "nativeSetAudioReturnChannel", "(JZ)V", (void *) nativeSetAudioReturnChannel },
+ { "nativeSetAudioReturnChannel", "(JIZ)V", (void *) nativeSetAudioReturnChannel },
{ "nativeIsConnected", "(JI)Z", (void *) nativeIsConnected },
};