diff options
Diffstat (limited to 'java/com/android/dialer/util/PermissionsUtil.java')
-rw-r--r-- | java/com/android/dialer/util/PermissionsUtil.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/java/com/android/dialer/util/PermissionsUtil.java b/java/com/android/dialer/util/PermissionsUtil.java index 09c2b7f42..7e8aae943 100644 --- a/java/com/android/dialer/util/PermissionsUtil.java +++ b/java/com/android/dialer/util/PermissionsUtil.java @@ -91,6 +91,10 @@ public class PermissionsUtil { return hasPermission(context, permission.READ_CONTACTS); } + public static boolean hasContactsWritePermissions(Context context) { + return hasPermission(context, permission.WRITE_CONTACTS); + } + public static boolean hasLocationPermissions(Context context) { return hasPermission(context, permission.ACCESS_FINE_LOCATION); } @@ -127,6 +131,10 @@ public class PermissionsUtil { return hasPermission(context, permission.ADD_VOICEMAIL); } + public static boolean hasSendSmsPermissions(Context context) { + return hasPermission(context, permission.SEND_SMS); + } + public static boolean hasPermission(Context context, String permission) { return ContextCompat.checkSelfPermission(context, permission) == PackageManager.PERMISSION_GRANTED; |