title: Unable to set device owner through programmatically
body: <p>I tried to execute the following code to set my app as a device owner. I can't use ADB because I have more than 10K android-9  non rooted devices. So, Need to do this programmatically.</p>
  
  <pre><code>   String name = AdminReceiver.class.getName();
     if (name.startsWith(BuildConfig.APPLICATION_ID)) {
             name = name.substring(BuildConfig.APPLICATION_ID.length());
     }
     final String command = "dpm set-device-owner " + BuildConfig.APPLICATION_ID + '/' + name;
     Process process = Runtime.getRuntime().exec(command);
     Log.d(TAG,"RETURN VALUE:"process.waitFor();
  </code></pre>
  
  <p>process.waitFor() always return 1.  </p>