diff options
| -rw-r--r-- | services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java | 2 | ||||
| -rw-r--r-- | services/autofill/java/com/android/server/autofill/RemoteInlineSuggestionRenderService.java | 11 |
2 files changed, 7 insertions, 6 deletions
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java index e28ef0f920e9..4f18f3547449 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java @@ -216,7 +216,7 @@ final class AutofillManagerServiceImpl updateRemoteAugmentedAutofillService(); final ComponentName componentName = RemoteInlineSuggestionRenderService - .getServiceComponentName(getContext()); + .getServiceComponentName(getContext(), mUserId); if (componentName != null) { mRemoteInlineSuggestionRenderService = new RemoteInlineSuggestionRenderService( getContext(), componentName, InlineSuggestionRenderService.SERVICE_INTERFACE, diff --git a/services/autofill/java/com/android/server/autofill/RemoteInlineSuggestionRenderService.java b/services/autofill/java/com/android/server/autofill/RemoteInlineSuggestionRenderService.java index f9e08e683b6c..31dc23f0118d 100644 --- a/services/autofill/java/com/android/server/autofill/RemoteInlineSuggestionRenderService.java +++ b/services/autofill/java/com/android/server/autofill/RemoteInlineSuggestionRenderService.java @@ -20,6 +20,7 @@ import static com.android.server.autofill.Helper.sVerbose; import android.Manifest; import android.annotation.NonNull; import android.annotation.Nullable; +import android.annotation.UserIdInt; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -86,7 +87,7 @@ final class RemoteInlineSuggestionRenderService extends } @Nullable - private static ServiceInfo getServiceInfo(Context context) { + private static ServiceInfo getServiceInfo(Context context, int userId) { final String packageName = context.getPackageManager().getServicesSystemSharedLibraryPackageName(); if (packageName == null) { @@ -96,8 +97,8 @@ final class RemoteInlineSuggestionRenderService extends final Intent intent = new Intent(InlineSuggestionRenderService.SERVICE_INTERFACE); intent.setPackage(packageName); - final ResolveInfo resolveInfo = context.getPackageManager().resolveService(intent, - PackageManager.GET_SERVICES | PackageManager.GET_META_DATA); + final ResolveInfo resolveInfo = context.getPackageManager().resolveServiceAsUser(intent, + PackageManager.GET_SERVICES | PackageManager.GET_META_DATA, userId); final ServiceInfo serviceInfo = resolveInfo == null ? null : resolveInfo.serviceInfo; if (resolveInfo == null || serviceInfo == null) { Slog.w(TAG, "No valid components found."); @@ -115,8 +116,8 @@ final class RemoteInlineSuggestionRenderService extends } @Nullable - public static ComponentName getServiceComponentName(Context context) { - final ServiceInfo serviceInfo = getServiceInfo(context); + public static ComponentName getServiceComponentName(Context context, @UserIdInt int userId) { + final ServiceInfo serviceInfo = getServiceInfo(context, userId); if (serviceInfo == null) return null; final ComponentName componentName = new ComponentName(serviceInfo.packageName, |