File tree 2 files changed +6
-6
lines changed
madlocationmanager/src/main/java/mad/location/manager/lib
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -385,7 +385,7 @@ public KalmanLocationService() {
385
385
@ Override
386
386
public void onCreate () {
387
387
super .onCreate ();
388
- fusedLocationProvider = new FusedLocationProvider (this );
388
+ fusedLocationProvider = new FusedLocationProvider (this , this );
389
389
gpsLocationProvider = new GPSLocationProvider (this , this , this );
390
390
m_sensorManager = (SensorManager ) getSystemService (SENSOR_SERVICE );
391
391
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) {
45
45
46
46
@ Override
47
47
public void onLocationAvailability (LocationAvailability locationAvailability ) {
48
+ builder =new LocationSettingsRequest .Builder ()
49
+ .addLocationRequest (m_locationRequest );
50
+ client = LocationServices .getSettingsClient (context );
48
51
task = client .checkLocationSettings (builder .build ());
49
52
task .addOnSuccessListener (new OnSuccessListener <LocationSettingsResponse >() {
50
53
@ Override
@@ -62,9 +65,10 @@ public void onFailure(@NonNull Exception e) {
62
65
}
63
66
};
64
67
65
- public FusedLocationProvider (Context context ) {
68
+ public FusedLocationProvider (Context context , LocationProviderCallback m_locationProvider ) {
66
69
this .m_fusedLocationProviderClient = LocationServices .getFusedLocationProviderClient (context );
67
70
this .context = context ;
71
+ this .m_locationProvider = m_locationProvider ;
68
72
}
69
73
70
74
@ RequiresPermission (
@@ -88,9 +92,5 @@ public void stop() {
88
92
public boolean isProviderEnabled () {
89
93
return LocationManagerCompat .isLocationEnabled ((LocationManager ) context .getSystemService (Context .LOCATION_SERVICE ));
90
94
}
91
- public interface CheckLocationSettingCallback {
92
- void onSuccess (LocationSettingsResponse locationSettingsResponse );
93
- void onFailure (@ NonNull Exception e );
94
- }
95
95
}
96
96
You can’t perform that action at this time.
0 commit comments