Merge "GNSS Model Name constant string and comment updates" into pi-dev

am: aa8cbab151

Change-Id: Idafb74af51dccbfe754f7dfc6a667fa13b310582
This commit is contained in:
Wyatt Riley
2018-03-22 16:24:51 +00:00
committed by android-build-merger
4 changed files with 13 additions and 13 deletions

View File

@@ -21818,7 +21818,6 @@ package android.location {
method public void unregisterGnssMeasurementsCallback(android.location.GnssMeasurementsEvent.Callback);
method public void unregisterGnssNavigationMessageCallback(android.location.GnssNavigationMessage.Callback);
method public void unregisterGnssStatusCallback(android.location.GnssStatus.Callback);
field public static final java.lang.String GNSS_HARDWARE_MODEL_NAME_UNKNOWN = "Model Name Unknown";
field public static final java.lang.String GPS_PROVIDER = "gps";
field public static final java.lang.String KEY_LOCATION_CHANGED = "location";
field public static final java.lang.String KEY_PROVIDER_ENABLED = "providerEnabled";

View File

@@ -23,6 +23,7 @@ import static android.Manifest.permission.WRITE_SECURE_SETTINGS;
import android.Manifest;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RequiresFeature;
import android.annotation.RequiresPermission;
import android.annotation.SuppressLint;
@@ -235,12 +236,6 @@ public class LocationManager {
public static final String HIGH_POWER_REQUEST_CHANGE_ACTION =
"android.location.HIGH_POWER_REQUEST_CHANGE";
/**
* The value returned by {@link LocationManager#getGnssHardwareModelName()} when the hardware
* does not support providing the actual value.
*/
public static final String GNSS_HARDWARE_MODEL_NAME_UNKNOWN = "Model Name Unknown";
/**
* Broadcast intent action for Settings app to inject a footer at the bottom of location
* settings.
@@ -2206,7 +2201,9 @@ public class LocationManager {
/**
* Returns the model year of the GNSS hardware and software build.
*
* May return 0 if the model year is less than 2016.
* <p> More details, such as build date, may be available in {@link #getGnssHardwareModelName()}.
*
* <p> May return 0 if the model year is less than 2016.
*/
public int getGnssYearOfHardware() {
try {
@@ -2220,10 +2217,12 @@ public class LocationManager {
* Returns the Model Name (including Vendor and Hardware/Software Version) of the GNSS hardware
* driver.
*
* Will return {@link LocationManager#GNSS_HARDWARE_MODEL_NAME_UNKNOWN} when the GNSS hardware
* abstraction layer does not support providing this value.
* <p> No device-specific serial number or ID is returned from this API.
*
* <p> Will return null when the GNSS hardware abstraction layer does not support providing
* this value.
*/
@NonNull
@Nullable
public String getGnssHardwareModelName() {
try {
return mService.getGnssHardwareModelName();

View File

@@ -19,6 +19,7 @@ package com.android.server;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.app.ActivityManager;
import android.app.AppOpsManager;
import android.app.PendingIntent;
@@ -1131,11 +1132,12 @@ public class LocationManagerService extends ILocationManager.Stub {
* Returns the model name of the GNSS hardware.
*/
@Override
@Nullable
public String getGnssHardwareModelName() {
if (mGnssSystemInfoProvider != null) {
return mGnssSystemInfoProvider.getGnssHardwareModelName();
} else {
return LocationManager.GNSS_HARDWARE_MODEL_NAME_UNKNOWN;
return null;
}
}

View File

@@ -470,7 +470,7 @@ public class GnssLocationProvider implements LocationProviderInterface {
// Volatile for simple inter-thread sync on these values.
private volatile int mHardwareYear = 0;
private volatile String mHardwareModelName = LocationManager.GNSS_HARDWARE_MODEL_NAME_UNKNOWN;
private volatile String mHardwareModelName;
// Set lower than the current ITAR limit of 600m/s to allow this to trigger even if GPS HAL
// stops output right at 600m/s, depriving this of the information of a device that reaches