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

Commit 8d54cb87 authored by Alex Johnston's avatar Alex Johnston
Browse files

Fix profile owners uid logic

Use uid instead of userId

Bug: 268159214
Test: Set up a profile owner with TestDPC
Change-Id: I69b2a767d9e0bfe2213998305b3f120ecb3ce549
parent 39169f81
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -204,7 +204,15 @@ class Owners {

    @GuardedBy("mData")
    Set<Integer> getProfileOwnerUidsLocked() {
        return mData.mProfileOwners.keySet();
        Set<Integer> uids = new ArraySet<>();
        for (int i = 0; i < mData.mProfileOwners.size(); i++) {
            int userId = mData.mProfileOwners.keyAt(i);
            OwnerInfo info = mData.mProfileOwners.valueAt(i);
            uids.add(mPackageManagerInternal.getPackageUid(info.packageName,
                    PackageManager.MATCH_ALL | PackageManager.MATCH_KNOWN_PACKAGES,
                    userId));
        }
        return uids;
    }

    String getDeviceOwnerPackageName() {