Update getGnssCapabilities() in LMS to include sub-HAL capabilities

The GNSS capabilities in the gnss@2.0 HAL have been refactored
(b/128028791, b/127434062, b/128309220). The sub-HAL capabilities
in the top level IGnssCallback.hal have been moved into their
respective sub-HALs. Consequently, the getGnssCapabilities()
method in LocationManagerService is hereby modified to include
the capabilities from all sub-HALs and the top level HAL.

A new GnssCapabilities class needs to be added so that we don't
expose the implementation details of the capabilities (a Java
int bitmask of capability flags) to the LocationManager client.

Bug: 128913861
Test: TBD
Change-Id: I5ed90332c7c0e783de771f573a58f79d1d6d89ff
This commit is contained in:
Anil Admal
2019-03-19 18:58:42 -07:00
parent d4f39bcee6
commit 993497864e
6 changed files with 178 additions and 8 deletions

View File

@@ -1986,15 +1986,19 @@ public class LocationManager {
}
/**
* Returns the integer capability flags of the GNSS chipset as defined in {@code
* IGnssCallback.hal}
* Returns the supported capabilities of the GNSS chipset or {@code null} if there is an error
* in obtaining the capabilities.
*
* @hide
*/
@SystemApi
public int getGnssCapabilities() {
public @Nullable GnssCapabilities getGnssCapabilities() {
try {
return mGnssMeasurementCallbackTransport.getGnssCapabilities();
long gnssCapabilities = mGnssMeasurementCallbackTransport.getGnssCapabilities();
if (gnssCapabilities == GnssCapabilities.INVALID_CAPABILITIES) {
return null;
}
return GnssCapabilities.of(gnssCapabilities);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}