Merge "Implement getAvailableChannels" into lmp-dev

This commit is contained in:
Vinit Deshpande
2014-09-09 01:28:44 +00:00
committed by Android (Google) Code Review
2 changed files with 13 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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;
}
}
/**