aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-11-10 22:54:21 +0100
committerChristian Schneppe <christian@pix-art.de>2018-11-10 22:54:21 +0100
commitb96341be9093d777a74ec8163f7a9003c1c27ed0 (patch)
tree0121937871e165d461a755d590082ccbd1296068 /src/main
parent58be0cd39fdb1b3862284f07dbc6fa2c08b6dbe5 (diff)
add missing location permissions checks
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/ui/LocationActivity.java3
1 files changed, 3 insertions, 0 deletions
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);