title: Android - Read attachment from email client app with my app
body: <p>I'd like to open an attachment (e.g InputStream) from android E-mail app with my app.
  I'm able to associate my app to open a specific file from E-mail, but when i get uri like <p><code>content://com.samsung.android.email.attachmentprovider/1/176/RAW</code> </p> i'm not able to open the stream and SecurityException is thrown:<br/><code>Permission Denial: opening provider
   com.samsung.android.email.provider.provider.attachment.AttachmentProvider 
   from ProcessRecord{83b03a2 11090:com.test.att/u0a416}
   (pid=11090, uid=10416) requires com.samsung.android.email.permission.ACCESS_PROVIDER or com.samsung.android.email.permission.ACCESS_PROVIDER</code>.<br/>
  I tried to add this permission in manifest file and grant read permission before using ContentProvider in code but another exception is thrown: <p>
  <code>Uid xxx does not have permission to uri 0 @ content://......</code>
  <p>
  Example:<br/>
  <code>Uri uri = mInitApp.geIntent().getData();
  mCtx.grantUriPermission(mCtx.getPackageName(), uri,Intent.FLAG_GRANT_READ_URI_PERMISSION);
  InputStream in = mCtx.getContentResolver().openInputStream(uri);</code>
  </p>
  
  <p>The strange thing is if i try many times to open the attachment with my app, granting permission, sometimes i'm able to read attachment (uri remain the same).<br/>
  For a practical usage i don't want to download manually attachment and select it from Download folder.<br/>
  Am i missing something?<br/>
  Thanks</p>