Merge "Remove GET_ACTIVITIES in InteractAcrossProfiles in Settings" into udc-dev am: 03e8dbca58 am: 123fa6ae78

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/23347979

Change-Id: I616281d105e7c5792b515501970526689bc104ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Nicolas Sleiman
2023-05-19 16:13:52 +00:00
committed by Automerger Merge Worker

View File

@@ -16,10 +16,8 @@
package com.android.settings.applications.specialaccess.interactacrossprofiles;
import static android.app.admin.DevicePolicyResources.Strings.Settings.CONNECTED_WORK_AND_PERSONAL_APPS_TITLE;
import static android.content.pm.PackageManager.GET_ACTIVITIES;
import android.annotation.Nullable;
import android.app.admin.DevicePolicyManager;
import android.app.settings.SettingsEnums;
import android.content.Context;
import android.content.pm.ApplicationInfo;
@@ -157,9 +155,9 @@ public class InteractAcrossProfilesSettings extends EmptyTextSettings {
private static List<PackageInfo> getAllInstalledPackages(
PackageManager packageManager, UserHandle personalProfile, UserHandle workProfile) {
List<PackageInfo> personalPackages = packageManager.getInstalledPackagesAsUser(
GET_ACTIVITIES, personalProfile.getIdentifier());
/* flags= */ 0, personalProfile.getIdentifier());
List<PackageInfo> workPackages = packageManager.getInstalledPackagesAsUser(
GET_ACTIVITIES, workProfile.getIdentifier());
/* flags= */ 0, workProfile.getIdentifier());
List<PackageInfo> allPackages = new ArrayList<>(personalPackages);
for (PackageInfo workPackage : workPackages) {
if (allPackages.stream().noneMatch(