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

Commit 592b9590 authored by Vinit Deshpande's avatar Vinit Deshpande Committed by Android (Google) Code Review
Browse files

Merge "Implement getAvailableChannels" into lmp-dev

parents f43f04ed 15f89078
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.net.wifi;

import android.os.Messenger;
import android.os.Bundle;

/**
 * {@hide}
@@ -24,4 +25,6 @@ import android.os.Messenger;
interface IWifiScanner
{
    Messenger getMessenger();

    Bundle getAvailableChannels(int band);
}
+10 −1
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.net.wifi;

import android.annotation.SystemApi;
import android.content.Context;
import android.os.Bundle;
import android.os.Handler;
import android.os.HandlerThread;
import android.os.Looper;
@@ -76,6 +77,9 @@ public class WifiScanner {
    /** Invalid request */
    public static final int REASON_INVALID_REQUEST = -3;

    /** @hide */
    public static final String GET_AVAILABLE_CHANNELS_EXTRA = "Channels";

    /**
     * Generic action callback invocation interface
     *  @hide
@@ -92,8 +96,13 @@ public class WifiScanner {
     * @hide
     */
    public List<Integer> getAvailableChannels(int band) {
        try {
            Bundle bundle =  mService.getAvailableChannels(band);
            return bundle.getIntegerArrayList(GET_AVAILABLE_CHANNELS_EXTRA);
        } catch (RemoteException e) {
            return null;
        }
    }

    /**
     * provides channel specification for scanning