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

Commit dee093a1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Fix minor issues." into udc-dev am: 756143de am: 65901f58

parents f1f26f31 65901f58
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -8684,6 +8684,7 @@ public class DevicePolicyManager {
     */
     */
    @RequiresPermission(anyOf = {SET_TIME, QUERY_ADMIN_POLICY}, conditional = true)
    @RequiresPermission(anyOf = {SET_TIME, QUERY_ADMIN_POLICY}, conditional = true)
    public boolean getAutoTimeEnabled(@Nullable ComponentName admin) {
    public boolean getAutoTimeEnabled(@Nullable ComponentName admin) {
        throwIfParentInstance("getAutoTimeEnabled");
        if (mService != null) {
        if (mService != null) {
            try {
            try {
                return mService.getAutoTimeEnabled(admin, mContext.getPackageName());
                return mService.getAutoTimeEnabled(admin, mContext.getPackageName());
+12 −5
Original line number Original line Diff line number Diff line
@@ -447,6 +447,7 @@ import android.util.AtomicFile;
import android.util.DebugUtils;
import android.util.DebugUtils;
import android.util.IndentingPrintWriter;
import android.util.IndentingPrintWriter;
import android.util.IntArray;
import android.util.IntArray;
import android.util.Log;
import android.util.Pair;
import android.util.Pair;
import android.util.Slog;
import android.util.Slog;
import android.util.SparseArray;
import android.util.SparseArray;
@@ -12080,7 +12081,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        Objects.requireNonNull(who, "ComponentName is null");
        Objects.requireNonNull(who, "ComponentName is null");
        final CallerIdentity caller = getCallerIdentity(who);
        final CallerIdentity caller = getCallerIdentity(who);
        Preconditions.checkCallAuthorization(
        Preconditions.checkCallAuthorization(
                isDeviceOwner(caller) || isProfileOwner(caller));
                isDefaultDeviceOwner(caller) || isProfileOwner(caller));
        if (packageList != null) {
        if (packageList != null) {
            for (String pkg : packageList) {
            for (String pkg : packageList) {
@@ -13365,8 +13366,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                PolicyDefinition<Boolean> policyDefinition =
                PolicyDefinition<Boolean> policyDefinition =
                        PolicyDefinition.getPolicyDefinitionForUserRestriction(key);
                        PolicyDefinition.getPolicyDefinitionForUserRestriction(key);
                if (enabledFromThisOwner) {
                if (enabledFromThisOwner) {
                    // TODO: Remove this special case - replace with breaking change to require
                    //  setGlobally to disable ADB
                    if (key.equals(UserManager.DISALLOW_DEBUGGING_FEATURES) && parent) {
                        setGlobalUserRestrictionInternal(admin, key, /* enabled= */ true);
                    } else {
                        setLocalUserRestrictionInternal(
                        setLocalUserRestrictionInternal(
                                admin, key, /* enabled= */ true, affectedUserId);
                                admin, key, /* enabled= */ true, affectedUserId);
                    }
                } else {
                } else {
                    // Remove any local and global policy that was set by the admin
                    // Remove any local and global policy that was set by the admin
                    if (!policyDefinition.isLocalOnlyPolicy()) {
                    if (!policyDefinition.isLocalOnlyPolicy()) {
@@ -15155,7 +15162,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                    }
                    }
                    DevicePolicyEventLogger
                    DevicePolicyEventLogger
                            .createEvent(DevicePolicyEnums.SET_LOCKTASK_MODE_ENABLED)
                            .createEvent(DevicePolicyEnums.SET_LOCKTASK_MODE_ENABLED)
                            .setAdmin(admin.info.getPackageName())
                            .setAdmin(admin.info == null ? null : admin.info.getPackageName())
                            .setBoolean(isEnabled)
                            .setBoolean(isEnabled)
                            .setStrings(pkg)
                            .setStrings(pkg)
                            .write();
                            .write();
@@ -22721,7 +22728,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        }
        }
        private void handleFinancedDeviceKioskRoleChange() {
        private void handleFinancedDeviceKioskRoleChange() {
            if (!isPermissionCheckFlagEnabled()) {
            if (!isPolicyEngineForFinanceFlagEnabled()) {
                return;
                return;
            }
            }
            Slog.i(LOG_TAG, "Handling action " + ACTION_DEVICE_FINANCING_STATE_CHANGED);
            Slog.i(LOG_TAG, "Handling action " + ACTION_DEVICE_FINANCING_STATE_CHANGED);