Merge "AudioRecord: ensure documented behavior of active rec config"

This commit is contained in:
Jean-Michel Trivi
2020-11-24 23:18:47 +00:00
committed by Android (Google) Code Review

View File

@@ -166,6 +166,7 @@ public class AudioRecord implements AudioRouting, MicrophoneDirection,
//--------------------
/**
* Accessed by native methods: provides access to C++ AudioRecord object
* Is 0 after release()
*/
@SuppressWarnings("unused")
@UnsupportedAppUsage
@@ -1872,7 +1873,11 @@ public class AudioRecord implements AudioRouting, MicrophoneDirection,
if (mNativeRecorderInJavaObj == 0) {
return 0;
}
return native_getPortId();
try {
return native_getPortId();
} catch (IllegalStateException e) {
return 0;
}
}
//--------------------------------------------------------------------------
@@ -2055,6 +2060,9 @@ public class AudioRecord implements AudioRouting, MicrophoneDirection,
private native final int native_get_active_microphones(
ArrayList<MicrophoneInfo> activeMicrophones);
/**
* @throws IllegalStateException
*/
private native int native_getPortId();
private native int native_set_preferred_microphone_direction(int direction);