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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user