@@ -403,6 +403,37 @@ private static boolean shouldShowRationale(@NonNull Object object, @NonNull Stri
403
403
return shouldShowRationale ;
404
404
}
405
405
406
+ /**
407
+ * @param activity Activity
408
+ * @param perms Array of permissions
409
+ * @return true if the user has previously denied any of the {@code perms} and we should show a
410
+ * rationale, false otherwise.
411
+ */
412
+ public static boolean somePermissionDenied (@ NonNull Activity activity , @ NonNull String [] perms ) {
413
+ return shouldShowRationale (activity , perms );
414
+ }
415
+
416
+ /**
417
+ * @param fragment Fragment
418
+ * @param perms Array of permissions
419
+ * @return true if the user has previously denied any of the {@code perms} and we should show a
420
+ * rationale, false otherwise.
421
+ */
422
+ public static boolean somePermissionDenied (@ NonNull Fragment fragment , @ NonNull String [] perms ) {
423
+ return shouldShowRationale (fragment , perms );
424
+ }
425
+
426
+ /**
427
+ * @param fragment Fragment
428
+ * @param perms Array of permissions
429
+ * @return true if the user has previously denied any of the {@code perms} and we should show a
430
+ * rationale, false otherwise.
431
+ */
432
+ @ RequiresApi (api = Build .VERSION_CODES .M )
433
+ public static boolean somePermissionDenied (@ NonNull android .app .Fragment fragment , @ NonNull String [] perms ) {
434
+ return shouldShowRationale (fragment , perms );
435
+ }
436
+
406
437
private static boolean shouldShowRequestPermissionRationale (@ NonNull Object object ,
407
438
@ NonNull String perm ) {
408
439
if (object instanceof Activity ) {
0 commit comments