Skip to content

Commit 880519d

Browse files
committed
suppress lint on missing permission
1 parent 6726085 commit 880519d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

WordPressUtils/src/main/java/org/wordpress/android/util/helpers/LocationHelper.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//This Handy-Dandy class acquired and tweaked from http://stackoverflow.com/a/3145655/309558
22
package org.wordpress.android.util.helpers;
33

4+
import android.annotation.SuppressLint;
45
import android.app.Activity;
56
import android.content.Context;
67
import android.location.Location;
@@ -18,9 +19,8 @@ public class LocationHelper {
1819
boolean mGpsEnabled = false;
1920
boolean mNetworkEnabled = false;
2021

22+
@SuppressLint("MissingPermission")
2123
public boolean getLocation(Activity activity, LocationResult result) {
22-
23-
2424
mLocationResult = result;
2525
if (mLocationManager == null) {
2626
mLocationManager = (LocationManager) activity.getSystemService(Context.LOCATION_SERVICE);
@@ -55,6 +55,7 @@ public boolean getLocation(Activity activity, LocationResult result) {
5555
}
5656

5757
LocationListener locationListenerGps = new LocationListener() {
58+
@SuppressLint("MissingPermission")
5859
public void onLocationChanged(Location location) {
5960
mTimer.cancel();
6061
mLocationResult.gotLocation(location);
@@ -73,6 +74,7 @@ public void onStatusChanged(String provider, int status, Bundle extras) {
7374
};
7475

7576
LocationListener locationListenerNetwork = new LocationListener() {
77+
@SuppressLint("MissingPermission")
7678
public void onLocationChanged(Location location) {
7779
mTimer.cancel();
7880
mLocationResult.gotLocation(location);
@@ -92,6 +94,7 @@ public void onStatusChanged(String provider, int status, Bundle extras) {
9294

9395
class GetLastLocation extends TimerTask {
9496
@Override
97+
@SuppressLint("MissingPermission")
9598
public void run() {
9699
mLocationManager.removeUpdates(locationListenerGps);
97100
mLocationManager.removeUpdates(locationListenerNetwork);
@@ -130,6 +133,7 @@ public static abstract class LocationResult {
130133
public abstract void gotLocation(Location location);
131134
}
132135

136+
@SuppressLint("MissingPermission")
133137
public void cancelTimer() {
134138
if (mTimer != null) {
135139
mTimer.cancel();

0 commit comments

Comments
 (0)