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

Commit 2e2d60e7 authored by Marcelo Arteiro's avatar Marcelo Arteiro Committed by Android (Google) Code Review
Browse files

Merge "Refactor string formatting affecting unrelated CL (ag/32102801)." into main

parents db27b55b bd621e51
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
@@ -7124,7 +7124,7 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                        case KeyChain.KEY_GEN_STRONGBOX_UNAVAILABLE:
                            throw new ServiceSpecificException(
                                    DevicePolicyManager.KEY_GEN_STRONGBOX_UNAVAILABLE,
                                    String.format("KeyChain error: %d", generationResult));
                                    TextUtils.formatSimple("KeyChain error: %d", generationResult));
                        case KeyChain.KEY_ATTESTATION_CANNOT_ATTEST_IDS:
                            throw new UnsupportedOperationException(
                                "Device does not support Device ID attestation.");
@@ -9970,10 +9970,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            enforceCanSetDeviceOwnerLocked(caller, admin, userId, hasIncompatibleAccountsOrNonAdb);
            Preconditions.checkArgument(isPackageInstalledForUser(admin.getPackageName(), userId),
                    "Invalid component " + admin + " for device owner");
                    "Invalid component %s for device owner", admin);
            final ActiveAdmin activeAdmin = getActiveAdminUncheckedLocked(admin, userId);
            Preconditions.checkArgument(activeAdmin != null && !getUserData(
                    userId).mRemovingAdmins.contains(admin), "Not active admin: " + admin);
                    userId).mRemovingAdmins.contains(admin), "Not active admin: %s", admin);
            // Shutting down backup manager service permanently.
            toggleBackupServiceActive(UserHandle.USER_SYSTEM, /* makeActive= */ false);
@@ -10535,13 +10535,12 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            final ActiveAdmin admin = getActiveAdminUncheckedLocked(who, userHandle);
            Preconditions.checkArgument(
                    isPackageInstalledForUser(who.getPackageName(), userHandle),
                    "Package %s not installed in user %d"
                            .formatted(who.getPackageName(), userHandle));
            Preconditions.checkArgument(admin != null, "Not active admin: " + who);
                    "Package %s not installed in user %d", who.getPackageName(),
                    userHandle);
            Preconditions.checkArgument(admin != null, "Not active admin: %s", who);
            Preconditions.checkArgument(
                    !getUserData(userHandle).mRemovingAdmins.contains(who),
                    "Admin %s is being removed from user %d"
                            .formatted(who, userHandle));
                    "Admin %s is being removed from user %d", who, userHandle);
            final int parentUserId = getProfileParentId(userHandle);
            // When trying to set a profile owner on a new user, it may be that this user is
@@ -19204,8 +19203,8 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
        Objects.requireNonNull(serviceIntent);
        Preconditions.checkArgument(
                serviceIntent.getComponent() != null || serviceIntent.getPackage() != null,
                "Service intent must be explicit (with a package name or component): "
                        + serviceIntent);
                "Service intent must be explicit (with a package name or component): %s",
                serviceIntent);
        Objects.requireNonNull(connection);
        Preconditions.checkArgument(mInjector.userHandleGetCallingUserId() != targetUserId,
                "target user id must be different from the calling user id");
+4 −3
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.content.ComponentName;
import android.os.UserHandle;
import android.util.Slog;
import android.util.SparseArray;
import android.text.TextUtils;

import com.android.internal.annotations.VisibleForTesting;
import com.android.internal.util.JournaledFile;
@@ -266,8 +267,8 @@ public class PolicyVersionUpgrader {
        if (allWritesSuccessful) {
            writeVersion(currentVersion);
        } else {
            Slog.e(LOG_TAG, String.format("Error: Failed upgrading policies to version %d",
                    currentVersion));
            Slog.e(LOG_TAG, TextUtils.formatSimple(
                    "Error: Failed upgrading policies to version %d", currentVersion));
        }
    }

@@ -338,7 +339,7 @@ public class PolicyVersionUpgrader {

        File file = versionFile.chooseForWrite();
        if (VERBOSE_LOG) {
            Slog.v(LOG_TAG, String.format("Writing new version to: %s", file));
            Slog.v(LOG_TAG, TextUtils.formatSimple("Writing new version to: %s", file));
        }

        try {