Lines Matching refs:permission
29 * Listener that gets notified when we check whether we have permission.
32 void onPermissionCheck(String permission, boolean granted);
39 new String[] { Manifest.permission.READ_CONTACTS };
51 * <p>This is interesting for us because new permission model is introduced in M and we need to
59 * Returns {@link PackageManager#PERMISSION_GRANTED} if given permission is granted, or
62 public static int checkPermission(Context context, String permission) {
64 // TODO: Use "context.checkSelfPermission(permission)" once it's safe to move to M sdk
65 return context.checkPermission(permission, Process.myPid(), Process.myUid());
67 // Assume that we have permission before M.
80 for (String permission : REQUIRED_PERMISSIONS) {
82 checkPermission(context, permission) == PackageManager.PERMISSION_GRANTED;
84 permissionsCheckListener.onPermissionCheck(permission, granted);