4

I'm getting the following exception during an ACTION_SEND intent with a data type application/pdf:

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.SEND typ=application/pdf flg=0x3080000 cmp=com.adobe.reader/.ARSendForSignature (has extras) }

This brings up a dialog to choose the desired application to receive the PDF. I believe the SecurityException is being thrown when a user chooses Adobe Reader from the list, although it appears to be opening specifically the ARSendForSignature activity.

Any ideas?

ashughes
  • 7,155
  • 9
  • 48
  • 54

1 Answers1

13

You are encountering a bug in the Adobe Reader app, or a bug in Android, depending upon your perspective.

The Adobe Reader ARSendForSignature activity supports the ACTION_SEND <intent-filter>, but they explicitly have android:exported="false", which denies anyone but them the ability to start that activity.

Either:

  1. Adobe Reader should not have that <intent-filter>, or
  2. Adobe Reader should not have marked it as not exported, or
  3. The Android chooser should filter out non-exported activities

Long-term, the answer should be #3 -- I'll work on reproducing this problem and will file an issue, assuming there isn't already one. Short-term, Adobe can fix this faster than we can fix a couple hundred million devices. :-)

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • 5
    Reproduced and issue filed: http://code.google.com/p/android/issues/detail?id=29535 – CommonsWare Apr 25 '12 at 17:00
  • Thanks for the quick response and for filing the bug. Is there any way I can at least catch the exception to prevent my app from crashing? Since it's not thrown by the `startActivity` call with the send intent, but rather the `startActivity` call within the chooser...is there any way to do this? – ashughes Apr 25 '12 at 17:10
  • @ashughes: Based on the stack trace I am seeing, my guess is "no", outside of whatever global exception handler you might have in place (e.g., for ACRA). – CommonsWare Apr 25 '12 at 17:15