Merge "CEC: Pass port ID for set_audio_return_channel" into lmp-mr1-dev
This commit is contained in:
@@ -331,12 +331,13 @@ final class HdmiCecController {
|
|||||||
/**
|
/**
|
||||||
* Configure ARC circuit in the hardware logic to start or stop the feature.
|
* 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
|
* @param enabled whether to enable/disable ARC
|
||||||
*/
|
*/
|
||||||
@ServiceThreadOnly
|
@ServiceThreadOnly
|
||||||
void setAudioReturnChannel(boolean enabled) {
|
void setAudioReturnChannel(int port, boolean enabled) {
|
||||||
assertRunOnServiceThread();
|
assertRunOnServiceThread();
|
||||||
nativeSetAudioReturnChannel(mNativePtr, enabled);
|
nativeSetAudioReturnChannel(mNativePtr, port, enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -633,6 +634,6 @@ final class HdmiCecController {
|
|||||||
private static native int nativeGetVendorId(long controllerPtr);
|
private static native int nativeGetVendorId(long controllerPtr);
|
||||||
private static native HdmiPortInfo[] nativeGetPortInfos(long controllerPtr);
|
private static native HdmiPortInfo[] nativeGetPortInfos(long controllerPtr);
|
||||||
private static native void nativeSetOption(long controllerPtr, int flag, int value);
|
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);
|
private static native boolean nativeIsConnected(long controllerPtr, int port);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -827,7 +827,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
|
|||||||
HdmiLogger.debug("Set Arc Status[old:%b new:%b]", mArcEstablished, enabled);
|
HdmiLogger.debug("Set Arc Status[old:%b new:%b]", mArcEstablished, enabled);
|
||||||
boolean oldStatus = mArcEstablished;
|
boolean oldStatus = mArcEstablished;
|
||||||
// 1. Enable/disable ARC circuit.
|
// 1. Enable/disable ARC circuit.
|
||||||
mService.setAudioReturnChannel(enabled);
|
mService.setAudioReturnChannel(getAvrDeviceInfo().getPortId(), enabled);
|
||||||
// 2. Notify arc status to audio service.
|
// 2. Notify arc status to audio service.
|
||||||
notifyArcStatusToAudioService(enabled);
|
notifyArcStatusToAudioService(enabled);
|
||||||
// 3. Update arc status;
|
// 3. Update arc status;
|
||||||
|
|||||||
@@ -756,8 +756,8 @@ public final class HdmiControlService extends SystemService {
|
|||||||
return dispatchMessageToLocalDevice(message);
|
return dispatchMessageToLocalDevice(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setAudioReturnChannel(boolean enabled) {
|
void setAudioReturnChannel(int portId, boolean enabled) {
|
||||||
mCecController.setAudioReturnChannel(enabled);
|
mCecController.setAudioReturnChannel(portId, enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ServiceThreadOnly
|
@ServiceThreadOnly
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public:
|
|||||||
// Set a flag and its value.
|
// Set a flag and its value.
|
||||||
void setOption(int flag, int value);
|
void setOption(int flag, int value);
|
||||||
// Set audio return channel status.
|
// 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.
|
// Whether to hdmi device is connected to the given port.
|
||||||
bool isConnected(int port);
|
bool isConnected(int port);
|
||||||
|
|
||||||
@@ -260,8 +260,8 @@ void HdmiCecController::setOption(int flag, int value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set audio return channel status.
|
// Set audio return channel status.
|
||||||
void HdmiCecController::setAudioReturnChannel(bool enabled) {
|
void HdmiCecController::setAudioReturnChannel(int port, bool enabled) {
|
||||||
mDevice->set_audio_return_channel(mDevice, enabled ? 1 : 0);
|
mDevice->set_audio_return_channel(mDevice, port, enabled ? 1 : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Whether to hdmi device is connected to the given port.
|
// Whether to hdmi device is connected to the given port.
|
||||||
@@ -374,9 +374,9 @@ static void nativeSetOption(JNIEnv* env, jclass clazz, jlong controllerPtr, jint
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void nativeSetAudioReturnChannel(JNIEnv* env, jclass clazz, jlong controllerPtr,
|
static void nativeSetAudioReturnChannel(JNIEnv* env, jclass clazz, jlong controllerPtr,
|
||||||
jboolean enabled) {
|
jint port, jboolean enabled) {
|
||||||
HdmiCecController* controller = reinterpret_cast<HdmiCecController*>(controllerPtr);
|
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) {
|
static jboolean nativeIsConnected(JNIEnv* env, jclass clazz, jlong controllerPtr, jint port) {
|
||||||
@@ -399,7 +399,7 @@ static JNINativeMethod sMethods[] = {
|
|||||||
"(J)[Landroid/hardware/hdmi/HdmiPortInfo;",
|
"(J)[Landroid/hardware/hdmi/HdmiPortInfo;",
|
||||||
(void *) nativeGetPortInfos },
|
(void *) nativeGetPortInfos },
|
||||||
{ "nativeSetOption", "(JII)V", (void *) nativeSetOption },
|
{ "nativeSetOption", "(JII)V", (void *) nativeSetOption },
|
||||||
{ "nativeSetAudioReturnChannel", "(JZ)V", (void *) nativeSetAudioReturnChannel },
|
{ "nativeSetAudioReturnChannel", "(JIZ)V", (void *) nativeSetAudioReturnChannel },
|
||||||
{ "nativeIsConnected", "(JI)Z", (void *) nativeIsConnected },
|
{ "nativeIsConnected", "(JI)Z", (void *) nativeIsConnected },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user