Added an API to query GPS hardware version info

Change-Id: Ic45357d30da350759f56c9d061e60196acb3255b
This commit is contained in:
Lifu Tang
2016-01-21 18:15:33 -08:00
parent a8b7bb5a50
commit 82f893d6df
6 changed files with 74 additions and 1 deletions

View File

@@ -20,6 +20,7 @@ import com.android.internal.location.ProviderProperties;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
@@ -1907,6 +1908,21 @@ public class LocationManager {
return status;
}
/**
* Returns the system information of the GPS hardware.
* May return 0 if GPS hardware is earlier than 2016.
* @hide
*/
@TestApi
public int getGpsYearOfHardware() {
try {
return mService.getGpsYearOfHardware();
} catch (RemoteException e) {
Log.e(TAG, "RemoteException in getGpsSystemInfo: ", e);
return 0;
}
}
/**
* Sends additional commands to a location provider.
* Can be used to support provider specific extensions to the Location Manager API