Loading api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -19228,6 +19228,7 @@ package android.location { method public java.util.List<java.lang.String> getAllProviders(); method public java.lang.String getBestProvider(android.location.Criteria, boolean); method public deprecated android.location.GpsStatus getGpsStatus(android.location.GpsStatus); method public int getGpsYearOfHardware(); method public android.location.Location getLastKnownLocation(java.lang.String); method public android.location.LocationProvider getProvider(java.lang.String); method public java.util.List<java.lang.String> getProviders(boolean); location/java/android/location/ILocationManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,8 @@ interface ILocationManager in String packageName); void removeGpsNavigationMessageListener(in IGpsNavigationMessageListener listener); int getGpsYearOfHardware(); // --- deprecated --- List<String> getAllProviders(); List<String> getProviders(in Criteria criteria, boolean enabledOnly); Loading location/java/android/location/LocationManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading services/core/java/com/android/server/LocationManagerService.java +15 −0 Original line number Diff line number Diff line Loading @@ -214,6 +214,8 @@ public class LocationManagerService extends ILocationManager.Stub { private int mCurrentUserId = UserHandle.USER_SYSTEM; private int[] mCurrentUserProfiles = new int[] { UserHandle.USER_SYSTEM }; private GnssLocationProvider.GpsSystemInfoProvider mGpsSystemInfoProvider; public LocationManagerService(Context context) { super(); mContext = context; Loading Loading @@ -460,6 +462,7 @@ public class LocationManagerService extends ILocationManager.Stub { // Create a gps location provider GnssLocationProvider gnssProvider = new GnssLocationProvider(mContext, this, mLocationHandler.getLooper()); mGpsSystemInfoProvider = gnssProvider.getGpsSystemInfoProvider(); mGnssStatusProvider = gnssProvider.getGnssStatusProvider(); mNetInitiatedListener = gnssProvider.getNetInitiatedListener(); addProviderLocked(gnssProvider); Loading Loading @@ -986,6 +989,18 @@ public class LocationManagerService extends ILocationManager.Stub { } } /** * Returns the system information of the GPS hardware. */ @Override public int getGpsYearOfHardware() { if (mGpsNavigationMessageProvider != null) { return mGpsSystemInfoProvider.getGpsYearOfHardware(); } else { return 0; } } private void addProviderLocked(LocationProviderInterface provider) { mProviders.add(provider); mProvidersByName.put(provider.getName(), provider); Loading services/core/java/com/android/server/location/GnssLocationProvider.java +29 −0 Original line number Diff line number Diff line Loading @@ -406,6 +406,8 @@ public class GnssLocationProvider implements LocationProviderInterface { private GeofenceHardwareImpl mGeofenceHardwareImpl; private int mYearOfHardware = 0; private final IGnssStatusProvider mGnssStatusProvider = new IGnssStatusProvider.Stub() { @Override public void registerGnssStatusCallback(IGnssStatusListener callback) { Loading Loading @@ -1681,6 +1683,33 @@ public class GnssLocationProvider implements LocationProviderInterface { (capabilities & GPS_CAPABILITY_NAV_MESSAGES) == GPS_CAPABILITY_NAV_MESSAGES); } /** * Called from native code to inform us the hardware information. */ private void setGpsYearOfHardware(int yearOfHardware) { if (DEBUG) Log.d(TAG, "setGpsYearOfHardware called with " + yearOfHardware); mYearOfHardware = yearOfHardware; } public interface GpsSystemInfoProvider { /** * Returns the year of GPS hardware. */ int getGpsYearOfHardware(); } /** * @hide */ public GpsSystemInfoProvider getGpsSystemInfoProvider() { return new GpsSystemInfoProvider() { @Override public int getGpsYearOfHardware() { return mYearOfHardware; } }; } /** * called from native code to request XTRA data */ Loading Loading
api/test-current.txt +1 −0 Original line number Diff line number Diff line Loading @@ -19228,6 +19228,7 @@ package android.location { method public java.util.List<java.lang.String> getAllProviders(); method public java.lang.String getBestProvider(android.location.Criteria, boolean); method public deprecated android.location.GpsStatus getGpsStatus(android.location.GpsStatus); method public int getGpsYearOfHardware(); method public android.location.Location getLastKnownLocation(java.lang.String); method public android.location.LocationProvider getProvider(java.lang.String); method public java.util.List<java.lang.String> getProviders(boolean);
location/java/android/location/ILocationManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -69,6 +69,8 @@ interface ILocationManager in String packageName); void removeGpsNavigationMessageListener(in IGpsNavigationMessageListener listener); int getGpsYearOfHardware(); // --- deprecated --- List<String> getAllProviders(); List<String> getProviders(in Criteria criteria, boolean enabledOnly); Loading
location/java/android/location/LocationManager.java +16 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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 Loading
services/core/java/com/android/server/LocationManagerService.java +15 −0 Original line number Diff line number Diff line Loading @@ -214,6 +214,8 @@ public class LocationManagerService extends ILocationManager.Stub { private int mCurrentUserId = UserHandle.USER_SYSTEM; private int[] mCurrentUserProfiles = new int[] { UserHandle.USER_SYSTEM }; private GnssLocationProvider.GpsSystemInfoProvider mGpsSystemInfoProvider; public LocationManagerService(Context context) { super(); mContext = context; Loading Loading @@ -460,6 +462,7 @@ public class LocationManagerService extends ILocationManager.Stub { // Create a gps location provider GnssLocationProvider gnssProvider = new GnssLocationProvider(mContext, this, mLocationHandler.getLooper()); mGpsSystemInfoProvider = gnssProvider.getGpsSystemInfoProvider(); mGnssStatusProvider = gnssProvider.getGnssStatusProvider(); mNetInitiatedListener = gnssProvider.getNetInitiatedListener(); addProviderLocked(gnssProvider); Loading Loading @@ -986,6 +989,18 @@ public class LocationManagerService extends ILocationManager.Stub { } } /** * Returns the system information of the GPS hardware. */ @Override public int getGpsYearOfHardware() { if (mGpsNavigationMessageProvider != null) { return mGpsSystemInfoProvider.getGpsYearOfHardware(); } else { return 0; } } private void addProviderLocked(LocationProviderInterface provider) { mProviders.add(provider); mProvidersByName.put(provider.getName(), provider); Loading
services/core/java/com/android/server/location/GnssLocationProvider.java +29 −0 Original line number Diff line number Diff line Loading @@ -406,6 +406,8 @@ public class GnssLocationProvider implements LocationProviderInterface { private GeofenceHardwareImpl mGeofenceHardwareImpl; private int mYearOfHardware = 0; private final IGnssStatusProvider mGnssStatusProvider = new IGnssStatusProvider.Stub() { @Override public void registerGnssStatusCallback(IGnssStatusListener callback) { Loading Loading @@ -1681,6 +1683,33 @@ public class GnssLocationProvider implements LocationProviderInterface { (capabilities & GPS_CAPABILITY_NAV_MESSAGES) == GPS_CAPABILITY_NAV_MESSAGES); } /** * Called from native code to inform us the hardware information. */ private void setGpsYearOfHardware(int yearOfHardware) { if (DEBUG) Log.d(TAG, "setGpsYearOfHardware called with " + yearOfHardware); mYearOfHardware = yearOfHardware; } public interface GpsSystemInfoProvider { /** * Returns the year of GPS hardware. */ int getGpsYearOfHardware(); } /** * @hide */ public GpsSystemInfoProvider getGpsSystemInfoProvider() { return new GpsSystemInfoProvider() { @Override public int getGpsYearOfHardware() { return mYearOfHardware; } }; } /** * called from native code to request XTRA data */ Loading