Merge branch 'fix-keyboard-layout' of s416084/find-my-tutor-android into develop
This commit is contained in:
commit
150caf187d
@ -38,6 +38,7 @@
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:windowSoftInputMode="adjustPan"
|
||||
android:name=".activity.MapActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
|
@ -65,11 +65,17 @@ public class BackgroundLocalizationService extends Service {
|
||||
private Handler mHandler = new Handler();
|
||||
private Runnable mStatusChecker;
|
||||
private FusedLocationProviderClient mFusedLocationClient;
|
||||
private Location fakeLoc = null;
|
||||
|
||||
public BackgroundLocalizationService() {
|
||||
providers.add(LocationManager.GPS_PROVIDER);
|
||||
providers.add(LocationManager.NETWORK_PROVIDER);
|
||||
providers.add(LocationManager.PASSIVE_PROVIDER);
|
||||
fakeLoc = new Location("");
|
||||
|
||||
fakeLoc.setLatitude(0);
|
||||
fakeLoc.setLongitude(0);
|
||||
fakeLoc.setAltitude(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -112,9 +118,13 @@ public class BackgroundLocalizationService extends Service {
|
||||
if (!stopService) {
|
||||
mStatusChecker = () -> {
|
||||
try {
|
||||
if (PrefUtils.getLocationLevel(getApplicationContext()).equals(SharingLevel.MANUAL.toString())) {
|
||||
sendCoordinateToBackend(fakeLoc);
|
||||
} else {
|
||||
mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);
|
||||
getLocalizationFromListeners();
|
||||
changeBackgroundMode();
|
||||
}
|
||||
} finally {
|
||||
mFusedLocationClient = null;
|
||||
destroyLocationListeners();
|
||||
@ -231,7 +241,6 @@ public class BackgroundLocalizationService extends Service {
|
||||
String locationLevel = PrefUtils.getLocationLevel(getApplicationContext());
|
||||
String status = (PrefUtils.isStatusEnabled(getApplicationContext())) ? PrefUtils.getUserStatus(getApplicationContext()) : "";
|
||||
|
||||
|
||||
if (locationLevel.equals(SharingLevel.PRESENCE.toString())) {
|
||||
if (!MapUtils.checkIfCoordinateIsValid(latitude, longitude)) {
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user