cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From infil00p <...@git.apache.org>
Subject [GitHub] cordova-android pull request: Current Cordova-Android 5.0 changes.
Date Thu, 24 Sep 2015 23:51:03 GMT
Github user infil00p commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/220#discussion_r40387288
  
    --- Diff: framework/src/org/apache/cordova/CordovaInterfaceImpl.java ---
    @@ -161,4 +164,35 @@ public ActivityResultHolder(int requestCode, int resultCode, Intent
intent) {
                 this.intent = intent;
             }
         }
    +
    +    /**
    +     * Called by the system when the user grants permissions
    +     *
    +     * @param requestCode
    +     * @param permissions
    +     * @param grantResults
    +     */
    +    public void onRequestPermissionResult(int requestCode, String[] permissions,
    +                                          int[] grantResults) throws JSONException {
    +        if(permissionResultCallback != null)
    +        {
    +            permissionResultCallback.onRequestPermissionResult(requestCode, permissions,
grantResults);
    +            permissionResultCallback = null;
    +        }
    +    }
    +
    +    public void requestPermission(CordovaPlugin plugin, int requestCode, String permission)
{
    +        permissionResultCallback = plugin;
    +        String[] permissions = new String [1];
    +        permissions[0] = permission;
    +        getActivity().requestPermissions(permissions, requestCode);
    +    }
    +
    +    public void requestPermissions(CordovaPlugin plugin, int requestCode)
    +    {
    +        permissionResultCallback = plugin;
    +        String[] permissions = plugin.getPermissionRequest();
    --- End diff --
    
    This is actually in response to Andrew's feedback that we do this.  Most of the plugins
don't actually have a set list of permissions, and most only have one permission.  This becomes
far more clear when you read the plugins that have permissions.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org


Mime
View raw message