Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fadfe708 authored by Jinsuk Kim's avatar Jinsuk Kim Committed by Android (Google) Code Review
Browse files

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

parents cc4f1830 1481a428
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -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);
}
+1 −1
Original line number Diff line number Diff line
@@ -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;
+2 −2
Original line number Diff line number Diff line
@@ -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
+6 −6
Original line number Diff line number Diff line
@@ -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 },
};