Skip to content

Commit 8078073

Browse files
committed
Fix lint errors
1 parent f5ad796 commit 8078073

File tree

5 files changed

+15
-7
lines changed

5 files changed

+15
-7
lines changed

play-services-core/src/main/AndroidManifest.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@
134134

135135
<!-- Location -->
136136

137-
<activity
138-
android:name="org.microg.nlp.ui.BackendSettingsActivity"
139-
android:process=":ui" />
140-
141137
<activity
142138
android:name="org.microg.gms.ui.PlacePickerActivity"
143139
android:exported="true"

play-services-location/core/src/main/kotlin/org/microg/gms/location/network/wifi/WifiScannerSource.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55

66
package org.microg.gms.location.network.wifi
77

8+
import android.annotation.SuppressLint
89
import android.content.Context
910
import android.net.wifi.ScanResult
1011
import android.net.wifi.WifiScanner
1112
import android.os.WorkSource
1213
import android.util.Log
1314
import org.microg.gms.location.network.TAG
1415

16+
@SuppressLint("WrongConstant")
1517
class WifiScannerSource(private val context: Context, private val callback: WifiDetailsCallback) : WifiDetailsSource {
1618
override fun startScan(workSource: WorkSource?) {
1719
val scanner = context.getSystemService("wifiscanner") as WifiScanner

play-services-location/src/main/java/com/google/android/gms/location/GeofencingEvent.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
package com.google.android.gms.location;
1010

11+
import android.annotation.SuppressLint;
1112
import android.content.Intent;
1213
import android.location.Location;
1314

@@ -48,15 +49,14 @@ public class GeofencingEvent {
4849
* @param intent the intent to extract the geofencing event data from
4950
* @return a {@link GeofencingEvent} object or {@code null} if the given intent is {@code null}
5051
*/
52+
5153
public static GeofencingEvent fromIntent(Intent intent) {
5254
if (intent == null) {
5355
return null;
5456
}
5557
GeofencingEvent event = new GeofencingEvent();
5658
event.errorCode = intent.getIntExtra(EXTRA_ERROR_CODE, -1);
57-
event.geofenceTransition = intent.getIntExtra(EXTRA_TRANSITION, -1);
58-
if (event.geofenceTransition != 1 && event.geofenceTransition != 2 && event.geofenceTransition != 4)
59-
event.geofenceTransition = -1;
59+
event.geofenceTransition = validate(intent.getIntExtra(EXTRA_TRANSITION, -1));
6060
ArrayList<byte[]> parceledGeofences = (ArrayList<byte[]>) intent.getSerializableExtra(EXTRA_GEOFENCE_LIST);
6161
if (parceledGeofences != null) {
6262
event.triggeringGeofences = new ArrayList<Geofence>();
@@ -68,6 +68,14 @@ public static GeofencingEvent fromIntent(Intent intent) {
6868
return event;
6969
}
7070

71+
@SuppressLint("WrongConstant")
72+
private static @Geofence.GeofenceTransition int validate(@Geofence.GeofenceTransition int geofenceTransition) {
73+
if (geofenceTransition != Geofence.GEOFENCE_TRANSITION_ENTER && geofenceTransition != Geofence.GEOFENCE_TRANSITION_EXIT && geofenceTransition != Geofence.GEOFENCE_TRANSITION_DWELL) {
74+
return -1;
75+
}
76+
return geofenceTransition;
77+
}
78+
7179
/**
7280
* Returns the error code that explains the error that triggered the intent specified in
7381
* {@link #fromIntent(Intent)}.

play-services-location/system-api/src/main/java/android/location/LocationRequest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
*
7373
* @hide
7474
*/
75+
@SuppressWarnings("WrongConstant")
7576
public final class LocationRequest implements Parcelable {
7677
/**
7778
* Used with {@link #setQuality} to request the most accurate locations available.

play-services-nearby/core/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
1010
<uses-permission android:name="com.google.android.gms.nearby.exposurenotification.EXPOSURE_CALLBACK" />
11+
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
1112

1213
<application>
1314

0 commit comments

Comments
 (0)