From b96341be9093d777a74ec8163f7a9003c1c27ed0 Mon Sep 17 00:00:00 2001 From: Christian Schneppe Date: Sat, 10 Nov 2018 22:54:21 +0100 Subject: add missing location permissions checks --- src/main/java/de/pixart/messenger/ui/LocationActivity.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/main') diff --git a/src/main/java/de/pixart/messenger/ui/LocationActivity.java b/src/main/java/de/pixart/messenger/ui/LocationActivity.java index ed42c4636..ec8893e5e 100644 --- a/src/main/java/de/pixart/messenger/ui/LocationActivity.java +++ b/src/main/java/de/pixart/messenger/ui/LocationActivity.java @@ -27,6 +27,9 @@ public abstract class LocationActivity extends XmppActivity implements LocationL protected abstract void setmLastLocation(final Location location); protected void requestLocationUpdates() { + if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { + return; + } final Location lastKnownLocation = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if (lastKnownLocation != null) { setmLastLocation(lastKnownLocation); -- cgit v1.2.3