diff options
author | keparal.li <keparal.li@mediatek.com> | 2023-09-12 13:37:46 +0800 |
---|---|---|
committer | Lin Lili <lili.lin@mediatek.com> | 2023-09-12 09:18:36 +0000 |
commit | 77b192fb9698fb38c63d6958f985e782df30b407 (patch) | |
tree | a7ca80e763a4f40d46c384604c966548b28b67c4 /src/com | |
parent | 9080e688fc5cd06e8babdece92e2ec1b162aa70a (diff) | |
download | Contacts-77b192fb9698fb38c63d6958f985e782df30b407.tar.gz |
Grant Permanent Write Uri Permission
ExportProcessor can't get write uri permission after ExportVcardActivity is destroyed. Sometimes export thread is not finished before ExportVcardActivity onDestroyed. Need grant persistable permission to avoid this scenario.
Bug: 300036667
Change-Id: I9fd5d4d8acccb75fbe1660d69247074b03a8f255
Diffstat (limited to 'src/com')
-rwxr-xr-x | src/com/android/contacts/vcard/ExportProcessor.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/contacts/vcard/ExportProcessor.java b/src/com/android/contacts/vcard/ExportProcessor.java index 0b96ea195..fd5134c38 100755 --- a/src/com/android/contacts/vcard/ExportProcessor.java +++ b/src/com/android/contacts/vcard/ExportProcessor.java @@ -81,6 +81,12 @@ public class ExportProcessor extends ProcessorBase { mExportRequest = exportRequest; mJobId = jobId; mCallingActivity = callingActivity; + try { + mResolver.takePersistableUriPermission(exportRequest.destUri, + Intent.FLAG_GRANT_WRITE_URI_PERMISSION); + } catch (SecurityException e) { + Log.w(LOG_TAG, "SecurityException error", e); + } } @Override |