summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/AudioRecord.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/media/java/android/media/AudioRecord.java b/media/java/android/media/AudioRecord.java
index e819b8a..c96690b 100644
--- a/media/java/android/media/AudioRecord.java
+++ b/media/java/android/media/AudioRecord.java
@@ -974,7 +974,14 @@ public class AudioRecord
final IBinder b = ServiceManager.getService(android.content.Context.AUDIO_SERVICE);
final IAudioService ias = IAudioService.Stub.asInterface(b);
try {
- ias.handleHotwordInput(listening);
+ // If the caller tries to start recording with the HOTWORD input
+ // before AUDIO_SERVICE has started, IAudioService may not be available.
+ if (ias != null) {
+ ias.handleHotwordInput(listening);
+ } else {
+ Log.e(TAG, "Error talking to AudioService when handling hotword input, "
+ + "AudioService unavailable");
+ }
} catch (RemoteException e) {
Log.e(TAG, "Error talking to AudioService when handling hotword input.", e);
}