Loading core/java/android/provider/Settings.java +13 −0 Original line number Diff line number Diff line Loading @@ -12541,6 +12541,19 @@ public final class Settings { */ public static final String SWAP_ENABLED = "swap_enabled"; /** * Blacklist of GNSS satellites. * * This is a list of integers separated by commas to represent pairs of (constellation, * svid). Thus, the number of integers should be even. * * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are * blacklisted. Note that svid=0 denotes all svids in the * constellation are blacklisted. * * @hide */ public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist"; } /** Loading core/proto/android/providers/settings/global.proto +1 −0 Original line number Diff line number Diff line Loading @@ -451,6 +451,7 @@ message GlobalSettingsProto { // If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link // Secure#LOCATION_MODE_OFF} temporarily for all users. optional SettingProto global_kill_switch = 5 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto gnss_satellite_blacklist = 6 [ (android.privacy).dest = DEST_AUTOMATIC ]; } optional Location location = 69; Loading core/tests/coretests/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,7 @@ public class SettingsBackupTest { Settings.Global.GLOBAL_HTTP_PROXY_HOST, Settings.Global.GLOBAL_HTTP_PROXY_PAC, Settings.Global.GLOBAL_HTTP_PROXY_PORT, Settings.Global.GNSS_SATELLITE_BLACKLIST, Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS, Settings.Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED, Settings.Global.HDMI_CONTROL_AUTO_WAKEUP_ENABLED, Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +3 −0 Original line number Diff line number Diff line Loading @@ -742,6 +742,9 @@ class SettingsProtoDumpUtil { dumpSetting(s, p, Settings.Global.LOCATION_GLOBAL_KILL_SWITCH, GlobalSettingsProto.Location.GLOBAL_KILL_SWITCH); dumpSetting(s, p, Settings.Global.GNSS_SATELLITE_BLACKLIST, GlobalSettingsProto.Location.GNSS_SATELLITE_BLACKLIST); p.end(locationToken); final long lpmToken = p.start(GlobalSettingsProto.LOW_POWER_MODE); Loading services/core/java/com/android/server/location/GnssLocationProvider.java +24 −5 Original line number Diff line number Diff line Loading @@ -83,7 +83,11 @@ import com.android.internal.location.GpsNetInitiatedHandler.GpsNiNotification; import com.android.internal.location.ProviderProperties; import com.android.internal.location.ProviderRequest; import com.android.internal.location.gnssmetrics.GnssMetrics; import com.android.server.location.GnssSatelliteBlacklistHelper.GnssSatelliteBlacklistCallback; import com.android.server.location.NtpTimeHelper.InjectNtpTimeCallback; import libcore.io.IoUtils; import java.io.File; import java.io.FileDescriptor; import java.io.FileInputStream; Loading @@ -99,14 +103,13 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import libcore.io.IoUtils; /** * A GNSS implementation of LocationProvider used by LocationManager. * * {@hide} */ public class GnssLocationProvider implements LocationProviderInterface, InjectNtpTimeCallback { public class GnssLocationProvider implements LocationProviderInterface, InjectNtpTimeCallback, GnssSatelliteBlacklistCallback { private static final String TAG = "GnssLocationProvider"; Loading Loading @@ -308,7 +311,7 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt } } private Object mLock = new Object(); private final Object mLock = new Object(); // current status private int mStatus = LocationProvider.TEMPORARILY_UNAVAILABLE; Loading Loading @@ -411,6 +414,7 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt private final ILocationManager mILocationManager; private final LocationExtras mLocationExtras = new LocationExtras(); private final GnssStatusListenerHelper mListenerHelper; private final GnssSatelliteBlacklistHelper mGnssSatelliteBlacklistHelper; private final GnssMeasurementsProvider mGnssMeasurementsProvider; private final GnssNavigationMessageProvider mGnssNavigationMessageProvider; private final LocationChangeListener mNetworkLocationListener = new NetworkLocationListener(); Loading Loading @@ -577,6 +581,16 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt } }; /** * Implements {@link GnssSatelliteBlacklistCallback#onUpdateSatelliteBlacklist}. */ @Override public void onUpdateSatelliteBlacklist(int[] constellations, int[] svids) { mHandler.post(()->{ native_set_satellite_blacklist(constellations, svids); }); } private void subscriptionOrSimChanged(Context context) { if (DEBUG) Log.d(TAG, "received SIM related action: "); TelephonyManager phone = (TelephonyManager) Loading Loading @@ -869,7 +883,10 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt }; mGnssMetrics = new GnssMetrics(mBatteryStats); mNtpTimeHelper = new NtpTimeHelper(mContext, Looper.myLooper(), this); mNtpTimeHelper = new NtpTimeHelper(mContext, looper, this); mGnssSatelliteBlacklistHelper = new GnssSatelliteBlacklistHelper(mContext, looper, this); mHandler.post(mGnssSatelliteBlacklistHelper::updateSatelliteBlacklist); } /** Loading Loading @@ -2900,6 +2917,8 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt private static native boolean native_set_emergency_supl_pdn(int emergencySuplPdn); private static native boolean native_set_satellite_blacklist(int[] constellations, int[] svIds); // GNSS Batching private static native int native_get_batch_size(); Loading Loading
core/java/android/provider/Settings.java +13 −0 Original line number Diff line number Diff line Loading @@ -12541,6 +12541,19 @@ public final class Settings { */ public static final String SWAP_ENABLED = "swap_enabled"; /** * Blacklist of GNSS satellites. * * This is a list of integers separated by commas to represent pairs of (constellation, * svid). Thus, the number of integers should be even. * * E.g.: "3,0,5,24" denotes (constellation=3, svid=0) and (constellation=5, svid=24) are * blacklisted. Note that svid=0 denotes all svids in the * constellation are blacklisted. * * @hide */ public static final String GNSS_SATELLITE_BLACKLIST = "gnss_satellite_blacklist"; } /** Loading
core/proto/android/providers/settings/global.proto +1 −0 Original line number Diff line number Diff line Loading @@ -451,6 +451,7 @@ message GlobalSettingsProto { // If set to 1, {@link Secure#LOCATION_MODE} will be set to {@link // Secure#LOCATION_MODE_OFF} temporarily for all users. optional SettingProto global_kill_switch = 5 [ (android.privacy).dest = DEST_AUTOMATIC ]; optional SettingProto gnss_satellite_blacklist = 6 [ (android.privacy).dest = DEST_AUTOMATIC ]; } optional Location location = 69; Loading
core/tests/coretests/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -239,6 +239,7 @@ public class SettingsBackupTest { Settings.Global.GLOBAL_HTTP_PROXY_HOST, Settings.Global.GLOBAL_HTTP_PROXY_PAC, Settings.Global.GLOBAL_HTTP_PROXY_PORT, Settings.Global.GNSS_SATELLITE_BLACKLIST, Settings.Global.GPRS_REGISTER_CHECK_PERIOD_MS, Settings.Global.HDMI_CONTROL_AUTO_DEVICE_OFF_ENABLED, Settings.Global.HDMI_CONTROL_AUTO_WAKEUP_ENABLED, Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProtoDumpUtil.java +3 −0 Original line number Diff line number Diff line Loading @@ -742,6 +742,9 @@ class SettingsProtoDumpUtil { dumpSetting(s, p, Settings.Global.LOCATION_GLOBAL_KILL_SWITCH, GlobalSettingsProto.Location.GLOBAL_KILL_SWITCH); dumpSetting(s, p, Settings.Global.GNSS_SATELLITE_BLACKLIST, GlobalSettingsProto.Location.GNSS_SATELLITE_BLACKLIST); p.end(locationToken); final long lpmToken = p.start(GlobalSettingsProto.LOW_POWER_MODE); Loading
services/core/java/com/android/server/location/GnssLocationProvider.java +24 −5 Original line number Diff line number Diff line Loading @@ -83,7 +83,11 @@ import com.android.internal.location.GpsNetInitiatedHandler.GpsNiNotification; import com.android.internal.location.ProviderProperties; import com.android.internal.location.ProviderRequest; import com.android.internal.location.gnssmetrics.GnssMetrics; import com.android.server.location.GnssSatelliteBlacklistHelper.GnssSatelliteBlacklistCallback; import com.android.server.location.NtpTimeHelper.InjectNtpTimeCallback; import libcore.io.IoUtils; import java.io.File; import java.io.FileDescriptor; import java.io.FileInputStream; Loading @@ -99,14 +103,13 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Properties; import libcore.io.IoUtils; /** * A GNSS implementation of LocationProvider used by LocationManager. * * {@hide} */ public class GnssLocationProvider implements LocationProviderInterface, InjectNtpTimeCallback { public class GnssLocationProvider implements LocationProviderInterface, InjectNtpTimeCallback, GnssSatelliteBlacklistCallback { private static final String TAG = "GnssLocationProvider"; Loading Loading @@ -308,7 +311,7 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt } } private Object mLock = new Object(); private final Object mLock = new Object(); // current status private int mStatus = LocationProvider.TEMPORARILY_UNAVAILABLE; Loading Loading @@ -411,6 +414,7 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt private final ILocationManager mILocationManager; private final LocationExtras mLocationExtras = new LocationExtras(); private final GnssStatusListenerHelper mListenerHelper; private final GnssSatelliteBlacklistHelper mGnssSatelliteBlacklistHelper; private final GnssMeasurementsProvider mGnssMeasurementsProvider; private final GnssNavigationMessageProvider mGnssNavigationMessageProvider; private final LocationChangeListener mNetworkLocationListener = new NetworkLocationListener(); Loading Loading @@ -577,6 +581,16 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt } }; /** * Implements {@link GnssSatelliteBlacklistCallback#onUpdateSatelliteBlacklist}. */ @Override public void onUpdateSatelliteBlacklist(int[] constellations, int[] svids) { mHandler.post(()->{ native_set_satellite_blacklist(constellations, svids); }); } private void subscriptionOrSimChanged(Context context) { if (DEBUG) Log.d(TAG, "received SIM related action: "); TelephonyManager phone = (TelephonyManager) Loading Loading @@ -869,7 +883,10 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt }; mGnssMetrics = new GnssMetrics(mBatteryStats); mNtpTimeHelper = new NtpTimeHelper(mContext, Looper.myLooper(), this); mNtpTimeHelper = new NtpTimeHelper(mContext, looper, this); mGnssSatelliteBlacklistHelper = new GnssSatelliteBlacklistHelper(mContext, looper, this); mHandler.post(mGnssSatelliteBlacklistHelper::updateSatelliteBlacklist); } /** Loading Loading @@ -2900,6 +2917,8 @@ public class GnssLocationProvider implements LocationProviderInterface, InjectNt private static native boolean native_set_emergency_supl_pdn(int emergencySuplPdn); private static native boolean native_set_satellite_blacklist(int[] constellations, int[] svIds); // GNSS Batching private static native int native_get_batch_size(); Loading