From 7dbcbad577a32f16d75dde3fe1412c56c5a2a399 Mon Sep 17 00:00:00 2001 From: Edward Savage-Jones Date: Tue, 15 Dec 2015 19:20:51 +0100 Subject: [PATCH] NullPointerException when starting VoiceInteractionManagerService If an end user disables the package that implements support for Voice Assist (Google App) and reboots, an NPE is thrown during boot, which results in the device getting stuck at the boot animation. Recovery is not possible without USB debugging enabled, leaving factory reset/user data wipe as the only other option. Change-Id: I9c161fff7f096deee13bf8e37d951e20898ae3ff --- .../android/service/voice/VoiceInteractionServiceInfo.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/java/android/service/voice/VoiceInteractionServiceInfo.java b/core/java/android/service/voice/VoiceInteractionServiceInfo.java index 463eb5be46f61..8393f7ecd83a9 100644 --- a/core/java/android/service/voice/VoiceInteractionServiceInfo.java +++ b/core/java/android/service/voice/VoiceInteractionServiceInfo.java @@ -58,6 +58,10 @@ public class VoiceInteractionServiceInfo { } public VoiceInteractionServiceInfo(PackageManager pm, ServiceInfo si) { + if (si == null) { + mParseError = "Service not available"; + return; + } if (!Manifest.permission.BIND_VOICE_INTERACTION.equals(si.permission)) { mParseError = "Service does not require permission " + Manifest.permission.BIND_VOICE_INTERACTION;