Reinitialize voice interaction service on unlock

Fixes the incomplete initialization on FBE devices when
voice interaction service is not available before unlock.

Change-Id: I397237e4554453d29da643aee59384e289fa3654
Fixes: 28183380
This commit is contained in:
Amith Yamasani
2016-04-19 17:04:28 -07:00
parent 7ecd7671b7
commit 37f9de996e

View File

@@ -127,6 +127,12 @@ public class VoiceInteractionManagerService extends SystemService {
mServiceStub.initForUser(userHandle);
}
@Override
public void onUnlockUser(int userHandle) {
mServiceStub.initForUser(userHandle);
mServiceStub.switchImplementationIfNeeded(false);
}
@Override
public void onSwitchUser(int userHandle) {
mServiceStub.switchUser(userHandle);
@@ -362,6 +368,12 @@ public class VoiceInteractionManagerService extends SystemService {
}
}
void switchImplementationIfNeeded(boolean force) {
synchronized (this) {
switchImplementationIfNeededLocked(force);
}
}
void switchImplementationIfNeededLocked(boolean force) {
if (!mSafeMode) {
String curService = Settings.Secure.getStringForUser(