diff options
author | Jorim Jaggi <jjaggi@google.com> | 2015-07-20 14:44:55 -0700 |
---|---|---|
committer | Jorim Jaggi <jjaggi@google.com> | 2015-07-20 15:47:15 -0700 |
commit | e446dcee8f5c24121adbfb7600453e0de1826497 (patch) | |
tree | 502f8ae2282111228853ac112bfb7c644c0aa51a | |
parent | 86b273f1cc59185a14d5bab8a3f4db30c1a4c8a9 (diff) | |
download | frameworks_base-e446dcee8f5c24121adbfb7600453e0de1826497.zip frameworks_base-e446dcee8f5c24121adbfb7600453e0de1826497.tar.gz frameworks_base-e446dcee8f5c24121adbfb7600453e0de1826497.tar.bz2 |
Fix SysUI crashes on svelte devices
Bug: 22602295
Change-Id: Idac0d62683c0f6f7cf7b795967632e34d771c4f7
-rw-r--r-- | core/java/com/android/internal/app/AssistUtils.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/core/java/com/android/internal/app/AssistUtils.java b/core/java/com/android/internal/app/AssistUtils.java index ff989bd..0910daf 100644 --- a/core/java/com/android/internal/app/AssistUtils.java +++ b/core/java/com/android/internal/app/AssistUtils.java @@ -49,8 +49,10 @@ public class AssistUtils { public boolean showSessionForActiveService(Bundle args, int sourceFlags, IVoiceInteractionSessionShowCallback showCallback, IBinder activityToken) { try { - return mVoiceInteractionManagerService.showSessionForActiveService(args, sourceFlags, - showCallback, activityToken); + if (mVoiceInteractionManagerService != null) { + return mVoiceInteractionManagerService.showSessionForActiveService(args, + sourceFlags, showCallback, activityToken); + } } catch (RemoteException e) { Log.w(TAG, "Failed to call showSessionForActiveService", e); } @@ -59,7 +61,9 @@ public class AssistUtils { public void launchVoiceAssistFromKeyguard() { try { - mVoiceInteractionManagerService.launchVoiceAssistFromKeyguard(); + if (mVoiceInteractionManagerService != null) { + mVoiceInteractionManagerService.launchVoiceAssistFromKeyguard(); + } } catch (RemoteException e) { Log.w(TAG, "Failed to call launchVoiceAssistFromKeyguard", e); } @@ -87,7 +91,11 @@ public class AssistUtils { public ComponentName getActiveServiceComponentName() { try { - return mVoiceInteractionManagerService.getActiveServiceComponentName(); + if (mVoiceInteractionManagerService != null) { + return mVoiceInteractionManagerService.getActiveServiceComponentName(); + } else { + return null; + } } catch (RemoteException e) { Log.w(TAG, "Failed to call getActiveServiceComponentName", e); return null; @@ -106,7 +114,9 @@ public class AssistUtils { public void hideCurrentSession() { try { - mVoiceInteractionManagerService.hideCurrentSession(); + if (mVoiceInteractionManagerService != null) { + mVoiceInteractionManagerService.hideCurrentSession(); + } } catch (RemoteException e) { Log.w(TAG, "Failed to call hideCurrentSession", e); } |