Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03e8dbca authored by Nicolas Sleiman's avatar Nicolas Sleiman Committed by Android (Google) Code Review
Browse files

Merge "Remove GET_ACTIVITIES in InteractAcrossProfiles in Settings" into udc-dev

parents 96cff648 f3241ee3
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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(