Skip to content

Commit

Permalink
Fix lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mar-v-in committed Apr 19, 2023
1 parent f5ad796 commit ae17355
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
4 changes: 0 additions & 4 deletions play-services-core/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,6 @@

<!-- Location -->

<activity
android:name="org.microg.nlp.ui.BackendSettingsActivity"
android:process=":ui" />

<activity
android:name="org.microg.gms.ui.PlacePickerActivity"
android:exported="true"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@

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

import android.annotation.SuppressLint
import android.content.Context
import android.net.wifi.ScanResult
import android.net.wifi.WifiScanner
import android.os.WorkSource
import android.util.Log
import org.microg.gms.location.network.TAG

@SuppressLint("WrongConstant")
class WifiScannerSource(private val context: Context, private val callback: WifiDetailsCallback) : WifiDetailsSource {
override fun startScan(workSource: WorkSource?) {
val scanner = context.getSystemService("wifiscanner") as WifiScanner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

package com.google.android.gms.location;

import android.annotation.SuppressLint;
import android.content.Intent;
import android.location.Location;

Expand Down Expand Up @@ -48,15 +49,14 @@ public class GeofencingEvent {
* @param intent the intent to extract the geofencing event data from
* @return a {@link GeofencingEvent} object or {@code null} if the given intent is {@code null}
*/

public static GeofencingEvent fromIntent(Intent intent) {
if (intent == null) {
return null;
}
GeofencingEvent event = new GeofencingEvent();
event.errorCode = intent.getIntExtra(EXTRA_ERROR_CODE, -1);
event.geofenceTransition = intent.getIntExtra(EXTRA_TRANSITION, -1);
if (event.geofenceTransition != 1 && event.geofenceTransition != 2 && event.geofenceTransition != 4)
event.geofenceTransition = -1;
event.geofenceTransition = validate(intent.getIntExtra(EXTRA_TRANSITION, -1));
ArrayList<byte[]> parceledGeofences = (ArrayList<byte[]>) intent.getSerializableExtra(EXTRA_GEOFENCE_LIST);
if (parceledGeofences != null) {
event.triggeringGeofences = new ArrayList<Geofence>();
Expand All @@ -68,6 +68,14 @@ public static GeofencingEvent fromIntent(Intent intent) {
return event;
}

@SuppressLint("WrongConstant")
private static @Geofence.GeofenceTransition int validate(@Geofence.GeofenceTransition int geofenceTransition) {
if (geofenceTransition != Geofence.GEOFENCE_TRANSITION_ENTER && geofenceTransition != Geofence.GEOFENCE_TRANSITION_EXIT && geofenceTransition != Geofence.GEOFENCE_TRANSITION_DWELL) {
return -1;
}
return geofenceTransition;
}

/**
* Returns the error code that explains the error that triggered the intent specified in
* {@link #fromIntent(Intent)}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
*
* @hide
*/
@SuppressWarnings("WrongConstant")
public final class LocationRequest implements Parcelable {
/**
* Used with {@link #setQuality} to request the most accurate locations available.
Expand Down

0 comments on commit ae17355

Please sign in to comment.