title: How to manage installed apps (with root permission if necessary )?
body: <p>Android users can go to the "manage application" (AKA "applications manager") screen, choose an app and make a choice of what to do there using the "App-info" screen.</p>
  
  <p>I wish to make an app that allows the user to make those choices in even an easier way (maybe even batch operations).</p>
  
  <p>How do I access each of the features there? Which permissions would I need and for features that are not available via the API, how could I get them via root access?</p>
  
  <p>The features I'm talking about are:</p>
  
  <ol>
  <li>Force stop.</li>
  <li>Uninstall last updates. </li>
  <li>Disable.</li>
  <li><p>Uninstall - for this I actually know how to do it, but it needs confirmation of course:</p>
  
  <pre><code>final Uri packageURI=Uri.parse("package:"+packageName);
  final Intent uninstallIntent=new Intent(Intent.ACTION_DELETE,packageURI);
  </code></pre></li>
  <li><p>Toggle "show notificaions".</p></li>
  <li>Clear data </li>
  <li>Clear cache</li>
  <li>Clear defaults. I would also like to know how to set as default and get all registered intents and their currently default apps (which will handle them). </li>
  <li>View app storage usage in both external &amp; internal storage (and cache)</li>
  </ol>
  
  <p>If you don't know what I mean, here's a screenshot of the app-info page:</p>
  
  <p><img src="https://i.stack.imgur.com/hppkum.png" alt="Enter image description here"></p>
  
  <hr>
  
  <p>I've also found some interesting Android permissions that existed ever since API 1, but I can't find any examples of how to use them. Such permissions are <a href="http://developer.android.com/reference/android/Manifest.permission.html#CLEAR_APP_CACHE" rel="nofollow noreferrer"><code>CLEAR_APP_CACHE</code></a> , <a href="http://developer.android.com/reference/android/Manifest.permission.html#DELETE_PACKAGES" rel="nofollow noreferrer"><code>DELETE_PACKAGES</code></a> , and <a href="http://developer.android.com/reference/android/Manifest.permission.html#CLEAR_APP_USER_DATA" rel="nofollow noreferrer"><code>CLEAR_APP_USER_DATA</code></a>. </p>
  
  <p>What I have found is a Samsung code example (available <a href="http://developer.samsung.com/android/samples/Circle-Launcher" rel="nofollow noreferrer">here</a>) that has a permission of <code>CLEAR_APP_CACHE</code>, but I can't find where they use it, if at all. </p>