diff --git a/api/system-current.txt b/api/system-current.txt index 86a13bb13429f..f283820a90a2e 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -4849,7 +4849,8 @@ package android.net.wifi { ctor public WifiScanner.ScanSettings(); field public int band; field public android.net.wifi.WifiScanner.ChannelSpec[] channels; - field @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean ignoreLocationSettings; + field public boolean hideFromAppOps; + field public boolean ignoreLocationSettings; field public int maxPeriodInMs; field public int maxScansToCache; field public int numBssidsPerScan; diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java index acc0518dbca40..b73551fc62e08 100644 --- a/wifi/java/android/net/wifi/WifiScanner.java +++ b/wifi/java/android/net/wifi/WifiScanner.java @@ -259,8 +259,17 @@ public class WifiScanner { * {@hide} */ @SystemApi - @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean ignoreLocationSettings; + /** + * This scan request will be hidden from app-ops noting for location information. This + * should only be used by FLP/NLP module on the device which is using the scan results to + * compute results for behalf on their clients. FLP/NLP module using this flag should ensure + * that they note in app-ops the eventual delivery of location information computed using + * these results to their client . + * {@hide} + */ + @SystemApi + public boolean hideFromAppOps; /** Implement the Parcelable interface {@hide} */ public int describeContents() { @@ -279,6 +288,7 @@ public class WifiScanner { dest.writeInt(isPnoScan ? 1 : 0); dest.writeInt(type); dest.writeInt(ignoreLocationSettings ? 1 : 0); + dest.writeInt(hideFromAppOps ? 1 : 0); if (channels != null) { dest.writeInt(channels.length); for (int i = 0; i < channels.length; i++) { @@ -314,6 +324,7 @@ public class WifiScanner { settings.isPnoScan = in.readInt() == 1; settings.type = in.readInt(); settings.ignoreLocationSettings = in.readInt() == 1; + settings.hideFromAppOps = in.readInt() == 1; int num_channels = in.readInt(); settings.channels = new ChannelSpec[num_channels]; for (int i = 0; i < num_channels; i++) {