cosu icon indicating copy to clipboard operation
cosu copied to clipboard

Unexpected @ProvisioningPreCondition

Open amiyo-biswas opened this issue 5 years ago • 3 comments

I am getting Unexpected @ProvisioningPreCondition error on some devices (API 28) when set adb shell dpm set-device-owner . Does any guys meet this issue? Any help would be greatly appreciated.

adb shell dpm set-device-owner com.myapp/.AppAdminReceiver

Error Is

java.lang.IllegalStateException: Unexpected @ProvisioningPreCondition 99
        at android.os.Parcel.createException(Parcel.java:1974)
        at android.os.Parcel.readException(Parcel.java:1934)
        at android.os.Parcel.readException(Parcel.java:1884)
        at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDevicePolicyManager.java:5863)
        at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:176)
        at com.android.commands.dpm.Dpm.onRun(Dpm.java:106)
        at com.android.internal.os.BaseCommand.run(BaseCommand.java:54)
        at com.android.commands.dpm.Dpm.main(Dpm.java:41)
        at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
        at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:416)
Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.server.devicepolicy.DevicePolicyManagerService.enforceCanSetDeviceOwnerLocked(DevicePolicyManagerService.java:8007)
        at com.android.server.devicepolicy.DevicePolicyManagerService.setDeviceOwner(DevicePolicyManagerService.java:7291)

amiyo-biswas avatar Aug 07 '19 10:08 amiyo-biswas