@Ignore @Test public void testIsSingleGranted() { assertThat(Permissions.isSingleGranted(new int[0]), is(false)); assertThat(Permissions.isSingleGranted(new int[]{PackageManager.PERMISSION_DENIED}), is(false)); assertThat( Permissions.isSingleGranted(new int[]{ PackageManager.PERMISSION_DENIED, PackageManager.PERMISSION_GRANTED }), is(false) ); assertThat(Permissions.isSingleGranted(new int[]{PackageManager.PERMISSION_GRANTED}), is(false)); }
@CheckResult public static boolean isSingleGranted(@NonNull final int[] grantResults) { return grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED; }
Permissions { @CheckResult public static boolean isSingleGranted(@NonNull final int[] grantResults) { return grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED; } }
Permissions { @CheckResult public static boolean isSingleGranted(@NonNull final int[] grantResults) { return grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED; } private  Permissions(); }
Permissions { @CheckResult public static boolean isSingleGranted(@NonNull final int[] grantResults) { return grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED; } private  Permissions(); @CheckResult static boolean hasAnyOf(@NonNull final Context context, @NonNull @Size(min = 1) final String... permissions); @CheckResult static boolean hasAllOf(@NonNull final Context context, @NonNull @Size(min = 1) final String... permissions); @CheckResult static boolean has(@NonNull final Context context, @NonNull final String permission); @CheckResult static boolean isSingleGranted(@NonNull final int[] grantResults); }
Permissions { @CheckResult public static boolean isSingleGranted(@NonNull final int[] grantResults) { return grantResults.length == 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED; } private  Permissions(); @CheckResult static boolean hasAnyOf(@NonNull final Context context, @NonNull @Size(min = 1) final String... permissions); @CheckResult static boolean hasAllOf(@NonNull final Context context, @NonNull @Size(min = 1) final String... permissions); @CheckResult static boolean has(@NonNull final Context context, @NonNull final String permission); @CheckResult static boolean isSingleGranted(@NonNull final int[] grantResults);  }