I know you can run an adb command to make an app to be a device owner:
adb shell dpm set-device-owner com.example.app/.AdminReceiver
I have made com.example.app a privileged app. Is there a way that I can set this app up as a device owner in the ASOP ROM? So that when the device boots up for the first time or after a factory reset, the app will be automatically provisioned as the device owner.
Due to some limitations, I cannot modify this privileged app. So I'm looking for solutions that can be done outside the app.