Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Verified Commit 1f25282a authored by Marvin W.'s avatar Marvin W. 🐿️
Browse files

Fix Lint

parent 0ef42c32
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -77,12 +77,11 @@ class AuthenticatorActivity : AppCompatActivity() {

        try {

            val callerPackage = callingActivity?.packageName
            if (callerPackage == null) {
                return finish()
            } else if (!intent.extras?.keySet().orEmpty().containsAll(REQUIRED_EXTRAS)) {
            val callerPackage = callingActivity?.packageName ?: return finish()
            if (!intent.extras?.keySet().orEmpty().containsAll(REQUIRED_EXTRAS)) {
                return finishWithError(UNKNOWN_ERR, "Extra missing from request")
            } else if (Build.VERSION.SDK_INT < 24) {
            }
            if (Build.VERSION.SDK_INT < 24) {
                return finishWithError(NOT_SUPPORTED_ERR, "FIDO2 API is not supported on devices below N")
            }
            val options = options ?: return finishWithError(DATA_ERR, "The request options are not valid")
+4 −0
Original line number Diff line number Diff line
@@ -84,6 +84,7 @@
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:orientation="vertical">

                <TextView
@@ -124,6 +125,7 @@
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:orientation="vertical">

                <TextView
@@ -163,6 +165,7 @@
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:orientation="vertical">

                <TextView
@@ -202,6 +205,7 @@
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="24dp"
                android:layout_marginLeft="24dp"
                android:orientation="vertical">

                <TextView
+8 −1
Original line number Diff line number Diff line
@@ -110,12 +110,19 @@ public class LocationRequestHelper {
        }
    }

    public boolean locationIsValid(Location location) {
        if (location == null) return false;
        if (Double.isNaN(location.getLatitude()) || location.getLatitude() > 90 || location.getLatitude() < -90) return false;
        if (Double.isNaN(location.getLongitude()) || location.getLongitude() > 180 || location.getLongitude() < -180) return false;
        return true;
    }

    /**
     * @return whether to continue sending reports to this {@link LocationRequestHelper}
     */
    public boolean report(Location location) {
        if (!isActive()) return false;
        if (location == null || !Double.isFinite(location.getLatitude()) || !Double.isFinite(location.getLongitude())) return true;
        if (!locationIsValid(location)) return true;
        if (lastReport != null) {
            if (location.equals(lastReport)) {
                return true;