title: ActivityManager.forceStopPackage() from Task Manager
body: <p>This is my first time posting here. I'm not sure if this is the right place to ask this question, but I don't seem to find other more appropriate places. Here's my question anyways.</p>
  
  <p>I understand that the API <code>ActivityManager.forceStopPackage()</code> is an internal one and can be called only from system process. However, it puzzles me that the built-in Task Manager app (with package name <code>com.motorola.PerformanceManager</code>) on my <strong>motorola atrix</strong> phone can directly call it without being a system process. There are two things that I verified. </p>
  
  <p>First, it is non-system process from <code>ps</code> command:</p>
  
  <pre><code>app_64 13681 1379 170788 29820 ffffffff 00000000 S com.motorola.PerformanceManager
  </code></pre>
  
  <p>Second, it indeed calls the <code>ActivityManager.forceStopPackage()</code> API from its odex file (decompiled into smali, then into dex, and then into java). From the smali code, it is already clear that it calls this API.</p>
  
  <p>I also checked its <code>AndroidManifest.xml</code> file which seems nothing special to me (the forum mistakenly recognizes the content as URLs and prevents me from posting them). </p>
  
  <p>The manifest file does include the <code>android.permission.FORCE_STOP_PACKAGES</code> permission which is supposed to be a system one. A non-system app will still get permission denial error even with this permission. I tried using reflection to access this API with <code>android.permission.FORCE_STOP_PACKAGES</code> permission but still get the runtime error.</p>
  
  <p>Now, how can the built-in Task Manager app call the internal API without being a system process. 
  One possibility is that the app is signed with the same platform private key. However, I'm not sure how I can verify that. Further, it is still supposed to be a system process with additional descriptions in the manifest file.</p>
  
  <p>Hope someone can answer my question. Thanks.</p>