Loading services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +9 −10 Original line number Diff line number Diff line Loading @@ -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."); Loading Loading @@ -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); Loading Loading @@ -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 Loading Loading @@ -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"); services/devicepolicy/java/com/android/server/devicepolicy/PolicyVersionUpgrader.java +4 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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)); } } Loading Loading @@ -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 { Loading Loading
services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +9 −10 Original line number Diff line number Diff line Loading @@ -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."); Loading Loading @@ -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); Loading Loading @@ -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 Loading Loading @@ -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");
services/devicepolicy/java/com/android/server/devicepolicy/PolicyVersionUpgrader.java +4 −3 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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)); } } Loading Loading @@ -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 { Loading