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

Commit d321f932 authored by Mikhail Naganov's avatar Mikhail Naganov Committed by Android (Google) Code Review
Browse files

Merge "base: Add simulate device connection Java APIs" into main

parents 9c9d1d36 e08c6273
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -3428,6 +3428,11 @@ static jboolean android_media_AudioSystem_isBluetoothVariableLatencyEnabled(JNIE
    return enabled;
}

static int android_media_AudioSystem_setSimulateDeviceConnections(JNIEnv *env, jobject thiz,
                                                                  jboolean enabled) {
    return check_AudioSystem_Command(AudioSystem::setSimulateDeviceConnections(enabled));
}

class JavaSystemPropertyListener {
  public:
    JavaSystemPropertyListener(JNIEnv* env, jobject javaCallback, std::string sysPropName) :
@@ -3706,6 +3711,7 @@ static const JNINativeMethod gMethods[] = {
                               android_media_AudioSystem_listenForSystemPropertyChange),
        MAKE_JNI_NATIVE_METHOD("triggerSystemPropertyUpdate", "(J)V",
                               android_media_AudioSystem_triggerSystemPropertyUpdate),
        MAKE_AUDIO_SYSTEM_METHOD(setSimulateDeviceConnections),
};

static const JNINativeMethod gEventHandlerMethods[] =
+6 −0
Original line number Diff line number Diff line
@@ -2846,4 +2846,10 @@ public class AudioSystem
     */
    public static native int unregisterAudioVolumeGroupCallback(
            INativeAudioVolumeGroupCallback callback);

    /**
     * Enable or disable device connection simulation at the HAL level.
     * @hide
     */
    public static native int setSimulateDeviceConnections(boolean enabled);
}