code: public boolean checkPermissions() {
          if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP_MR1)
              return true;
  
          for (String permission : mRequiredPermissions) {
              if (ContextCompat.checkSelfPermission(mContext, permission) != PackageManager.PERMISSION_GRANTED) {
                  mPermissionsToRequest.add(permission);
              }
          }
  
          if (mPermissionsToRequest.isEmpty()) {
              return true;
          }
  
          return false;
      }
docs: Checks if all the required permissions are granted.
  @return true if all the required permissions are granted, otherwise false