Changed Provision app  so it can trigger device owner provisioning

The Provision app is a setup wizard that by default just set the
provisioning Settings, but with this change its behavior can be
changed to trigger Device Owner provisioning.

For example, to provision Device Owner using the TestDPC app, run the
steps below after first boot:

    adb root
    adb install PATH_TO_TESTDPC_APK
    adb shell settings put secure tmp_provision_set_do 1
    adb shell settings put secure tmp_provision_package com.afwsamples.testdpc
    adb shell settings put secure tmp_provision_receiver com.afwsamples.testdpc.DeviceAdminReceiver
    adb shell settings put secure tmp_provision_trigger 2
    adb shell rm /data/system/device_policies.xml
    adb shell settings put global device_provisioned 0
    adb shell settings put secure user_setup_complete 0
    adb shell pm enable com.android.provision
    adb shell pm enable com.android.provision/.DefaultActivity
    adb shell stop && adb shell start

Test: manual verification (see above)
Bug: 170333009

Change-Id: I248b4816a3767d9ff742b391ecea1d83a09b7613
5 files changed