am fadfe708: Merge "CEC: Pass port ID for set_audio_return_channel" into lmp-mr1-dev

* commit 'fadfe708e6f0c74890fe2b3292a91570f3049215':
  CEC: Pass port ID for set_audio_return_channel
This commit is contained in:
Jinsuk Kim
2014-12-17 21:20:08 +00:00
committed by Android Git Automerger
4 changed files with 13 additions and 12 deletions

View File

@@ -331,12 +331,13 @@ final class HdmiCecController {
/**
* 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);
}
/**
@@ -633,6 +634,6 @@ final class HdmiCecController {
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);
}

View File

@@ -827,7 +827,7 @@ final class HdmiCecLocalDeviceTv extends HdmiCecLocalDevice {
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;

View File

@@ -756,8 +756,8 @@ public final class HdmiControlService extends SystemService {
return dispatchMessageToLocalDevice(message);
}
void setAudioReturnChannel(boolean enabled) {
mCecController.setAudioReturnChannel(enabled);
void setAudioReturnChannel(int portId, boolean enabled) {
mCecController.setAudioReturnChannel(portId, enabled);
}
@ServiceThreadOnly

View File

@@ -62,7 +62,7 @@ public:
// 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);
@@ -260,8 +260,8 @@ void HdmiCecController::setOption(int flag, int value) {
}
// 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.
@@ -374,9 +374,9 @@ static void nativeSetOption(JNIEnv* env, jclass clazz, jlong controllerPtr, jint
}
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) {
@@ -399,7 +399,7 @@ static JNINativeMethod sMethods[] = {
"(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 },
};