Skip to content

Commit

Permalink
Merge branch 'refs/heads/rel/0.4' into feature/wifi
Browse files Browse the repository at this point in the history
# Conflicts:
#	app/src/main/java/de/fraunhofer/fokus/OpenMobileNetworkToolkit/DataProvider/DataProvider.java
  • Loading branch information
PeterHasse committed Jul 16, 2024
2 parents ee48eb2 + 27daefa commit 6ac0c9c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import android.telephony.CellSignalStrengthGsm;
import android.telephony.CellSignalStrengthLte;
import android.telephony.CellSignalStrengthNr;
import android.telephony.PhoneStateListener;
import android.telephony.PhysicalChannelConfig;
import android.telephony.SignalStrength;
import android.telephony.SubscriptionInfo;
Expand Down Expand Up @@ -104,6 +105,8 @@ public class DataProvider extends TelephonyCallback implements LocationListener,
private SliceInformation si = new SliceInformation();
private WifiInfo wi = null;


private LocationManager lm;
// Time stamp, should be updated on each update of internal data caches
private long ts = System.currentTimeMillis();
private LocationCallback locationCallback;
Expand All @@ -112,7 +115,6 @@ public class DataProvider extends TelephonyCallback implements LocationListener,
public DataProvider(Context context) {
GlobalVars gv = GlobalVars.getInstance();
ct = context;
LocationManager lm;
sp = PreferenceManager.getDefaultSharedPreferences(ct);
permission_phone_state = gv.isPermission_phone_state();

Expand Down Expand Up @@ -300,7 +302,6 @@ public List<Point> getNetworkInterfaceInformationPoints() {

/**
* Callback to receive current cell information
*
* @param list is the list of currently visible cells.
*/
@SuppressLint("ObsoleteSdkInt")
Expand Down Expand Up @@ -665,7 +666,6 @@ public Point getSignalStrengthPoint() {

/**
* get location object if available
*
* @return LocationInformation object
*/
public LocationInformation getLocation() {
Expand All @@ -674,7 +674,6 @@ public LocationInformation getLocation() {

/**
* return the location as influx point
*
* @return influx point of current location
*/
public Point getLocationPoint() {
Expand Down Expand Up @@ -708,6 +707,9 @@ public void onLocationChanged(@NonNull Location location) {
li.setProvider(location.getProvider());
li.setAccuracy(location.getAccuracy());
li.setSpeed(location.getSpeed());
if (lm != null) {
li.setProviderList(lm.getProviders(true));
}
}

public void onProviderDisabled(@NonNull String provider) {
Expand Down Expand Up @@ -995,7 +997,4 @@ public void addOnlyAvailablePoint(Point point, String key, int value) {
point.addField(key, value);
}
}

}


Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@

package de.fraunhofer.fokus.OpenMobileNetworkToolkit.DataProvider;

import java.util.List;

public class LocationInformation {
private double longitude;
private double latitude;
private double altitude;
private String provider;
private float accuracy;
private float speed;
private List<String> pl;

public LocationInformation(double longitude, double latitude, double altitude, String provider, float accuracy, float speed) {
this.longitude = longitude;
Expand All @@ -28,6 +31,14 @@ public LocationInformation(double longitude, double latitude, double altitude, S
public LocationInformation() {
}

public List<String> getProviderList() {
return pl;
}

public void setProviderList(List<String> pl) {
this.pl = pl;
}

public double getAltitude() {
return altitude;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,8 +358,9 @@ private CardView get_location_card_view() {
tl.addView(rowBuilder("Latitude", String.valueOf(loc.getLatitude())));
tl.addView(rowBuilder("Altitude", String.valueOf(loc.getAltitude())));
tl.addView(rowBuilder("Speed", String.valueOf(loc.getSpeed())));
tl.addView(rowBuilder("Provider", String.valueOf(loc.getProvider())));
tl.addView(rowBuilder("Accuracy", String.valueOf(loc.getAccuracy())));
tl.addView(rowBuilder("Provider List", String.valueOf(loc.getProviderList())));
tl.addView(rowBuilder("Provider", loc.getProvider()));
} else {
tl.addView(rowBuilder("Location not available",""));
}
Expand Down

0 comments on commit 6ac0c9c

Please sign in to comment.