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

Commit 52bf7227 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "WifiScanner: Deprecate gscan API's"

parents 454f6eb8 f9389758
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -6909,17 +6909,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(android.net.wifi.WifiScanner.WifiChangeSettings);
    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 @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.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, android.os.WorkSource);
    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 @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 @Deprecated public void stopTrackingBssids(android.net.wifi.WifiScanner.BssidListener);
    method @Deprecated public void stopTrackingWifiChange(android.net.wifi.WifiScanner.WifiChangeListener);
@@ -7002,7 +7002,7 @@ package android.net.wifi {
  public static interface WifiScanner.ScanListener extends android.net.wifi.WifiScanner.ActionListener {
    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[]);
  }
@@ -7013,12 +7013,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 public boolean hideFromAppOps;
    field public boolean ignoreLocationSettings;
    field public int maxPeriodInMs;
    field public int maxScansToCache;
    field public int numBssidsPerScan;
    field public int periodInMs;
    field public int reportEvents;
    field public int stepCount;
    field @Deprecated public int maxPeriodInMs;
    field @Deprecated public int maxScansToCache;
    field @Deprecated public int numBssidsPerScan;
    field @Deprecated public int periodInMs;
    field @Deprecated public int reportEvents;
    field @Deprecated public int stepCount;
    field @RequiresPermission(android.Manifest.permission.NETWORK_STACK) public int type;
  }
+29 −3
Original line number Diff line number Diff line
@@ -291,28 +291,46 @@ public class WifiScanner {
        @NonNull
        @RequiresPermission(android.Manifest.permission.NETWORK_STACK)
        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;
        /** must have a valid REPORT_EVENT value */
        /**
         * must have a valid REPORT_EVENT value
         * @deprecated Background scan support is removed.
         */
        @Deprecated
        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;
        /**
         * defines number of scans to cache; use it with REPORT_EVENT_AFTER_BUFFER_FULL
         * to wake up at fixed interval
         * @deprecated Background scan support is removed.
         */
        @Deprecated
        public int maxScansToCache;
        /**
         * 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
         * exponentially as per formula: actual_period(N) = period * (2 ^ (N/stepCount))
         * to maxPeriodInMs
         * @deprecated Background scan support is removed.
         */
        @Deprecated
        public int maxPeriodInMs;
        /**
         * for truncated binary exponential back off bucket, number of scans to perform
         * for a given period
         * @deprecated Background scan support is removed.
         */
        @Deprecated
        public int stepCount;
        /**
         * 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
         * 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);
        /**
         * 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
     *                 key for this scan, and must also be specified to cancel the scan. Multiple
     *                 scans should also not share this object.
     * @deprecated Background scan support is removed.
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public void startBackgroundScan(ScanSettings settings, ScanListener listener,
            WorkSource workSource) {
@@ -911,7 +933,9 @@ public class WifiScanner {
     * stop an ongoing wifi scan
     * @param listener specifies which scan to cancel; must be same object as passed in {@link
     *  #startBackgroundScan}
     * @deprecated Background scan support is removed.
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public void stopBackgroundScan(ScanListener listener) {
        Objects.requireNonNull(listener, "listener cannot be null");
@@ -927,7 +951,9 @@ public class WifiScanner {
    /**
     * reports currently available scan results on appropriate listeners
     * @return true if all scan results were reported correctly
     * @deprecated Background scan support is removed.
     */
    @Deprecated
    @RequiresPermission(android.Manifest.permission.LOCATION_HARDWARE)
    public boolean getScanResults() {
        validateChannel();