From c7b18342eafa53a741e3e8d8cfc85f35f9416b12 Mon Sep 17 00:00:00 2001 From: Greg Plesur Date: Wed, 8 Feb 2017 14:57:34 -0500 Subject: [PATCH] Don't check device_provisioned on Wear devices in setDeviceOwnerSystemPropertyLocked() BUG: 34824902 Change-Id: I49d4d7043829862e1abacb3f400a6690f454d6c0 --- .../server/devicepolicy/DevicePolicyManagerService.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java index a2af38bbfc641..daffefe81643a 100644 --- a/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java +++ b/services/devicepolicy/java/com/android/server/devicepolicy/DevicePolicyManagerService.java @@ -1726,7 +1726,10 @@ public class DevicePolicyManagerService extends IDevicePolicyManager.Stub { private void setDeviceOwnerSystemPropertyLocked() { // Device owner may still be provisioned, do not set the read-only system property yet. - if (mInjector.settingsGlobalGetInt(Settings.Global.DEVICE_PROVISIONED, 0) == 0) { + // Wear devices don't set device_provisioned until the device is paired, so allow + // device_owner property to be set without that. + if (!mIsWatch + && mInjector.settingsGlobalGetInt(Settings.Global.DEVICE_PROVISIONED, 0) == 0) { return; } // Still at the first stage of CryptKeeper double bounce, mOwners.hasDeviceOwner is