1
0
mirror of https://github.com/oliexdev/openScale.git synced 2025-08-18 22:41:44 +02:00

check for location service after coarse location permission is granted

This commit is contained in:
oliexdev
2019-02-03 15:52:06 +01:00
parent 66154385dc
commit 6cc875dbd9
2 changed files with 4 additions and 2 deletions

View File

@@ -327,7 +327,9 @@ public class BluetoothPreferences extends PreferenceFragment {
switch (requestCode) {
case PermissionHelper.PERMISSIONS_REQUEST_ACCESS_COARSE_LOCATION: {
if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
startBluetoothDiscovery();
if (PermissionHelper.requestLocationServicePermission(getActivity())) {
startBluetoothDiscovery();
}
} else {
Toast.makeText(getActivity(), R.string.permission_not_granted, Toast.LENGTH_SHORT).show();
btScanner.getDialog().dismiss();

View File

@@ -193,7 +193,7 @@
<string name="permission_not_granted">Permission not granted</string>
<string name="permission_bluetooth_info">Coarse location permission needed to search for Bluetooth devices. It can be revoked after the device is found.</string>
<string name="permission_location_service_info">Location service (GPS) needed to search for Bluetooth devices. Please enable it under the Android settings. It can be revoked after the device is found.</string>
<string name="permission_location_service_info">Location service needed to search for Bluetooth devices. Please enable it under the Android settings. It can be revoked after the device is found.</string>
<string name="permission_bluetooth_info_title">Info</string>
<string name="permission_read_write_data_description">read/write openScale data, including user information and all saved measurements</string>
<string name="permission_read_write_data_label">Read/Write openScale Data</string>