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

Commit a966bfb5 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Merge branch '2918-a14-parental' into 'a14'

base: allow parental control to be activated with accounts

See merge request e/os/android_frameworks_base!264
parents cf7f1625 95cdac4c
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -592,6 +592,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    private static final String TAG_TRANSFER_OWNERSHIP_BUNDLE = "transfer-ownership-bundle";
    private static final String PARENTALCONTROL_PKG = "foundation.e.parentalcontrol";
    private static final int REQUEST_EXPIRE_PASSWORD = 5571;
    private static final int REQUEST_PROFILE_OFF_DEADLINE = 5572;
@@ -16890,6 +16892,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                            + "current user cannot be system user when setting device owner");
                    return STATUS_SYSTEM_USER;
                }
                // Allow parental control with accounts
                if (owner != null && PARENTALCONTROL_PKG.equals(owner.getPackageName())) {
                    return STATUS_OK;
                }
                if (hasIncompatibleAccountsOrNonAdb) {
                    return STATUS_ACCOUNTS_NOT_EMPTY;
                }
@@ -18446,7 +18452,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            return true;
        }
        // Allow parental control with accounts
        if (owner != null && "foundation.e.parentalcontrol".equals(owner.getPackageName())) {
        if (owner != null && PARENTALCONTROL_PKG.equals(owner.getPackageName())) {
            return false;
        }
        wtfIfInLock();