I am using DLSTAGER on Android 7 Joya Touch A6 for staging porpouse.
I would like to set my App as DEVICE OWNER so I use the OWN command.
The process works and, at the end, I see my app in DEVICE OWNER mode:
The problem is when I try to check if the app is really in device owner mode with this code:
`boolean isDeviceOwner = devicePolicyManager.isDeviceOwnerApp(packageName);`
It returns FALSE…
If I check with:
`boolean isProfileOwner = devicePolicyManager.isProfileOwnerApp(packageName);`
it returns TRUE…
So, it seems that OWN command (that is not documented in https://datalogic.github.io/scan2deploy/android-schema/#scripting ) does not set the app as DEVICE OWNER but in PROFILE OWNER.
This is a problem because some functionalities (like install other apps silently…) does not work.
If I set the DEVICE OWNER using ADB like this:
adb shell dpm set-device-owner it.yyy.xxx/.broadcastreceiver.AdminReceiver
` boolean isDeviceOwner = devicePolicyManager.isDeviceOwnerApp(packageName);`
Is it possible to use DLSTAGER SHELL command to send the same “dpm set-device-owner” as a workaround?
There is a way to solve this problem and set an application really in DEVICE OWNER mode using DLSTAGER?