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
Loading
Please register or sign in to comment