title: How can I use adb to grant permission without root?
body: <p><strong><em>Background</em></strong>  </p>
  
  <p>I'm trying to create an app that can grant and revoke permissions of other apps.<br>
  To do this I'm using adb commands:</p>
  
  <pre><code>pm grant packageName permissionName
  </code></pre>
  
  <p>This works great if I call it through a shell with root permissions.  </p>
  
  <p><strong><em>Problem</em></strong>  </p>
  
  <p>The problem is that when I call this command without root permissions, I receive </p>
  
  <blockquote>
    <p>Operation not allowed: java.lang.SecurityException:
    grantRuntimePermission: Neither user 2000 nor current process has
    android.permission.GRANT_RUNTIME_PERMISSIONS</p>
  </blockquote>
  
  <p>This is to be expected (it would be a big problem otherwise).  </p>
  
  <p><strong><em>Question</em></strong>  </p>
  
  <p>Is it possible to allow my app to manage other apps permissions through Android settings?<br>
  I'm looking for something like granting USAGE_STATS permission to an app going to Settings -> Security -> "App with usage access", but for GRANT_RUNTIME_PERMISSIONS (and REVOKE_RUNTIME_PERMISSIONS).</p>