Skip to content

Commit

Permalink
删除utils方法
Browse files Browse the repository at this point in the history
  • Loading branch information
liulei committed Jul 12, 2024
1 parent b26da89 commit da749d7
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions core/src/main/java/cn/com/heaton/blelibrary/ble/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,23 +61,4 @@ public static boolean isPermission(Context context, String permission) {
return Build.VERSION.SDK_INT < Build.VERSION_CODES.M || ContextCompat.checkSelfPermission(context, permission) == PERMISSION_GRANTED;
}

public static void reqBlePermission(Context context) {
List<String> mPermissionList = new ArrayList<>();
// Android 版本大于等于 12 时,申请新的蓝牙权限
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
mPermissionList.add(Manifest.permission.BLUETOOTH_SCAN);
mPermissionList.add(Manifest.permission.BLUETOOTH_ADVERTISE);
mPermissionList.add(Manifest.permission.BLUETOOTH_CONNECT);
//根据实际需要申请定位权限
//mPermissionList.add(Manifest.permission.ACCESS_COARSE_LOCATION);
//mPermissionList.add(Manifest.permission.ACCESS_FINE_LOCATION);
} else {
mPermissionList.add(Manifest.permission.ACCESS_COARSE_LOCATION);
mPermissionList.add(Manifest.permission.ACCESS_FINE_LOCATION);
}



}

}

0 comments on commit da749d7

Please sign in to comment.