Loading services/core/java/com/android/server/pm/PackageManagerService.java +13 −1 Original line number Diff line number Diff line Loading @@ -6519,7 +6519,19 @@ public class PackageManagerService implements PackageSender, TestUtilityService throw new SecurityException("Not allowed to query domain verification agent"); } final Computer snapshot = snapshotComputer(); return getDomainVerificationAgentComponentNameLPr(snapshot, userId); final ComponentName agent = mDomainVerificationManager.getProxy().getComponentName(); final PackageStateInternal ps = snapshot.getPackageStateForInstalledAndFiltered( agent.getPackageName(), callerUid, userId); if (ps == null) { return null; } final var disabledComponents = ps.getUserStateOrDefault(userId).getDisabledComponentsNoCopy(); if (disabledComponents != null && disabledComponents.contains(agent.getClassName())) { return null; } // Only return the result if the agent is installed and enabled on the target user return agent; } @Override Loading services/core/java/com/android/server/pm/PackageManagerShellCommand.java +3 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import static android.content.pm.PackageManager.RESTRICTION_HIDE_NOTIFICATIONS; import static android.content.pm.PackageManager.RESTRICTION_NONE; import static com.android.server.LocalManagerRegistry.ManagerNotFoundException; import static com.android.server.pm.PackageManagerService.DEFAULT_FILE_ACCESS_MODE; import android.accounts.IAccountManager; import android.annotation.NonNull; Loading Loading @@ -4849,8 +4848,10 @@ class PackageManagerShellCommand extends ShellCommand { pw.println(" to unarchive an app to the responsible installer. Options are:"); pw.println(" --user: request unarchival of the app from the given user."); pw.println(""); pw.println(" get-domain-verification-agent"); pw.println(" get-domain-verification-agent [--user USER_ID]"); pw.println(" Displays the component name of the domain verification agent on device."); pw.println(" If the component isn't enabled, an error message will be displayed."); pw.println(" --user: return the agent of the given user (SYSTEM_USER if unspecified)"); pw.println(""); printArtServiceHelp(); pw.println(""); Loading Loading
services/core/java/com/android/server/pm/PackageManagerService.java +13 −1 Original line number Diff line number Diff line Loading @@ -6519,7 +6519,19 @@ public class PackageManagerService implements PackageSender, TestUtilityService throw new SecurityException("Not allowed to query domain verification agent"); } final Computer snapshot = snapshotComputer(); return getDomainVerificationAgentComponentNameLPr(snapshot, userId); final ComponentName agent = mDomainVerificationManager.getProxy().getComponentName(); final PackageStateInternal ps = snapshot.getPackageStateForInstalledAndFiltered( agent.getPackageName(), callerUid, userId); if (ps == null) { return null; } final var disabledComponents = ps.getUserStateOrDefault(userId).getDisabledComponentsNoCopy(); if (disabledComponents != null && disabledComponents.contains(agent.getClassName())) { return null; } // Only return the result if the agent is installed and enabled on the target user return agent; } @Override Loading
services/core/java/com/android/server/pm/PackageManagerShellCommand.java +3 −2 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import static android.content.pm.PackageManager.RESTRICTION_HIDE_NOTIFICATIONS; import static android.content.pm.PackageManager.RESTRICTION_NONE; import static com.android.server.LocalManagerRegistry.ManagerNotFoundException; import static com.android.server.pm.PackageManagerService.DEFAULT_FILE_ACCESS_MODE; import android.accounts.IAccountManager; import android.annotation.NonNull; Loading Loading @@ -4849,8 +4848,10 @@ class PackageManagerShellCommand extends ShellCommand { pw.println(" to unarchive an app to the responsible installer. Options are:"); pw.println(" --user: request unarchival of the app from the given user."); pw.println(""); pw.println(" get-domain-verification-agent"); pw.println(" get-domain-verification-agent [--user USER_ID]"); pw.println(" Displays the component name of the domain verification agent on device."); pw.println(" If the component isn't enabled, an error message will be displayed."); pw.println(" --user: return the agent of the given user (SYSTEM_USER if unspecified)"); pw.println(""); printArtServiceHelp(); pw.println(""); Loading