Merge "Properly set default voice interactor" into nyc-dev

am: e34bb5a1ff

* commit 'e34bb5a1ffc5fe35b2fbc58824ad5bfbc7ecad3d':
  Properly set default voice interactor

Change-Id: I1e9d7488ecac8569a585e00ebc7c45df1b1833c3
This commit is contained in:
Svetoslav Ganov
2016-06-02 22:43:41 +00:00
committed by android-build-merger
2 changed files with 9 additions and 3 deletions

View File

@@ -61,7 +61,11 @@ public class VoiceInteractionServiceInfo {
throws PackageManager.NameNotFoundException {
try {
ServiceInfo si = AppGlobals.getPackageManager().getServiceInfo(comp,
PackageManager.GET_META_DATA, userHandle);
PackageManager.GET_META_DATA
| PackageManager.MATCH_DIRECT_BOOT_AWARE
| PackageManager.MATCH_DIRECT_BOOT_UNAWARE
| PackageManager.MATCH_DEBUG_TRIAGED_MISSING,
userHandle);
if (si != null) {
return si;
}

View File

@@ -19,7 +19,6 @@ package com.android.server.voiceinteraction;
import android.Manifest;
import android.app.ActivityManager;
import android.app.ActivityManagerInternal;
import android.app.ActivityManagerNative;
import android.app.AppGlobals;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -415,7 +414,10 @@ public class VoiceInteractionManagerService extends SystemService {
VoiceInteractionServiceInfo findAvailInteractor(int userHandle, String packageName) {
List<ResolveInfo> available =
mContext.getPackageManager().queryIntentServicesAsUser(
new Intent(VoiceInteractionService.SERVICE_INTERFACE), 0, userHandle);
new Intent(VoiceInteractionService.SERVICE_INTERFACE),
PackageManager.MATCH_DIRECT_BOOT_AWARE
| PackageManager.MATCH_DIRECT_BOOT_UNAWARE
| PackageManager.MATCH_DEBUG_TRIAGED_MISSING, userHandle);
int numAvailable = available.size();
if (numAvailable == 0) {