Remove unused private Method PermissionHelper.deliverPermissionResult (#1858)

- The method deliverPermissionResult is private and nowhere used. Because it's private, it cannot be called from outside and cannot be overwritten and is safe to remove.
This commit is contained in:
Manuel Beck
2026-04-20 18:03:30 +02:00
committed by GitHub
parent 190076ba18
commit 9c3d82680e
@@ -29,8 +29,6 @@ import android.content.pm.PackageManager;
* written for cordova-android 5.0.0+ can still compile with earlier cordova-android versions.
*/
public class PermissionHelper {
private static final String LOG_TAG = "CordovaPermissionHelper";
/**
* Requests a "dangerous" permission for the application at runtime. This is a helper method
* alternative to cordovaInterface.requestPermission() that does not require the project to be
@@ -71,18 +69,4 @@ public class PermissionHelper {
public static boolean hasPermission(CordovaPlugin plugin, String permission) {
return plugin.cordova.hasPermission(permission);
}
private static void deliverPermissionResult(CordovaPlugin plugin, int requestCode, String[] permissions) {
// Generate the request results
int[] requestResults = new int[permissions.length];
Arrays.fill(requestResults, PackageManager.PERMISSION_GRANTED);
try {
// This one is deprecated - see https://github.com/apache/cordova-android/issues/592
plugin.onRequestPermissionResult(requestCode, permissions, requestResults);
plugin.onRequestPermissionsResult(requestCode, permissions, requestResults);
} catch (JSONException e) {
LOG.e(LOG_TAG, "JSONException when delivering permissions results", e);
}
}
}