Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 683d7704 authored by Tingting Wang's avatar Tingting Wang
Browse files

Fix permission bug when importing vcard.

Possible source and source uris to import vcard to Contacts App:
Gmail App, uri starts with "content://content://gmail-ls/", permission
granted by Gmail App.
Downloads, uri starts with "content://con.google.provider.downloads.documents/document/",
or "content://downloads/", permission granted by Downloads.
Hangouts, uri starts with "content://com.google.android.apps.hangouts.content.EsProvider/",
permission granted by Hangouts

Gmail, Downloads, Hangouts uris need permissions granted from the source, so should read
to locall before requesting Contacts App required permissions.

Messenger, uri starts with "content://com.google.android.apps.messaging.shared.datamodel.MediaScratchFileProvider",
no permission needed.
Drive, uri starts with "file:///data/user/0/com.google.android.apps.docs/files/", no permission needed.

Messenger, Drive uris don't need permission, so both (read to local first, and requesting contacts
required permission first) are OK for them.

Contacts required permssion(READ_CONTACTS and READ_EXTERNAL_STORAGE) is used to grant uri like "file:///storage"
permission, so should be granted first for this kind of uris.

Totally, for uris "file:///storage" READ_EXTERNAL_STORAGE permission should be requested first.
For others uris should be read to local using granted permissions first.

BUG 26905556

Change-Id: I0dcf794ad71ed8eef6f08c617b84ccafd1cf1bed
parent 0617a246
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment