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

Commit a8e676b3 authored by Soonil Nagarkar's avatar Soonil Nagarkar
Browse files

Refactor Java GNSS HAL

Extracts large parts of the GNSS HAL into a central GnssNative class,
which can be faked for testing. This is a large step towards making all
GNSS code unit testable, and allows for more modular HAL configurations.
Begins to break up the GnssLocationProvider god object and pull
functionality out into other classes. Changes include:

-Making GnssCapabilities parcelable so it can be part of the API
-Splitting out the NMEA listener from status listeners, which
substantially reduces the burden of supported NMEA listeners as well as
the amount of GNSS<->AP communication.
-All GNSS listeners now respond properly to HAL restarts.
-Partially extract out emergency call detection.

Bug: 153129152
Test: manual
Change-Id: Idee0d548f38c6adf921cd6c28b5d815bbd366f8a
parent 09b2ae99
Loading
Loading
Loading
Loading
+17 −2
Original line number Diff line number Diff line
@@ -18966,8 +18966,23 @@ package android.location {
    field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssAntennaInfo.SphericalCorrections> CREATOR;
  }
  public final class GnssCapabilities {
    method public boolean hasGnssAntennaInfo();
  public final class GnssCapabilities implements android.os.Parcelable {
    method public int describeContents();
    method public boolean hasAntennaInfo();
    method @Deprecated public boolean hasGnssAntennaInfo();
    method public boolean hasMeasurements();
    method public boolean hasNavigationMessages();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.location.GnssCapabilities> CREATOR;
  }
  public static final class GnssCapabilities.Builder {
    ctor public GnssCapabilities.Builder();
    ctor public GnssCapabilities.Builder(@NonNull android.location.GnssCapabilities);
    method @NonNull public android.location.GnssCapabilities build();
    method @NonNull public android.location.GnssCapabilities.Builder setHasAntennaInfo(boolean);
    method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurements(boolean);
    method @NonNull public android.location.GnssCapabilities.Builder setHasNavigationMessages(boolean);
  }
  public final class GnssClock implements android.os.Parcelable {
+14 −4
Original line number Diff line number Diff line
@@ -3938,19 +3938,29 @@ package android.location {
    method public void onLocationBatch(java.util.List<android.location.Location>);
  }
  public final class GnssCapabilities {
  public final class GnssCapabilities implements android.os.Parcelable {
    method public boolean hasGeofencing();
    method public boolean hasLowPowerMode();
    method public boolean hasMeasurementCorrections();
    method public boolean hasMeasurementCorrectionsExcessPathLength();
    method public boolean hasMeasurementCorrectionsLosSats();
    method public boolean hasMeasurementCorrectionsReflectingPane();
    method public boolean hasMeasurements();
    method public boolean hasNavMessages();
    method @Deprecated public boolean hasMeasurementCorrectionsReflectingPane();
    method public boolean hasMeasurementCorrectionsReflectingPlane();
    method @Deprecated public boolean hasNavMessages();
    method @Deprecated public boolean hasSatelliteBlacklist();
    method public boolean hasSatelliteBlocklist();
  }
  public static final class GnssCapabilities.Builder {
    method @NonNull public android.location.GnssCapabilities.Builder setHasGeofencing(boolean);
    method @NonNull public android.location.GnssCapabilities.Builder setHasLowPowerMode(boolean);
    method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrections(boolean);
    method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsExcessPathLength(boolean);
    method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsLosSats(boolean);
    method @NonNull public android.location.GnssCapabilities.Builder setHasMeasurementCorrectionsReflectingPlane(boolean);
    method @NonNull public android.location.GnssCapabilities.Builder setHasSatelliteBlocklist(boolean);
  }
  public final class GnssMeasurementCorrections implements android.os.Parcelable {
    method public int describeContents();
    method @FloatRange(from=-1000.0F, to=10000.0f) public double getAltitudeMeters();
+19 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.location;

parcelable GnssCapabilities;
 No newline at end of file
+663 −73

File changed.

Preview size limit exceeded, changes collapsed.

+25 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2020, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.location;

/**
 * {@hide}
 */
oneway interface IGnssNmeaListener
{
    void onNmeaReceived(long timestamp, String nmea);
}
 No newline at end of file
Loading