Merge "Implement getAvailableChannels" into lmp-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
592b95901e
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,7 +96,12 @@ public class WifiScanner {
|
||||
* @hide
|
||||
*/
|
||||
public List<Integer> getAvailableChannels(int band) {
|
||||
return null;
|
||||
try {
|
||||
Bundle bundle = mService.getAvailableChannels(band);
|
||||
return bundle.getIntegerArrayList(GET_AVAILABLE_CHANNELS_EXTRA);
|
||||
} catch (RemoteException e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user