diff options
| author | 2019-07-15 22:16:08 +0000 | |
|---|---|---|
| committer | 2019-07-15 22:16:08 +0000 | |
| commit | 2a727fa560fd9f3510cd3ceed590bd69329e37d6 (patch) | |
| tree | 7c0ed5c69c23405ba90f5ebab2601509fdd920d8 | |
| parent | 3229eec32d8d6507efb2af2be41aa47d03cf2482 (diff) | |
| parent | f3610614516b3e894848d40be16146533bc513c6 (diff) | |
Merge "audio record: fix getPortId() after release"
| -rw-r--r-- | media/java/android/media/AudioRecord.java | 3 | ||||
| -rw-r--r-- | media/java/android/media/MediaRecorder.java | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java index ce9b07dd0c0e..0254c9721019 100644 --- a/media/java/android/media/AudioRecord.java +++ b/media/java/android/media/AudioRecord.java @@ -1788,6 +1788,9 @@ public class AudioRecord implements AudioRouting, MicrophoneDirection, * @hide */ public int getPortId() { + if (mNativeRecorderInJavaObj == 0) { + return 0; + } return native_getPortId(); } diff --git a/media/java/android/media/MediaRecorder.java b/media/java/android/media/MediaRecorder.java index 63b22df12953..bc3de7484bf9 100644 --- a/media/java/android/media/MediaRecorder.java +++ b/media/java/android/media/MediaRecorder.java @@ -1624,6 +1624,9 @@ public class MediaRecorder implements AudioRouting, * @hide */ public int getPortId() { + if (mNativeContext == 0) { + return 0; + } return native_getPortId(); } |