Source:
private boolean verifyManifestPermissions() { final String methodName = ":verifyManifestPermissions"; final PackageManager packageManager = mContext.getPackageManager(); List<String> permerssionMissing = new ArrayList<String>(); Logger.v( TAG + methodName, "Broker related permissions checking starts."); if(PackageManager.PERMISSION_GRANTED != packageManager.checkPermission( "android.permission.GET_ACCOUNTS", mContext.getPackageName())) { permerssionMissing.add("GET_ACCOUNTS"); Logger.w( TAG + methodName, "Broker related permissions are missing for GET_ACCOUNTS", "", ADALError.DEVELOPER_BROKER_PERMISSIONS_MISSING); } if(PackageManager.PERMISSION_GRANTED != packageManager.checkPermission( "android.permission.MANAGE_ACCOUNTS", mContext.getPackageName())) { permerssionMissing.add("MANAGE_ACCOUNTS"); Logger.w( TAG + methodName, "Broker related permissions are missing for MANAGE_ACCOUNTS", "", ADALError.DEVELOPER_BROKER_PERMISSIONS_MISSING); } if(PackageManager.PERMISSION_GRANTED != packageManager.checkPermission( "android.permission.USE_CREDENTIALS", mContext.getPackageName())) { permerssionMissing.add("USE_CREDENTIALS"); Logger.w( TAG + methodName, "Broker related permissions are missing for USE_CREDENTIALS", "", ADALError.DEVELOPER_BROKER_PERMISSIONS_MISSING); } Logger.v( TAG + methodName, "Broker related permissions are verified"); if(permerssionMissing.isEmpty()) { return true; } else { throw new DeveloperAuthenticationException( ADALError.DEVELOPER_BROKER_PERMISSIONS_MISSING, "Broker related permissions are missing for " + permerssionMissing.toString()); } }

Target:
private boolean verifyManifestPermissions() throws UsageAuthenticationException { final String methodName = ":verifyManifestPermissions"; final PackageManager packageManager = mContext.getPackageManager(); List<String> permerssionMissing = new ArrayList<String>(); Logger.v( TAG + methodName, "Broker related permissions checking starts."); if(PackageManager.PERMISSION_GRANTED != packageManager.checkPermission( "android.permission.GET_ACCOUNTS", mContext.getPackageName())) { permerssionMissing.add("GET_ACCOUNTS"); Logger.w( TAG + methodName, "Broker related permissions are missing for GET_ACCOUNTS", "", ADALError.DEVELOPER_BROKER_PERMISSIONS_MISSING); } if(PackageManager.PERMISSION_GRANTED != packageManager.checkPermission( "android.permission.MANAGE_ACCOUNTS", mContext.getPackageName())) { permerssionMissing.add("MANAGE_ACCOUNTS"); Logger.w( TAG + methodName, "Broker related permissions are missing for MANAGE_ACCOUNTS", "", ADALError.DEVELOPER_BROKER_PERMISSIONS_MISSING); } if(PackageManager.PERMISSION_GRANTED != packageManager.checkPermission( "android.permission.USE_CREDENTIALS", mContext.getPackageName())) { permerssionMissing.add("USE_CREDENTIALS"); Logger.w( TAG + methodName, "Broker related permissions are missing for USE_CREDENTIALS", "", ADALError.DEVELOPER_BROKER_PERMISSIONS_MISSING); } Logger.v( TAG + methodName, "Broker related permissions are verified"); if(permerssionMissing.isEmpty()) { return true; } else { throw new UsageAuthenticationException( ADALError.DEVELOPER_BROKER_PERMISSIONS_MISSING, "Broker related permissions are missing for " + permerssionMissing.toString()); } }