Merge "Fix the issue of voice interactor getting reset after reboot." into oc-dev

am: c59a2a7649

Change-Id: I5676e0f3927f2de123e9d5d219bd10a881754583
This commit is contained in:
Sudheer Shanka
2017-04-13 17:38:59 +00:00
committed by android-build-merger

View File

@@ -302,9 +302,13 @@ public class VoiceInteractionManagerService extends SystemService {
ComponentName curInteractor = !TextUtils.isEmpty(curInteractorStr) ComponentName curInteractor = !TextUtils.isEmpty(curInteractorStr)
? ComponentName.unflattenFromString(curInteractorStr) : null; ? ComponentName.unflattenFromString(curInteractorStr) : null;
try { try {
recognizerInfo = pm.getServiceInfo(curRecognizer, 0, userHandle); recognizerInfo = pm.getServiceInfo(curRecognizer,
PackageManager.MATCH_DIRECT_BOOT_AWARE
| PackageManager.MATCH_DIRECT_BOOT_UNAWARE, userHandle);
if (curInteractor != null) { if (curInteractor != null) {
interactorInfo = pm.getServiceInfo(curInteractor, 0, userHandle); interactorInfo = pm.getServiceInfo(curInteractor,
PackageManager.MATCH_DIRECT_BOOT_AWARE
| PackageManager.MATCH_DIRECT_BOOT_UNAWARE, userHandle);
} }
} catch (RemoteException e) { } catch (RemoteException e) {
} }
@@ -492,7 +496,9 @@ public class VoiceInteractionManagerService extends SystemService {
ComponentName findAvailRecognizer(String prefPackage, int userHandle) { ComponentName findAvailRecognizer(String prefPackage, int userHandle) {
List<ResolveInfo> available = List<ResolveInfo> available =
mContext.getPackageManager().queryIntentServicesAsUser( mContext.getPackageManager().queryIntentServicesAsUser(
new Intent(RecognitionService.SERVICE_INTERFACE), 0, userHandle); new Intent(RecognitionService.SERVICE_INTERFACE),
PackageManager.MATCH_DIRECT_BOOT_AWARE
| PackageManager.MATCH_DIRECT_BOOT_UNAWARE, userHandle);
int numAvailable = available.size(); int numAvailable = available.size();
if (numAvailable == 0) { if (numAvailable == 0) {