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

Commit 2564d9a4 authored by Mitchell Wills's avatar Mitchell Wills
Browse files

Expose gscan exponential backoff API

Will be ignored until scan scheduling supports it

Change-Id: I9d392080e6ec8dfa9a998f6c04ec37f9c6dad0b2
parent 80ac37d0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -21495,10 +21495,13 @@ package android.net.wifi {
    method public void writeToParcel(android.os.Parcel, int);
    field public int band;
    field public android.net.wifi.WifiScanner.ChannelSpec[] channels;
    field public int exponent;
    field public int maxPeriodInMs;
    field public int maxScansToCache;
    field public int numBssidsPerScan;
    field public int periodInMs;
    field public int reportEvents;
    field public int stepCount;
  }
  public static abstract interface WifiScanner.WifiChangeListener implements android.net.wifi.WifiScanner.ActionListener {
+22 −0
Original line number Diff line number Diff line
@@ -168,6 +168,22 @@ public class WifiScanner {
         * to wake up at fixed interval
         */
        public int maxScansToCache;
        /**
         * if maxPeriodInMs is non zero or different than period, then this bucket is
         * an exponential backoff bucket and the scan period will grow exponentially
         * as per formula: actual_period(N) = period ^ (N/(step_count+1))
         * to a maximum period of max_period.
         */
        public int maxPeriodInMs;
        /**
         * for exponential back off bucket: multiplier: new_period=old_period*exponent
         */
        public int exponent;
        /**
         * for exponential back off bucket, number of scans performed at a given
         * period and until the exponent is applied
         */
        public int stepCount;

        /** Implement the Parcelable interface {@hide} */
        public int describeContents() {
@@ -181,6 +197,9 @@ public class WifiScanner {
            dest.writeInt(reportEvents);
            dest.writeInt(numBssidsPerScan);
            dest.writeInt(maxScansToCache);
            dest.writeInt(maxPeriodInMs);
            dest.writeInt(exponent);
            dest.writeInt(stepCount);

            if (channels != null) {
                dest.writeInt(channels.length);
@@ -206,6 +225,9 @@ public class WifiScanner {
                        settings.reportEvents = in.readInt();
                        settings.numBssidsPerScan = in.readInt();
                        settings.maxScansToCache = in.readInt();
                        settings.maxPeriodInMs = in.readInt();
                        settings.exponent = in.readInt();
                        settings.stepCount = in.readInt();
                        int num_channels = in.readInt();
                        settings.channels = new ChannelSpec[num_channels];
                        for (int i = 0; i < num_channels; i++) {