+ if (ActivityCompat.checkSelfPermission(this,
+ Manifest.permission.BLUETOOTH)
+ == PackageManager.PERMISSION_GRANTED)
+ {
+ have_bluetooth_permission = true;
+ }
+ if (ActivityCompat.checkSelfPermission(this,
+ BLUETOOTH_CONNECT)
+ == PackageManager.PERMISSION_GRANTED)
+ {
+ have_bluetooth_connect_permission = true;
+ }
+ if (ActivityCompat.checkSelfPermission(this,
+ BLUETOOTH_SCAN)
+ == PackageManager.PERMISSION_GRANTED)
+ {
+ have_bluetooth_scan_permission = true;
+ }
+ int count = 0;
+ if (!have_location_permission)
+ count += 1;
+ if (!have_storage_permission)
+ count += 1;
+ if (!have_bluetooth_permission)
+ count += 1;
+ if (!have_bluetooth_connect_permission)
+ count += 1;
+ if (!have_bluetooth_scan_permission)
+ count += 1;