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

Commit 5659b15a authored by Greg Plesur's avatar Greg Plesur Committed by Android (Google) Code Review
Browse files

Merge "Allow any device with a device_owner to execute...

Merge "Allow any device with a device_owner to execute setDeviceOwnerSystemPropertyLocked()." into cw-f-dev
parents 31c7fa00 735b4dc0
Loading
Loading
Loading
Loading
+8 −5
Original line number Original line Diff line number Diff line
@@ -1725,11 +1725,14 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub {
    }
    }


    private void setDeviceOwnerSystemPropertyLocked() {
    private void setDeviceOwnerSystemPropertyLocked() {
        // Device owner may still be provisioned, do not set the read-only system property yet.
        final boolean deviceProvisioned =
        // Wear devices don't set device_provisioned until the device is paired, so allow
                mInjector.settingsGlobalGetInt(Settings.Global.DEVICE_PROVISIONED, 0) != 0;
        // device_owner property to be set without that.
        // If the device is not provisioned and there is currently no device owner, do not set the
        if (!mIsWatch
        // read-only system property yet, since Device owner may still be provisioned. For Wear
                && mInjector.settingsGlobalGetInt(Settings.Global.DEVICE_PROVISIONED, 0) == 0) {
        // devices, if there is already a device owner then it's OK to set the property to true now,
        // regardless the provision state.
        final boolean isWatchWithDeviceOwner = mIsWatch && mOwners.hasDeviceOwner();
        if (!isWatchWithDeviceOwner && !deviceProvisioned) {
            return;
            return;
        }
        }
        // Still at the first stage of CryptKeeper double bounce, mOwners.hasDeviceOwner is
        // Still at the first stage of CryptKeeper double bounce, mOwners.hasDeviceOwner is