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

Commit 850171a9 authored by Salud Lemus's avatar Salud Lemus
Browse files

Update canSilentlyInstallPackage DPMS API for financed device owner

Currently, this API returns false for a financed device owner even
though it is a device owner. Because it returns false, it
prevents a financed device owner from installing apps.

Bug: 228137429
Test: Local test with and without the changes

Change-Id: Ia1b4893ae601d8e50d0b7c6d16e895d92b1885f0
parent 75fb4d30
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -13059,9 +13059,11 @@ public class DevicePolicyManagerService extends BaseIDevicePolicyManager {
            if (callerPackage == null) {
                return false;
            }
            CallerIdentity caller = new CallerIdentity(callerUid, null, null);
            if (isUserAffiliatedWithDevice(UserHandle.getUserId(callerUid))
                    && (isActiveProfileOwner(callerUid)
                        || isActiveDeviceOwner(callerUid))) {
                        || isDefaultDeviceOwner(caller) || isFinancedDeviceOwner(caller))) {
                // device owner or a profile owner affiliated with the device owner
                return true;
            }