package com.zkjc.common.utils;

import android.Manifest;

import com.jess.arms.utils.PermissionUtil;
import com.tbruyelle.rxpermissions2.RxPermissions;

import me.jessyan.rxerrorhandler.core.RxErrorHandler;

public class ZkjcPermissionUtil {

    /**
     * 请求获取蓝牙的权限
     */
    public static void getBluetooth(PermissionUtil.RequestPermission requestPermission, RxPermissions rxPermissions, RxErrorHandler errorHandler) {
        PermissionUtil.requestPermission(requestPermission, rxPermissions, errorHandler,
                Manifest.permission.BLUETOOTH,
                Manifest.permission.BLUETOOTH_ADMIN,
                Manifest.permission.ACCESS_COARSE_LOCATION);
    }

    /**
     * 请求获取位置信息的权限
     */
    public static void getLocation(PermissionUtil.RequestPermission requestPermission, RxPermissions rxPermissions, RxErrorHandler errorHandler) {
        PermissionUtil.requestPermission(requestPermission, rxPermissions, errorHandler,
                Manifest.permission.ACCESS_COARSE_LOCATION,
                Manifest.permission.ACCESS_FINE_LOCATION,
                Manifest.permission.ACCESS_NETWORK_STATE,
                Manifest.permission.INTERNET);
    }
}
