@Test @SuppressWarnings("all") public void isPermissionGranted() throws Exception { final String permission = "permission"; final Single<Boolean> result = permissionStatusChecker.isPermissionGranted(permission); verify(context).checkPermission(eq(permission), anyInt(), anyInt()); }
@NonNull public Single<Boolean> isPermissionGranted(@NonNull String manifestPermission) { return Single.just(ContextCompat.checkSelfPermission(context, manifestPermission) == PackageManager.PERMISSION_GRANTED); }
PermissionStatusChecker { @NonNull public Single<Boolean> isPermissionGranted(@NonNull String manifestPermission) { return Single.just(ContextCompat.checkSelfPermission(context, manifestPermission) == PackageManager.PERMISSION_GRANTED); } }
PermissionStatusChecker { @NonNull public Single<Boolean> isPermissionGranted(@NonNull String manifestPermission) { return Single.just(ContextCompat.checkSelfPermission(context, manifestPermission) == PackageManager.PERMISSION_GRANTED); } @Inject  PermissionStatusChecker(@NonNull Context context); }
PermissionStatusChecker { @NonNull public Single<Boolean> isPermissionGranted(@NonNull String manifestPermission) { return Single.just(ContextCompat.checkSelfPermission(context, manifestPermission) == PackageManager.PERMISSION_GRANTED); } @Inject  PermissionStatusChecker(@NonNull Context context); @NonNull Single<Boolean> isPermissionGranted(@NonNull String manifestPermission); }
PermissionStatusChecker { @NonNull public Single<Boolean> isPermissionGranted(@NonNull String manifestPermission) { return Single.just(ContextCompat.checkSelfPermission(context, manifestPermission) == PackageManager.PERMISSION_GRANTED); } @Inject  PermissionStatusChecker(@NonNull Context context); @NonNull Single<Boolean> isPermissionGranted(@NonNull String manifestPermission);  }