My app is a system app. I share picture with ExifInterface.TAG_GPS_LATITUDE , ExifInterface.TAG_GPS_LONGITUDE by bluetooth. However, there's no ExifInterface.TAG_GPS_LATITUDE & ExifInterface.TAG_GPS_LONGITUDE on the picture which other devices received .
There is my code .
android:sharedUserId="android.uid.system"
Intent intent = new Intent(Intent.ACTION_SEND_MULTIPLE);
intent.setType("*/*");
intent.putExtra(Intent.EXTRA_SUBJECT, context.getResources().getString(R.string.button_share_default));
// [test uri] content://media/external/images/media/564
intent.putParcelableArrayListExtra(Intent.EXTRA_STREAM, imageUris);
intent.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
Intent chooser = Intent.createChooser(intent, context.getResources().getString(R.string.button_share_default));
chooser.addFlags(Intent.FLAG_GRANT_WRITE_URI_PERMISSION | Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION);
context.startActivity(chooser);
I try to use <content://com.android.providers.media.documents/document/image%3A564
>, but logcat warn :
1415-7828/? W/ContentProviderHelper: Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider from ProcessRecord{660c88f 1668:com.android.bluetooth/1002} (pid=1668, uid=1002) requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs
1668-12407/? W/System.err: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.media.MediaDocumentsProvider from ProcessRecord{660c88f 1668:com.android.bluetooth/1002} (pid=1668, uid=1002) requires that you obtain access using ACTION_OPEN_DOCUMENT or related APIs