Package io.rong.imkit.utils

## Class PermissionCheckUtil

- All Implemented Interfaces:

      public class PermissionCheckUtil

  Created by jiangecho on 2016/10/25.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `public interface` | `PermissionCheckUtil.IRequestPermissionListListener` | SDK申请权限前,用户可以设置此监听，在`onRequestPermissionList`方法实现中创建Dialog弹窗,用于向用户解释权限申请的原因.
    `public interface` | `PermissionCheckUtil.IPermissionEventCallback` | 权限申请原因解释Dialog的确定和取消的按钮事件通知.

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `public final static int` | `REQUEST_CODE_ASK_PERMISSIONS` |
    `public final static int` | `REQUEST_CODE_LOCATION_SHARE` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PermissionCheckUtil()` |

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `static boolean` | `requestPermissions(Fragment fragment, Array<String> permissions)` |
    `static boolean` | `requestPermissions(Fragment fragment, Array<String> permissions, int requestCode)` |
    `static boolean` | `requestPermissions(Activity activity, Array<String> permissions)` |
    `static boolean` | `requestPermissions(Activity activity, Array<String> permissions, int requestCode)` |
    `static boolean` | `checkPermissions(Context context, Array<String> permissions)` |
    `static Array<String>` | `getMediaStoragePermissions(Context context)` |
    `static boolean` | `checkMediaStoragePermissions(Context context)` |
    `static boolean` | `canDrawOverlays(Context context)` |
    `static boolean` | `canDrawOverlays(Context context, boolean needOpenPermissionSetting)` | 检查是否有悬浮窗权限
    `static void` | `showRequestPermissionFailedAlter(Context context, Array<String> permissions, Array<int> grantResults)` |
    `static boolean` | `checkPermissionResultIncompatible(Array<String> permissions, Array<int> grantResults)` | 权限授权回调参数匹配性检测.
    `static void` | `setRequestPermissionListListener(PermissionCheckUtil.IRequestPermissionListListener listener)` | 设置申请权限前拦截监听

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PermissionCheckUtil

          PermissionCheckUtil()

  - ### Method Detail

    - #### requestPermissions

           static boolean requestPermissions(Fragment fragment, Array<String> permissions)

    - #### requestPermissions

           static boolean requestPermissions(Fragment fragment, Array<String> permissions, int requestCode)

    - #### requestPermissions

           static boolean requestPermissions(Activity activity, Array<String> permissions)

    - #### requestPermissions

           static boolean requestPermissions(Activity activity, Array<String> permissions, int requestCode)

    - #### checkPermissions

           static boolean checkPermissions(Context context, Array<String> permissions)

    - #### getMediaStoragePermissions

           static Array<String> getMediaStoragePermissions(Context context)

    - #### checkMediaStoragePermissions

           static boolean checkMediaStoragePermissions(Context context)

    - #### canDrawOverlays

           static boolean canDrawOverlays(Context context)

    - #### canDrawOverlays

           static boolean canDrawOverlays(Context context, boolean needOpenPermissionSetting)

      检查是否有悬浮窗权限

      Parameters:
        `context` - 上下文
      Returns:

        boolean whether have the permission

    - #### showRequestPermissionFailedAlter

           static void showRequestPermissionFailedAlter(Context context, Array<String> permissions, Array<int> grantResults)

    - #### checkPermissionResultIncompatible

           static boolean checkPermissionResultIncompatible(Array<String> permissions, Array<int> grantResults)

      权限授权回调参数匹配性检测.

      Parameters:
        `grantResults` - 系统返回的授权结果。
      Returns:

        `true` 参数不匹配;`false` 参数检查匹配

    - #### setRequestPermissionListListener

           static void setRequestPermissionListListener(PermissionCheckUtil.IRequestPermissionListListener listener)

      设置申请权限前拦截监听