diff options
author | Eric Erfanian <erfanian@google.com> | 2017-05-16 00:09:31 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-16 00:09:31 +0000 |
commit | c57430a61eab62e88372f386c75989dab6332608 (patch) | |
tree | b606f1899f80fcd0ea3ee753ce799883d5a673ab /java/com/android/dialer/util/PermissionsUtil.java | |
parent | 9842b4a7fd1d852b1353af806da4913b4298d516 (diff) | |
parent | 0c9dbf507b53a12bdf577ff3e55c1686a2e089de (diff) |
Merge "Update Dialer to v10 RC32" into oc-dev
am: 0c9dbf507b
Change-Id: I5f90090090c6e430d83fcdd294082c1f5237ade8
Diffstat (limited to 'java/com/android/dialer/util/PermissionsUtil.java')
-rw-r--r-- | java/com/android/dialer/util/PermissionsUtil.java | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/java/com/android/dialer/util/PermissionsUtil.java b/java/com/android/dialer/util/PermissionsUtil.java index 5741e734a..466e86204 100644 --- a/java/com/android/dialer/util/PermissionsUtil.java +++ b/java/com/android/dialer/util/PermissionsUtil.java @@ -30,12 +30,13 @@ import com.android.dialer.common.LogUtil; public class PermissionsUtil { private static final String PERMISSION_PREFERENCE = "dialer_permissions"; + private static final String CEQUINT_PERMISSION = "com.cequint.ecid.CALLER_ID_LOOKUP"; public static boolean hasPhonePermissions(Context context) { return hasPermission(context, permission.CALL_PHONE); } - public static boolean hasContactsPermissions(Context context) { + public static boolean hasContactsReadPermissions(Context context) { return hasPermission(context, permission.READ_CONTACTS); } @@ -51,6 +52,30 @@ public class PermissionsUtil { return hasPermission(context, permission.RECORD_AUDIO); } + public static boolean hasCallLogReadPermissions(Context context) { + return hasPermission(context, permission.READ_CALL_LOG); + } + + public static boolean hasCallLogWritePermissions(Context context) { + return hasPermission(context, permission.WRITE_CALL_LOG); + } + + public static boolean hasCequintPermissions(Context context) { + return hasPermission(context, CEQUINT_PERMISSION); + } + + public static boolean hasReadVoicemailPermissions(Context context) { + return hasPermission(context, permission.READ_VOICEMAIL); + } + + public static boolean hasWriteVoicemailPermissions(Context context) { + return hasPermission(context, permission.WRITE_VOICEMAIL); + } + + public static boolean hasAddVoicemailPermissions(Context context) { + return hasPermission(context, permission.ADD_VOICEMAIL); + } + public static boolean hasPermission(Context context, String permission) { return ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED; |