Skip to content

[v1.1] Sharing Contacts across Android User Profiles #17

@patrickd-

Description

@patrickd-

Expected task duration: 5 hours
Reward for accepted PR: US$150

Summary

It currently appears as if it's possible to share contacts via IPS, by literally sharing them: You open the Contacts app, select one or more contacts, and share them to the IPS app. This will result in a .vcf file being shared with other profiles. – Or so it seems. The size of the file being shared is displayed as "0B" and trying to download it in another profile simply does nothing.

Implementation Instructions

It currently appears that sharing contacts is not handled properly. This is likely because they require special handling, different from files – therefore a new share-type should be added. So far it was possible to share Files and Clipboard Texts, now a new class of sharing item should be introduced: Sharing Contacts.

  • A new button should be introduced to the UI, next to the existing two buttons for File and Clipboard sharing. The button should be labelled "Share Contact" and the description on the next line should say "Select a Contact to share with other profiles that have this App installed." Tapping the button should open the Contacts activity prompting the user to select one a contact to share.
    • Note that we can only support sharing a single contact on this route because that's what Android's built-in Contact Picker Intent allows for (this should be verified to be true once more but seems to be the case). If we wanted to allow selecting multiple contacts to share at once, we'd have to request access to all contacts and additionally implement a UI allowing the user to choose the contacts to share within – way too complex for what this app is supposed to be: simple. Or we'd have to integrate a third party library doing these things for us, but even then, we'd still need full contacts access and we'd be adding a dependency to third party code – something I'd really like to avoid in an app that is used by many security-conscious people.
  • When a contact is shared to IPS via a Sharing-Intent, as described in the summary above, this should be handled properly as a new type of sharing.
  • Once a contact is being shared, the app from which it is being shared from should display a notification with the text saying 'Sharing contact "[X]". Note that it's not necessary here to display a filesize for this type of sharing item. We should however display something ([X]) that identifies the contact being shared. Whether that is a "filename" or the name of the contact being shared doesn't matter – the best information the Intent provides about the contact should be used.
    • When multiple contacts are being shared, the text should change to "Sharing multiple contacts [X]...". Here [X] is the same as what we would display for a single contact, but it's just from the last contact we shared. This is the same logic used as for sharing clipboard texts. – Actually, if its easily possible to display an accurate count of contacts being shared the message should say "Sharing [count] contacts [X]..."
    • Like with the other "Sharing..." notifications, the notification should have a "Stop Sharing" button.
  • On the receiving side, when a single contact is being shared in another profile, a Notification should be displayed titled "New shared contact" with [X] in its description (whatever X is based on the information provided by the intent above).
    • The notification should have two buttons, one saying "Add Contact" (which causes a ACTION_INSERT_OR_EDIT Intent to be sent to the Contacts app), and the other saying "Share via..." which allows sharing the contact with another app in the same profile (same as for text/file items).
    • To batch insert multiple contacts at once would require WRITE_CONTACTS permission. I'd generally like to avoid adding new permission requirements to this app and I think in most cases users will only be sharing one, maybe two contacts between profiles at once. Therefore the app will create a separate notification for each contact that is being shared.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions