summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Eric Laurent <elaurent@google.com> 2019-07-15 22:16:08 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2019-07-15 22:16:08 +0000
commit2a727fa560fd9f3510cd3ceed590bd69329e37d6 (patch)
tree7c0ed5c69c23405ba90f5ebab2601509fdd920d8
parent3229eec32d8d6507efb2af2be41aa47d03cf2482 (diff)
parentf3610614516b3e894848d40be16146533bc513c6 (diff)
Merge "audio record: fix getPortId() after release"
-rw-r--r--media/java/android/media/AudioRecord.java3
-rw-r--r--media/java/android/media/MediaRecorder.java3
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();
}