Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f9389758 authored by Roshan Pius's avatar Roshan Pius
Browse files

WifiScanner: Deprecate gscan API's

Bug: 71855918
Test: Compiles
Change-Id: Ibf5c4b012af74914f997866fa24608a854dd9868
parent aa85de17
Loading
Loading
Loading
Loading
+10 −10
Original line number Original line Diff line number Diff line
@@ -6877,17 +6877,17 @@ package android.net.wifi {
    method @Deprecated public void configureWifiChange(int, int, int, int, int, android.net.wifi.WifiScanner.BssidInfo[]);
    method @Deprecated public void configureWifiChange(int, int, int, int, int, android.net.wifi.WifiScanner.BssidInfo[]);
    method @Deprecated public void configureWifiChange(android.net.wifi.WifiScanner.WifiChangeSettings);
    method @Deprecated public void configureWifiChange(android.net.wifi.WifiScanner.WifiChangeSettings);
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<java.lang.Integer> getAvailableChannels(int);
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<java.lang.Integer> getAvailableChannels(int);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean getScanResults();
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public boolean getScanResults();
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<android.net.wifi.ScanResult> getSingleScanResults();
    method @NonNull @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public java.util.List<android.net.wifi.ScanResult> getSingleScanResults();
    method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void registerScanListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void registerScanListener(@NonNull java.util.concurrent.Executor, @NonNull android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setScanningEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public void setScanningEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startBackgroundScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void startScan(android.net.wifi.WifiScanner.ScanSettings, android.net.wifi.WifiScanner.ScanListener, android.os.WorkSource);
    method @Deprecated public void startTrackingBssids(android.net.wifi.WifiScanner.BssidInfo[], int, android.net.wifi.WifiScanner.BssidListener);
    method @Deprecated public void startTrackingBssids(android.net.wifi.WifiScanner.BssidInfo[], int, android.net.wifi.WifiScanner.BssidListener);
    method @Deprecated public void startTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
    method @Deprecated public void startTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopBackgroundScan(android.net.wifi.WifiScanner.ScanListener);
    method @Deprecated @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopBackgroundScan(android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopScan(android.net.wifi.WifiScanner.ScanListener);
    method @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE) public void stopScan(android.net.wifi.WifiScanner.ScanListener);
    method @Deprecated public void stopTrackingBssids(android.net.wifi.WifiScanner.BssidListener);
    method @Deprecated public void stopTrackingBssids(android.net.wifi.WifiScanner.BssidListener);
    method @Deprecated public void stopTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
    method @Deprecated public void stopTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
@@ -6970,7 +6970,7 @@ package android.net.wifi {
  public static interface WifiScanner.ScanListener extends android.net.wifi.WifiScanner.ActionListener {
  public static interface WifiScanner.ScanListener extends android.net.wifi.WifiScanner.ActionListener {
    method public void onFullResult(android.net.wifi.ScanResult);
    method public void onFullResult(android.net.wifi.ScanResult);
    method public void onPeriodChanged(int);
    method @Deprecated public void onPeriodChanged(int);
    method public void onResults(android.net.wifi.WifiScanner.ScanData[]);
    method public void onResults(android.net.wifi.WifiScanner.ScanData[]);
  }
  }
@@ -6981,12 +6981,12 @@ package android.net.wifi {
    field @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public final java.util.List<android.net.wifi.WifiScanner.ScanSettings.HiddenNetwork> hiddenNetworks;
    field @NonNull @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public final java.util.List<android.net.wifi.WifiScanner.ScanSettings.HiddenNetwork> hiddenNetworks;
    field public boolean hideFromAppOps;
    field public boolean hideFromAppOps;
    field public boolean ignoreLocationSettings;
    field public boolean ignoreLocationSettings;
    field public int maxPeriodInMs;
    field @Deprecated public int maxPeriodInMs;
    field public int maxScansToCache;
    field @Deprecated public int maxScansToCache;
    field public int numBssidsPerScan;
    field @Deprecated public int numBssidsPerScan;
    field public int periodInMs;
    field @Deprecated public int periodInMs;
    field public int reportEvents;
    field @Deprecated public int reportEvents;
    field public int stepCount;
    field @Deprecated public int stepCount;
    field @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public int type;
    field @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public int type;
  }
  }
+29 −3
Original line number Original line Diff line number Diff line
@@ -291,28 +291,46 @@ public class WifiScanner {
        @NonNull
        @NonNull
        @RequiresPermission(android.Manifest.permission.NETWORK_STACK)
        @RequiresPermission(android.Manifest.permission.NETWORK_STACK)
        public final List<HiddenNetwork> hiddenNetworks = new ArrayList<>();
        public final List<HiddenNetwork> hiddenNetworks = new ArrayList<>();
        /** period of background scan; in millisecond, 0 => single shot scan */
        /**
         * period of background scan; in millisecond, 0 => single shot scan
         * @deprecated Background scan support is removed.
         */
        @Deprecated
        public int periodInMs;
        public int periodInMs;
        /** must have a valid REPORT_EVENT value */
        /**
         * must have a valid REPORT_EVENT value
         * @deprecated Background scan support is removed.
         */
        @Deprecated
        public int reportEvents;
        public int reportEvents;
        /** defines number of bssids to cache from each scan */
        /**
         * defines number of bssids to cache from each scan
         * @deprecated Background scan support is removed.
         */
        @Deprecated
        public int numBssidsPerScan;
        public int numBssidsPerScan;
        /**
        /**
         * defines number of scans to cache; use it with REPORT_EVENT_AFTER_BUFFER_FULL
         * defines number of scans to cache; use it with REPORT_EVENT_AFTER_BUFFER_FULL
         * to wake up at fixed interval
         * to wake up at fixed interval
         * @deprecated Background scan support is removed.
         */
         */
        @Deprecated
        public int maxScansToCache;
        public int maxScansToCache;
        /**
        /**
         * if maxPeriodInMs is non zero or different than period, then this bucket is
         * if maxPeriodInMs is non zero or different than period, then this bucket is
         * a truncated binary exponential backoff bucket and the scan period will grow
         * a truncated binary exponential backoff bucket and the scan period will grow
         * exponentially as per formula: actual_period(N) = period * (2 ^ (N/stepCount))
         * exponentially as per formula: actual_period(N) = period * (2 ^ (N/stepCount))
         * to maxPeriodInMs
         * to maxPeriodInMs
         * @deprecated Background scan support is removed.
         */
         */
        @Deprecated
        public int maxPeriodInMs;
        public int maxPeriodInMs;
        /**
        /**
         * for truncated binary exponential back off bucket, number of scans to perform
         * for truncated binary exponential back off bucket, number of scans to perform
         * for a given period
         * for a given period
         * @deprecated Background scan support is removed.
         */
         */
        @Deprecated
        public int stepCount;
        public int stepCount;
        /**
        /**
         * Flag to indicate if the scan settings are targeted for PNO scan.
         * Flag to indicate if the scan settings are targeted for PNO scan.
@@ -788,7 +806,9 @@ public class WifiScanner {
        /**
        /**
         * Framework co-ordinates scans across multiple apps; so it may not give exactly the
         * Framework co-ordinates scans across multiple apps; so it may not give exactly the
         * same period requested. If period of a scan is changed; it is reported by this event.
         * same period requested. If period of a scan is changed; it is reported by this event.
         * @deprecated Background scan support is removed.
         */
         */
        @Deprecated
        public void onPeriodChanged(int periodInMs);
        public void onPeriodChanged(int periodInMs);
        /**
        /**
         * reports results retrieved from background scan and single shot scans
         * reports results retrieved from background scan and single shot scans
@@ -891,7 +911,9 @@ public class WifiScanner {
     * @param listener specifies the object to report events to. This object is also treated as a
     * @param listener specifies the object to report events to. This object is also treated as a
     *                 key for this scan, and must also be specified to cancel the scan. Multiple
     *                 key for this scan, and must also be specified to cancel the scan. Multiple
     *                 scans should also not share this object.
     *                 scans should also not share this object.
     * @deprecated Background scan support is removed.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public void startBackgroundScan(ScanSettings settings, ScanListener listener,
    public void startBackgroundScan(ScanSettings settings, ScanListener listener,
            WorkSource workSource) {
            WorkSource workSource) {
@@ -911,7 +933,9 @@ public class WifiScanner {
     * stop an ongoing wifi scan
     * stop an ongoing wifi scan
     * @param listener specifies which scan to cancel; must be same object as passed in {@link
     * @param listener specifies which scan to cancel; must be same object as passed in {@link
     *  #startBackgroundScan}
     *  #startBackgroundScan}
     * @deprecated Background scan support is removed.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public void stopBackgroundScan(ScanListener listener) {
    public void stopBackgroundScan(ScanListener listener) {
        Objects.requireNonNull(listener, "listener cannot be null");
        Objects.requireNonNull(listener, "listener cannot be null");
@@ -927,7 +951,9 @@ public class WifiScanner {
    /**
    /**
     * reports currently available scan results on appropriate listeners
     * reports currently available scan results on appropriate listeners
     * @return true if all scan results were reported correctly
     * @return true if all scan results were reported correctly
     * @deprecated Background scan support is removed.
     */
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public boolean getScanResults() {
    public boolean getScanResults() {
        validateChannel();
        validateChannel();