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

Commit df61f735 authored by Jonathan Scott's avatar Jonathan Scott Committed by Automerger Merge Worker
Browse files

Merge "Fix connected apps for headless (was previously always checking allowed...

Merge "Fix connected apps for headless (was previously always checking allowed apps on user 0)." into udc-dev am: b5c0e6e7 am: ff921596

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23154111



Change-Id: I69e7fe51088e4e461b89399033e4626abb842383
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents e1e51762 ff921596
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15735,7 +15735,7 @@ public class DevicePolicyManager {
        throwIfParentInstance("getAllCrossProfilePackages");
        if (mService != null) {
            try {
                return new ArraySet<>(mService.getAllCrossProfilePackages());
                return new ArraySet<>(mService.getAllCrossProfilePackages(mContext.getUserId()));
            } catch (RemoteException e) {
                throw e.rethrowFromSystemServer();
            }
+1 −1
Original line number Diff line number Diff line
@@ -206,7 +206,7 @@ public abstract class DevicePolicyManagerInternal {
     *
     * @hide
     */
    public abstract List<String> getAllCrossProfilePackages();
    public abstract List<String> getAllCrossProfilePackages(int userId);

    /**
     * Returns the default package names set by the OEM that are allowed to communicate
+1 −1
Original line number Diff line number Diff line
@@ -515,7 +515,7 @@ interface IDevicePolicyManager {
    void setCrossProfilePackages(in ComponentName admin, in List<String> packageNames);
    List<String> getCrossProfilePackages(in ComponentName admin);

    List<String> getAllCrossProfilePackages();
    List<String> getAllCrossProfilePackages(int userId);
    List<String> getDefaultCrossProfilePackages();

    boolean isManagedKiosk();
+3 −1
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
 * limitations under the License.
 */
package com.android.server.pm;

import static android.Manifest.permission.CONFIGURE_INTERACT_ACROSS_PROFILES;
import static android.Manifest.permission.INTERACT_ACROSS_PROFILES;
import static android.Manifest.permission.INTERACT_ACROSS_USERS;
@@ -333,9 +334,10 @@ public class CrossProfileAppsServiceImpl extends ICrossProfileApps.Stub {
    }

    private boolean isCrossProfilePackageAllowlisted(String packageName) {
        int userId = mInjector.getCallingUserId();
        return mInjector.withCleanCallingIdentity(() ->
                mInjector.getDevicePolicyManagerInternal()
                        .getAllCrossProfilePackages().contains(packageName));
                        .getAllCrossProfilePackages(userId).contains(packageName));
    }

    private boolean isCrossProfilePackageAllowlistedByDefault(String packageName) {
+1 −0
Original line number Diff line number Diff line
@@ -238,6 +238,7 @@ public class UserRestrictionsUtils {
                    UserManager.DISALLOW_CONFIG_DATE_TIME,
                    UserManager.DISALLOW_CONFIG_PRIVATE_DNS,
                    UserManager.DISALLOW_CHANGE_WIFI_STATE,
                    UserManager.DISALLOW_DEBUGGING_FEATURES,
                    UserManager.DISALLOW_WIFI_TETHERING,
                    UserManager.DISALLOW_WIFI_DIRECT,
                    UserManager.DISALLOW_ADD_WIFI_CONFIG,
Loading