Improve Contacts' permission handling
Instead of repeatedly asking the user for the same permissions
over-and-over, instead only ask them once when they open an activity.
If they give us all the permissions we require, then allow them to continue.
If not, close the activity and show the user a toast.
Bug: 21791169
Change-Id: Idae927d525124ed8a7081bd5a8edbd24e1ba3190
diff --git a/res-common/values/strings.xml b/res-common/values/strings.xml
index fe2b568..de7a44d 100644
--- a/res-common/values/strings.xml
+++ b/res-common/values/strings.xml
@@ -459,6 +459,10 @@
exported because of security/permission reasons. [CHAR LIMIT=NONE] -->
<string name="fail_reason_no_exportable_contact">There is no exportable contact.</string>
+ <!-- The user doesn't have all permissions required to use the current screen. So
+ close the current screen and show the user this message. -->
+ <string name="missing_required_permission">You have disabled a required permission.</string>
+
<!-- The failed reason shown when some error happend during contacts export.
Some exact reason must follow this. [CHAR LIMIT=NONE] -->
<string name="fail_reason_error_occurred_during_export">An error occurred during export: \"<xliff:g id="exact_reason">%s</xliff:g>\".</string>