Loading core/api/current.txt +4 −6 Original line number Diff line number Diff line Loading @@ -19290,8 +19290,8 @@ package android.location { method @NonNull public android.location.GnssAntennaInfo.Builder setSignalGainCorrections(@Nullable android.location.GnssAntennaInfo.SphericalCorrections); } @Deprecated public static interface GnssAntennaInfo.Listener { method @Deprecated public void onGnssAntennaInfoReceived(@NonNull java.util.List<android.location.GnssAntennaInfo>); public static interface GnssAntennaInfo.Listener { method public void onGnssAntennaInfoReceived(@NonNull java.util.List<android.location.GnssAntennaInfo>); } public static final class GnssAntennaInfo.PhaseCenterOffset implements android.os.Parcelable { Loading Loading @@ -19680,7 +19680,7 @@ package android.location { method public boolean hasProvider(@NonNull String); method public boolean isLocationEnabled(); method public boolean isProviderEnabled(@NonNull String); method @Deprecated public boolean registerAntennaInfoListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssAntennaInfo.Listener); method public boolean registerAntennaInfoListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssAntennaInfo.Listener); method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback); method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback, @Nullable android.os.Handler); method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback); Loading Loading @@ -19717,13 +19717,11 @@ package android.location { method public void setTestProviderEnabled(@NonNull String, boolean); method public void setTestProviderLocation(@NonNull String, @NonNull android.location.Location); method @Deprecated public void setTestProviderStatus(@NonNull String, int, @Nullable android.os.Bundle, long); method @Deprecated public void unregisterAntennaInfoListener(@NonNull android.location.GnssAntennaInfo.Listener); method public void unregisterAntennaInfoListener(@NonNull android.location.GnssAntennaInfo.Listener); method public void unregisterGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback); method public void unregisterGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback); method public void unregisterGnssStatusCallback(@NonNull android.location.GnssStatus.Callback); field public static final String ACTION_GNSS_ANTENNA_INFOS_CHANGED = "android.location.action.GNSS_ANTENNA_INFOS_CHANGED"; field public static final String ACTION_GNSS_CAPABILITIES_CHANGED = "android.location.action.GNSS_CAPABILITIES_CHANGED"; field public static final String EXTRA_GNSS_ANTENNA_INFOS = "android.location.extra.GNSS_ANTENNA_INFOS"; field public static final String EXTRA_GNSS_CAPABILITIES = "android.location.extra.GNSS_CAPABILITIES"; field public static final String EXTRA_LOCATION_ENABLED = "android.location.extra.LOCATION_ENABLED"; field public static final String EXTRA_PROVIDER_ENABLED = "android.location.extra.PROVIDER_ENABLED"; location/java/android/location/GnssAntennaInfo.java +0 −4 Original line number Diff line number Diff line Loading @@ -39,11 +39,7 @@ public final class GnssAntennaInfo implements Parcelable { /** * Used for receiving GNSS antenna info from the GNSS engine. * * @deprecated Prefer to use a broadcast receiver for * {@link LocationManager#ACTION_GNSS_ANTENNA_INFOS_CHANGED}. */ @Deprecated public interface Listener { /** * Invoked on a change to GNSS antenna info. Loading location/java/android/location/IGnssAntennaInfoListener.aidl 0 → 100644 +26 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.location; import android.location.GnssAntennaInfo; /** * {@hide} */ oneway interface IGnssAntennaInfoListener { void onGnssAntennaInfoChanged(in List<GnssAntennaInfo> antennaInfos); } location/java/android/location/ILocationManager.aidl +4 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.location.GnssCapabilities; import android.location.GnssMeasurementCorrections; import android.location.GnssMeasurementRequest; import android.location.IGeocodeListener; import android.location.IGnssAntennaInfoListener; import android.location.IGnssMeasurementsListener; import android.location.IGnssStatusListener; import android.location.IGnssNavigationMessageListener; Loading Loading @@ -92,6 +93,9 @@ interface ILocationManager void addGnssNavigationMessageListener(in IGnssNavigationMessageListener listener, String packageName, @nullable String attributionTag, String listenerId); void removeGnssNavigationMessageListener(in IGnssNavigationMessageListener listener); void addGnssAntennaInfoListener(in IGnssAntennaInfoListener listener, String packageName, @nullable String attributionTag, String listenerId); void removeGnssAntennaInfoListener(in IGnssAntennaInfoListener listener); void addProviderRequestListener(in IProviderRequestListener listener); void removeProviderRequestListener(in IProviderRequestListener listener); Loading location/java/android/location/LocationManager.java +26 −50 Original line number Diff line number Diff line Loading @@ -43,10 +43,8 @@ import android.app.PropertyInvalidatedCache; import android.compat.Compatibility; import android.compat.annotation.ChangeId; import android.compat.annotation.EnabledAfter; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.location.provider.IProviderRequestListener; import android.location.provider.ProviderProperties; Loading Loading @@ -348,28 +346,6 @@ public class LocationManager { */ public static final String EXTRA_GNSS_CAPABILITIES = "android.location.extra.GNSS_CAPABILITIES"; /** * Broadcast intent action when GNSS antenna infos change. Includes an intent extra, * {@link #EXTRA_GNSS_ANTENNA_INFOS}, with an ArrayList of the new {@link GnssAntennaInfo}. This * may be read via {@link android.content.Intent#getParcelableArrayListExtra(String)}. * * @see #EXTRA_GNSS_ANTENNA_INFOS * @see #getGnssAntennaInfos() */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_GNSS_ANTENNA_INFOS_CHANGED = "android.location.action.GNSS_ANTENNA_INFOS_CHANGED"; /** * Intent extra included with {@link #ACTION_GNSS_ANTENNA_INFOS_CHANGED} broadcasts, containing * the new ArrayList of {@link GnssAntennaInfo}. This may be read via * {@link android.content.Intent#getParcelableArrayListExtra(String)}. * * @see #ACTION_GNSS_ANTENNA_INFOS_CHANGED */ public static final String EXTRA_GNSS_ANTENNA_INFOS = "android.location.extra.GNSS_ANTENNA_INFOS"; /** * Broadcast intent action for Settings app to inject a footer at the bottom of location * settings. This is for use only by apps that are included in the system image. Loading Loading @@ -2659,10 +2635,11 @@ public class LocationManager { } /** * Registers a GNSS antenna info listener. GNSS antenna info updates will only be received while * the {@link #GPS_PROVIDER} is enabled, and while the client app is in the foreground. * Registers a GNSS antenna info listener that will receive all changes to antenna info. Use * {@link #getGnssAntennaInfos()} to get current antenna info. * * <p>Not all GNSS chipsets support antenna info updates, see {@link #getGnssCapabilities()}. * <p>Not all GNSS chipsets support antenna info updates, see {@link #getGnssCapabilities()}. If * unsupported, the listener will never be invoked. * * <p>Prior to Android S, this requires the {@link Manifest.permission#ACCESS_FINE_LOCATION} * permission. Loading @@ -2673,10 +2650,7 @@ public class LocationManager { * * @throws IllegalArgumentException if executor is null * @throws IllegalArgumentException if listener is null * * @deprecated Prefer to use a receiver for {@link #ACTION_GNSS_ANTENNA_INFOS_CHANGED}. */ @Deprecated public boolean registerAntennaInfoListener( @NonNull @CallbackExecutor Executor executor, @NonNull GnssAntennaInfo.Listener listener) { Loading @@ -2686,13 +2660,10 @@ public class LocationManager { } /** * Unregisters a GNSS Antenna Info listener. * Unregisters a GNSS antenna info listener. * * @param listener a {@link GnssAntennaInfo.Listener} object to remove * * @deprecated Prefer to use a receiver for {@link #ACTION_GNSS_ANTENNA_INFOS_CHANGED}. */ @Deprecated public void unregisterAntennaInfoListener(@NonNull GnssAntennaInfo.Listener listener) { GnssLazyLoader.sGnssAntennaInfoListeners.removeListener(listener); } Loading Loading @@ -3009,14 +2980,17 @@ public class LocationManager { } @Override protected void registerTransport(GnssAntennaInfoTransport transport) { transport.getContext().registerReceiver(transport, new IntentFilter(ACTION_GNSS_ANTENNA_INFOS_CHANGED)); protected void registerTransport(GnssAntennaInfoTransport transport) throws RemoteException { getService().addGnssAntennaInfoListener(transport, transport.getPackage(), transport.getAttributionTag(), AppOpsManager.toReceiverId(transport.getListener())); } @Override protected void unregisterTransport(GnssAntennaInfoTransport transport) { transport.getContext().unregisterReceiver(transport); protected void unregisterTransport(GnssAntennaInfoTransport transport) throws RemoteException { getService().removeGnssAntennaInfoListener(transport); } } Loading Loading @@ -3376,11 +3350,12 @@ public class LocationManager { } } private static class GnssAntennaInfoTransport extends BroadcastReceiver implements private static class GnssAntennaInfoTransport extends IGnssAntennaInfoListener.Stub implements ListenerTransport<GnssAntennaInfo.Listener> { private final Executor mExecutor; private final Context mContext; private final String mPackageName; private final String mAttributionTag; private volatile @Nullable GnssAntennaInfo.Listener mListener; Loading @@ -3389,12 +3364,17 @@ public class LocationManager { Preconditions.checkArgument(executor != null, "invalid null executor"); Preconditions.checkArgument(listener != null, "invalid null listener"); mExecutor = executor; mContext = context; mPackageName = context.getPackageName(); mAttributionTag = context.getAttributionTag(); mListener = listener; } public Context getContext() { return mContext; public String getPackage() { return mPackageName; } public String getAttributionTag() { return mAttributionTag; } @Override Loading @@ -3408,12 +3388,8 @@ public class LocationManager { } @Override public void onReceive(Context context, Intent intent) { ArrayList<GnssAntennaInfo> infos = intent.getParcelableArrayListExtra( EXTRA_GNSS_ANTENNA_INFOS); if (infos != null) { execute(mExecutor, callback -> callback.onGnssAntennaInfoReceived(infos)); } public void onGnssAntennaInfoChanged(List<GnssAntennaInfo> antennaInfos) { execute(mExecutor, callback -> callback.onGnssAntennaInfoReceived(antennaInfos)); } } Loading Loading
core/api/current.txt +4 −6 Original line number Diff line number Diff line Loading @@ -19290,8 +19290,8 @@ package android.location { method @NonNull public android.location.GnssAntennaInfo.Builder setSignalGainCorrections(@Nullable android.location.GnssAntennaInfo.SphericalCorrections); } @Deprecated public static interface GnssAntennaInfo.Listener { method @Deprecated public void onGnssAntennaInfoReceived(@NonNull java.util.List<android.location.GnssAntennaInfo>); public static interface GnssAntennaInfo.Listener { method public void onGnssAntennaInfoReceived(@NonNull java.util.List<android.location.GnssAntennaInfo>); } public static final class GnssAntennaInfo.PhaseCenterOffset implements android.os.Parcelable { Loading Loading @@ -19680,7 +19680,7 @@ package android.location { method public boolean hasProvider(@NonNull String); method public boolean isLocationEnabled(); method public boolean isProviderEnabled(@NonNull String); method @Deprecated public boolean registerAntennaInfoListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssAntennaInfo.Listener); method public boolean registerAntennaInfoListener(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssAntennaInfo.Listener); method @Deprecated @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback); method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback, @Nullable android.os.Handler); method @RequiresPermission(android.Manifest.permission.ACCESS_FINE_LOCATION) public boolean registerGnssMeasurementsCallback(@NonNull java.util.concurrent.Executor, @NonNull android.location.GnssMeasurementsEvent.Callback); Loading Loading @@ -19717,13 +19717,11 @@ package android.location { method public void setTestProviderEnabled(@NonNull String, boolean); method public void setTestProviderLocation(@NonNull String, @NonNull android.location.Location); method @Deprecated public void setTestProviderStatus(@NonNull String, int, @Nullable android.os.Bundle, long); method @Deprecated public void unregisterAntennaInfoListener(@NonNull android.location.GnssAntennaInfo.Listener); method public void unregisterAntennaInfoListener(@NonNull android.location.GnssAntennaInfo.Listener); method public void unregisterGnssMeasurementsCallback(@NonNull android.location.GnssMeasurementsEvent.Callback); method public void unregisterGnssNavigationMessageCallback(@NonNull android.location.GnssNavigationMessage.Callback); method public void unregisterGnssStatusCallback(@NonNull android.location.GnssStatus.Callback); field public static final String ACTION_GNSS_ANTENNA_INFOS_CHANGED = "android.location.action.GNSS_ANTENNA_INFOS_CHANGED"; field public static final String ACTION_GNSS_CAPABILITIES_CHANGED = "android.location.action.GNSS_CAPABILITIES_CHANGED"; field public static final String EXTRA_GNSS_ANTENNA_INFOS = "android.location.extra.GNSS_ANTENNA_INFOS"; field public static final String EXTRA_GNSS_CAPABILITIES = "android.location.extra.GNSS_CAPABILITIES"; field public static final String EXTRA_LOCATION_ENABLED = "android.location.extra.LOCATION_ENABLED"; field public static final String EXTRA_PROVIDER_ENABLED = "android.location.extra.PROVIDER_ENABLED";
location/java/android/location/GnssAntennaInfo.java +0 −4 Original line number Diff line number Diff line Loading @@ -39,11 +39,7 @@ public final class GnssAntennaInfo implements Parcelable { /** * Used for receiving GNSS antenna info from the GNSS engine. * * @deprecated Prefer to use a broadcast receiver for * {@link LocationManager#ACTION_GNSS_ANTENNA_INFOS_CHANGED}. */ @Deprecated public interface Listener { /** * Invoked on a change to GNSS antenna info. Loading
location/java/android/location/IGnssAntennaInfoListener.aidl 0 → 100644 +26 −0 Original line number Diff line number Diff line /* * Copyright (C) 2020, The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.location; import android.location.GnssAntennaInfo; /** * {@hide} */ oneway interface IGnssAntennaInfoListener { void onGnssAntennaInfoChanged(in List<GnssAntennaInfo> antennaInfos); }
location/java/android/location/ILocationManager.aidl +4 −0 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import android.location.GnssCapabilities; import android.location.GnssMeasurementCorrections; import android.location.GnssMeasurementRequest; import android.location.IGeocodeListener; import android.location.IGnssAntennaInfoListener; import android.location.IGnssMeasurementsListener; import android.location.IGnssStatusListener; import android.location.IGnssNavigationMessageListener; Loading Loading @@ -92,6 +93,9 @@ interface ILocationManager void addGnssNavigationMessageListener(in IGnssNavigationMessageListener listener, String packageName, @nullable String attributionTag, String listenerId); void removeGnssNavigationMessageListener(in IGnssNavigationMessageListener listener); void addGnssAntennaInfoListener(in IGnssAntennaInfoListener listener, String packageName, @nullable String attributionTag, String listenerId); void removeGnssAntennaInfoListener(in IGnssAntennaInfoListener listener); void addProviderRequestListener(in IProviderRequestListener listener); void removeProviderRequestListener(in IProviderRequestListener listener); Loading
location/java/android/location/LocationManager.java +26 −50 Original line number Diff line number Diff line Loading @@ -43,10 +43,8 @@ import android.app.PropertyInvalidatedCache; import android.compat.Compatibility; import android.compat.annotation.ChangeId; import android.compat.annotation.EnabledAfter; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.pm.PackageManager; import android.location.provider.IProviderRequestListener; import android.location.provider.ProviderProperties; Loading Loading @@ -348,28 +346,6 @@ public class LocationManager { */ public static final String EXTRA_GNSS_CAPABILITIES = "android.location.extra.GNSS_CAPABILITIES"; /** * Broadcast intent action when GNSS antenna infos change. Includes an intent extra, * {@link #EXTRA_GNSS_ANTENNA_INFOS}, with an ArrayList of the new {@link GnssAntennaInfo}. This * may be read via {@link android.content.Intent#getParcelableArrayListExtra(String)}. * * @see #EXTRA_GNSS_ANTENNA_INFOS * @see #getGnssAntennaInfos() */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) public static final String ACTION_GNSS_ANTENNA_INFOS_CHANGED = "android.location.action.GNSS_ANTENNA_INFOS_CHANGED"; /** * Intent extra included with {@link #ACTION_GNSS_ANTENNA_INFOS_CHANGED} broadcasts, containing * the new ArrayList of {@link GnssAntennaInfo}. This may be read via * {@link android.content.Intent#getParcelableArrayListExtra(String)}. * * @see #ACTION_GNSS_ANTENNA_INFOS_CHANGED */ public static final String EXTRA_GNSS_ANTENNA_INFOS = "android.location.extra.GNSS_ANTENNA_INFOS"; /** * Broadcast intent action for Settings app to inject a footer at the bottom of location * settings. This is for use only by apps that are included in the system image. Loading Loading @@ -2659,10 +2635,11 @@ public class LocationManager { } /** * Registers a GNSS antenna info listener. GNSS antenna info updates will only be received while * the {@link #GPS_PROVIDER} is enabled, and while the client app is in the foreground. * Registers a GNSS antenna info listener that will receive all changes to antenna info. Use * {@link #getGnssAntennaInfos()} to get current antenna info. * * <p>Not all GNSS chipsets support antenna info updates, see {@link #getGnssCapabilities()}. * <p>Not all GNSS chipsets support antenna info updates, see {@link #getGnssCapabilities()}. If * unsupported, the listener will never be invoked. * * <p>Prior to Android S, this requires the {@link Manifest.permission#ACCESS_FINE_LOCATION} * permission. Loading @@ -2673,10 +2650,7 @@ public class LocationManager { * * @throws IllegalArgumentException if executor is null * @throws IllegalArgumentException if listener is null * * @deprecated Prefer to use a receiver for {@link #ACTION_GNSS_ANTENNA_INFOS_CHANGED}. */ @Deprecated public boolean registerAntennaInfoListener( @NonNull @CallbackExecutor Executor executor, @NonNull GnssAntennaInfo.Listener listener) { Loading @@ -2686,13 +2660,10 @@ public class LocationManager { } /** * Unregisters a GNSS Antenna Info listener. * Unregisters a GNSS antenna info listener. * * @param listener a {@link GnssAntennaInfo.Listener} object to remove * * @deprecated Prefer to use a receiver for {@link #ACTION_GNSS_ANTENNA_INFOS_CHANGED}. */ @Deprecated public void unregisterAntennaInfoListener(@NonNull GnssAntennaInfo.Listener listener) { GnssLazyLoader.sGnssAntennaInfoListeners.removeListener(listener); } Loading Loading @@ -3009,14 +2980,17 @@ public class LocationManager { } @Override protected void registerTransport(GnssAntennaInfoTransport transport) { transport.getContext().registerReceiver(transport, new IntentFilter(ACTION_GNSS_ANTENNA_INFOS_CHANGED)); protected void registerTransport(GnssAntennaInfoTransport transport) throws RemoteException { getService().addGnssAntennaInfoListener(transport, transport.getPackage(), transport.getAttributionTag(), AppOpsManager.toReceiverId(transport.getListener())); } @Override protected void unregisterTransport(GnssAntennaInfoTransport transport) { transport.getContext().unregisterReceiver(transport); protected void unregisterTransport(GnssAntennaInfoTransport transport) throws RemoteException { getService().removeGnssAntennaInfoListener(transport); } } Loading Loading @@ -3376,11 +3350,12 @@ public class LocationManager { } } private static class GnssAntennaInfoTransport extends BroadcastReceiver implements private static class GnssAntennaInfoTransport extends IGnssAntennaInfoListener.Stub implements ListenerTransport<GnssAntennaInfo.Listener> { private final Executor mExecutor; private final Context mContext; private final String mPackageName; private final String mAttributionTag; private volatile @Nullable GnssAntennaInfo.Listener mListener; Loading @@ -3389,12 +3364,17 @@ public class LocationManager { Preconditions.checkArgument(executor != null, "invalid null executor"); Preconditions.checkArgument(listener != null, "invalid null listener"); mExecutor = executor; mContext = context; mPackageName = context.getPackageName(); mAttributionTag = context.getAttributionTag(); mListener = listener; } public Context getContext() { return mContext; public String getPackage() { return mPackageName; } public String getAttributionTag() { return mAttributionTag; } @Override Loading @@ -3408,12 +3388,8 @@ public class LocationManager { } @Override public void onReceive(Context context, Intent intent) { ArrayList<GnssAntennaInfo> infos = intent.getParcelableArrayListExtra( EXTRA_GNSS_ANTENNA_INFOS); if (infos != null) { execute(mExecutor, callback -> callback.onGnssAntennaInfoReceived(infos)); } public void onGnssAntennaInfoChanged(List<GnssAntennaInfo> antennaInfos) { execute(mExecutor, callback -> callback.onGnssAntennaInfoReceived(antennaInfos)); } } Loading