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

Commit 5c5306fe authored by Shreya Singh's avatar Shreya Singh Committed by Android (Google) Code Review
Browse files

Merge "Communicate right error code from DPMS to MP in response to...

Merge "Communicate right error code from DPMS to MP in response to STATUS_HEADLESS_SYSTEM_USER_MODE_NOT_SUPPORTED" into udc-dev
parents 3c0dd66b 77b0bb52
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -10956,8 +10956,13 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
                /* deviceOwnerUserId= */ deviceOwnerUserId, /* callingUserId*/ caller.getUserId(),
                isAdb(caller), hasIncompatibleAccountsOrNonAdb);
        if (code != STATUS_OK) {
            throw new IllegalStateException(computeProvisioningErrorStringLocked(code,
                    deviceOwnerUserId, owner, showComponentOnError));
            final String provisioningErrorStringLocked = computeProvisioningErrorStringLocked(code,
                    deviceOwnerUserId, owner, showComponentOnError);
            if (code == STATUS_HEADLESS_SYSTEM_USER_MODE_NOT_SUPPORTED) {
                throw new ServiceSpecificException(code, provisioningErrorStringLocked);
            } else {
                throw new IllegalStateException(provisioningErrorStringLocked);
            }
        }
    }
@@ -11011,6 +11016,9 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
            case STATUS_HAS_PAIRED:
                return "Not allowed to set the device owner because this device has already "
                        + "paired.";
            case STATUS_HEADLESS_SYSTEM_USER_MODE_NOT_SUPPORTED:
                return "Cannot provision an unsupported DPC into DO on a"
                        + " headless device";
            default:
                return "Unexpected @ProvisioningPreCondition: " + code;
        }