title: Android: java.lang.SecurityException: Permission Denial: start Intent
body: <p>I have created an application containing GWVectraNotifier activity which is called from other applications to display Notification.</p>
  
  <p>In the Notification dialog, there will be 'show' button and 'close' button.</p>
  
  <p>Onclick of 'show' button, the corresponding activity will be started.</p>
  
  <p>To check the functionality of the above application, </p>
  
  <p>I started the GWVectraNotifier activity from K9Mail application on checkmail event trigger.</p>
  
  <p>I am able to start the GWVectraNotifier activity successfully, but onclick of 'show' button i will have to start 'MessageList' activity of K9mail.To do so, i wrote the below code:</p>
  
  <pre><code>Intent i = new Intent();
  i.setComponent(new ComponentName("com.fsck.k9", "com.fsck.k9.activity.MessageList"));
  i.putExtra("account", accUuid);
  i.putExtra("folder", accFolder);
  startActivity(i); 
  </code></pre>
  
  <p>which throws :</p>
  
  <pre><code>WARN/ActivityManager(59): Permission denied: checkComponentPermission() reqUid=10050
  WARN/ActivityManager(59): Permission Denial: starting Intent { cmp=com.fsck.k9/.activity.MessageList (has extras) } from ProcessRecord{43f6d7c8 675:com.i10n.notifier/10052} (pid=675, uid=10052) requires null
  WARN/System.err(675): java.lang.SecurityException: Permission Denial: starting Intent { cmp=com.fsck.k9/.activity.MessageList (has extras) } from ProcessRecord{43f6d7c8 675:com.i10n.notifier/10052} (pid=675, uid=10052) requires null
  WARN/System.err(675):     at android.os.Parcel.readException(Parcel.java:1247)
  WARN/System.err(675):     at android.os.Parcel.readException(Parcel.java:1235)
  WARN/System.err(675):     at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1298)
  WARN/System.err(675):     at android.app.Instrumentation.execStartActivity(Instrumentation.java:1373)
  WARN/System.err(675):     at android.app.Activity.startActivityForResult(Activity.java:2817)
  WARN/System.err(675):     at android.app.Activity.startActivity(Activity.java:2923)
  WARN/System.err(675):     at com.i10n.notifier.GWVectraNotifier$2$1.run(GWVectraNotifier.java:63)
  WARN/System.err(675):     at android.app.Activity.runOnUiThread(Activity.java:3707)
  WARN/System.err(675):     at com.i10n.notifier.GWVectraNotifier$2.onClick(GWVectraNotifier.java:53)
  WARN/System.err(675):     at android.view.View.performClick(View.java:2408)
  WARN/System.err(675):     at android.view.View$PerformClick.run(View.java:8816)
  WARN/System.err(675):     at android.os.Handler.handleCallback(Handler.java:587)
  WARN/System.err(675):     at android.os.Handler.dispatchMessage(Handler.java:92)
  WARN/System.err(675):     at android.os.Looper.loop(Looper.java:123)
  WARN/System.err(675):     at android.app.ActivityThread.main(ActivityThread.java:4627)
  WARN/System.err(675):     at java.lang.reflect.Method.invokeNative(Native Method)
  WARN/System.err(675):     at java.lang.reflect.Method.invoke(Method.java:521)
  WARN/System.err(675):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
  WARN/System.err(675):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
  WARN/System.err(675):     at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>Actually i am not able to understand what permissions to include in my Notifier application's manifest file to access MessageList of k9Mail. I am pasting below the permissions included in k9mail application's manifest file:    </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.READ_CONTACTS"/&gt;
  &lt;uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/&gt;
  &lt;uses-permission android:name="android.permission.READ_OWNER_DATA"/&gt;
  &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/&gt;
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.VIBRATE"/&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="org.thialfihar.android.apg.permission.READ_KEY_DETAILS"/&gt;
  &lt;permission android:name="com.fsck.k9.permission.READ_ATTACHMENT"
              android:permissionGroup="android.permission-group.MESSAGES"
              android:protectionLevel="dangerous"
              android:label="@string/read_attachment_label"
              android:description="@string/read_attachment_desc"/&gt;
  &lt;uses-permission android:name="com.fsck.k9.permission.READ_ATTACHMENT"/&gt;
  &lt;permission android:name="com.fsck.k9.permission.REMOTE_CONTROL"
               android:permissionGroup="android.permission-group.MESSAGES"
               android:protectionLevel="dangerous"
               android:label="@string/remote_control_label"
               android:description="@string/remote_control_desc"/&gt;
  &lt;uses-permission android:name="com.fsck.k9.permission.REMOTE_CONTROL"/&gt;
  &lt;permission android:name="com.fsck.k9.permission.READ_MESSAGES"
              android:permissionGroup="android.permission-group.MESSAGES"
              android:protectionLevel="normal"
              android:label="@string/read_messages_label"
              android:description="@string/read_messages_desc"/&gt;
  &lt;uses-permission android:name="com.fsck.k9.permission.READ_MESSAGES"/&gt;
  &lt;permission android:name="com.fsck.k9.permission.DELETE_MESSAGES"
              android:permissionGroup="android.permission-group.MESSAGES"
              android:protectionLevel="normal"
              android:label="@string/delete_messages_label"
              android:description="@string/read_messages_desc"/&gt;
  &lt;uses-permission android:name="com.fsck.k9.permission.DELETE_MESSAGES"/&gt;           
  </code></pre>
  
  <p>Can some one tell me which permission to include in my app? In the above permissions some are only for k9mail , because those are the permission classes written for k9. So, i will only be able to include the built-in permissions of android in the above given permissions. I tried by doing so as well, but it didn't solve my issue :( </p>