Add request for location permissions for smartphone controller.
@@ -1086,6 +1086,7 @@ public abstract class CameraActivity extends AppCompatActivity
} else if (parent == driveModeSpinner) {
DriveMode driveMode = DriveMode.valueOf(parent.getItemAtPosition(pos).toString().toUpperCase());
if ("SMARTPHONE".equals(driveMode.name())) {
+ requestPermissionsForSmartphone();
smartphoneController.connect(this);
}
setDriveMode(driveMode);
@@ -1096,6 +1097,12 @@ public abstract class CameraActivity extends AppCompatActivity
}
}
+ private void requestPermissionsForSmartphone () {
+ if (!hasLocationPermission()) {
+ requestLocationPermission();
+ }
+ }
+
@Override
public void onNothingSelected(AdapterView<?> parent) {
// Do nothing.
