File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
madlocationmanager/src/main/java/mad/location/manager/lib Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -385,7 +385,7 @@ public KalmanLocationService() {
385385 @ Override
386386 public void onCreate () {
387387 super .onCreate ();
388- fusedLocationProvider = new FusedLocationProvider (this );
388+ fusedLocationProvider = new FusedLocationProvider (this , this );
389389 gpsLocationProvider = new GPSLocationProvider (this , this , this );
390390 m_sensorManager = (SensorManager ) getSystemService (SENSOR_SERVICE );
391391 m_powerManager = (PowerManager ) getSystemService (POWER_SERVICE );
Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ public void onLocationResult(LocationResult locationResult) {
4545
4646 @ Override
4747 public void onLocationAvailability (LocationAvailability locationAvailability ) {
48+ builder =new LocationSettingsRequest .Builder ()
49+ .addLocationRequest (m_locationRequest );
50+ client = LocationServices .getSettingsClient (context );
4851 task = client .checkLocationSettings (builder .build ());
4952 task .addOnSuccessListener (new OnSuccessListener <LocationSettingsResponse >() {
5053 @ Override
@@ -62,9 +65,10 @@ public void onFailure(@NonNull Exception e) {
6265 }
6366 };
6467
65- public FusedLocationProvider (Context context ) {
68+ public FusedLocationProvider (Context context , LocationProviderCallback m_locationProvider ) {
6669 this .m_fusedLocationProviderClient = LocationServices .getFusedLocationProviderClient (context );
6770 this .context = context ;
71+ this .m_locationProvider = m_locationProvider ;
6872 }
6973
7074 @ RequiresPermission (
@@ -88,9 +92,5 @@ public void stop() {
8892 public boolean isProviderEnabled () {
8993 return LocationManagerCompat .isLocationEnabled ((LocationManager ) context .getSystemService (Context .LOCATION_SERVICE ));
9094 }
91- public interface CheckLocationSettingCallback {
92- void onSuccess (LocationSettingsResponse locationSettingsResponse );
93- void onFailure (@ NonNull Exception e );
94- }
9595}
9696
You can’t perform that action at this time.
0 commit comments