Fixed a crash with the voice interaction service

Bug: 20925281
Change-Id: I136014ebc12c3afcb154722a8fec44b1d5f003e9
(cherry picked from commit 64904d39f8)
This commit is contained in:
Selim Cinek
2015-05-11 16:28:42 -07:00
parent 737bff3476
commit b05f5739bb

View File

@@ -204,7 +204,8 @@ public class AssistManager {
private boolean getVoiceInteractorSupportsAssistGesture() {
try {
return mVoiceInteractionManagerService.activeServiceSupportsAssist();
return mVoiceInteractionManagerService != null
&& mVoiceInteractionManagerService.activeServiceSupportsAssist();
} catch (RemoteException e) {
Log.w(TAG, "Failed to call activeServiceSupportsAssistGesture", e);
return false;
@@ -213,7 +214,8 @@ public class AssistManager {
public boolean canVoiceAssistBeLaunchedFromKeyguard() {
try {
return mVoiceInteractionManagerService.activeServiceSupportsLaunchFromKeyguard();
return mVoiceInteractionManagerService != null
&& mVoiceInteractionManagerService.activeServiceSupportsLaunchFromKeyguard();
} catch (RemoteException e) {
Log.w(TAG, "Failed to call activeServiceSupportsLaunchFromKeyguard", e);
return false;
@@ -231,7 +233,8 @@ public class AssistManager {
private boolean isVoiceSessionRunning() {
try {
return mVoiceInteractionManagerService.isSessionRunning();
return mVoiceInteractionManagerService != null
&& mVoiceInteractionManagerService.isSessionRunning();
} catch (RemoteException e) {
Log.w(TAG, "Failed to call isSessionRunning", e);
return false;