1 2 3 4 5 6 7 8 9 10 11 12 13
| public class PermissionUtil {
public static boolean hasPermission(Context context, String... permissions) { for (String permission : permissions) { if (context.checkCallingOrSelfPermission(permission) == PackageManager.PERMISSION_DENIED) { Log.w("Permission Check", "lack of permission: " + permission); return false; } } return true; }
}
|