diff options
Diffstat (limited to 'wifi/java/android')
8 files changed, 314 insertions, 109 deletions
diff --git a/wifi/java/android/net/wifi/ScanResult.java b/wifi/java/android/net/wifi/ScanResult.java index 99151c3..8191edd 100644 --- a/wifi/java/android/net/wifi/ScanResult.java +++ b/wifi/java/android/net/wifi/ScanResult.java @@ -89,6 +89,21 @@ public class ScanResult implements Parcelable { * {@hide} */ public final static int UNSPECIFIED = -1; + /** + * @hide + * TODO: makes real freq boundaries + */ + public boolean is24GHz() { + return frequency > 2400 && frequency < 2500; + } + + /** + * @hide + * TODO: makes real freq boundaries + */ + public boolean is5GHz() { + return frequency > 4900 && frequency < 5900; + } /** information element from beacon * @hide diff --git a/wifi/java/android/net/wifi/WifiConfiguration.java b/wifi/java/android/net/wifi/WifiConfiguration.java index 192cba6..48396d5 100644 --- a/wifi/java/android/net/wifi/WifiConfiguration.java +++ b/wifi/java/android/net/wifi/WifiConfiguration.java @@ -405,6 +405,10 @@ public class WifiConfiguration implements Parcelable { /** @hide **/ public static int INITIAL_AUTO_JOIN_ATTEMPT_MIN_5 = -70; + /** @hide + * 5GHz band is prefered over 2.4 if the 5GHz RSSI is higher than this threshold **/ + public static int A_BAND_PREFERENCE_RSSI_THRESHOLD = -65; + /** * @hide * A summary of the RSSI and Band status for that configuration @@ -481,11 +485,11 @@ public class WifiConfiguration implements Parcelable { if (result.seen == 0) continue; - if ((result.frequency > 4900) && (result.frequency < 5900)) { + if (result.is5GHz()) { //strictly speaking: [4915, 5825] //number of known BSSID on 5GHz band status.num5 = status.num5 + 1; - } else if ((result.frequency > 2400) && (result.frequency < 2500)) { + } else if (result.is24GHz()) { //strictly speaking: [2412, 2482] //number of known BSSID on 2.4Ghz band status.num24 = status.num24 + 1; @@ -493,12 +497,12 @@ public class WifiConfiguration implements Parcelable { if ((now_ms - result.seen) > age) continue; - if ((result.frequency > 4900) && (result.frequency < 5900)) { + if (result.is5GHz()) { if (result.level > status.rssi5) { status.rssi5 = result.level; status.age5 = result.seen; } - } else if ((result.frequency > 2400) && (result.frequency < 2500)) { + } else if (result.is24GHz()) { if (result.level > status.rssi24) { status.rssi24 = result.level; status.age24 = result.seen; @@ -547,6 +551,17 @@ public class WifiConfiguration implements Parcelable { */ public long blackListTimestamp; + /** + * @hide + * last time the system was connected to this configuration. + */ + public long lastConnected; + + /** + * @hide + * last time the system was disconnected to this configuration. + */ + public long lastDisconnected; /** * Set if the configuration was self added by the framework @@ -658,7 +673,20 @@ public class WifiConfiguration implements Parcelable { // TODO: Add more checks return true; + } + /** + * Helper function, identify if a configuration is linked + * @hide + */ + public boolean isLinked(WifiConfiguration config) { + if (config.linkedConfigurations != null && linkedConfigurations != null) { + if (config.linkedConfigurations.get(configKey()) != null + && linkedConfigurations.get(config.configKey()) != null) { + return true; + } + } + return false; } /** @@ -688,6 +716,7 @@ public class WifiConfiguration implements Parcelable { /** @hide **/ public void setAutoJoinStatus(int status) { + if (status < 0) status = 0; if (status == 0) { blackListTimestamp = 0; } else if (status > autoJoinStatus) { @@ -1079,6 +1108,8 @@ public class WifiConfiguration implements Parcelable { creatorUid = source.creatorUid; peerWifiConfiguration = source.peerWifiConfiguration; blackListTimestamp = source.blackListTimestamp; + lastConnected = source.lastConnected; + lastDisconnected = source.lastDisconnected; } } diff --git a/wifi/java/android/net/wifi/WifiInfo.java b/wifi/java/android/net/wifi/WifiInfo.java index f6a94d0..6760c56 100644 --- a/wifi/java/android/net/wifi/WifiInfo.java +++ b/wifi/java/android/net/wifi/WifiInfo.java @@ -62,6 +62,17 @@ public class WifiInfo implements Parcelable { private String mBSSID; private WifiSsid mWifiSsid; private int mNetworkId; + + /** @hide **/ + public static final int INVALID_RSSI = -127; + + /** @hide **/ + public static final int MIN_RSSI = -126; + + /** @hide **/ + public static final int MAX_RSSI = 200; + + /** * Received Signal Strength Indicator */ @@ -131,7 +142,8 @@ public class WifiInfo implements Parcelable { public int score; /** - * @hide * + * TODO: get actual timestamp and calculate true rates + * @hide */ public void updatePacketRates(WifiLinkLayerStats stats) { if (stats != null) { @@ -156,17 +168,42 @@ public class WifiInfo implements Parcelable { rxSuccess = rxgood; txRetries = txretries; } else { - txBadRate = 0; + txBad = 0; txSuccess = 0; rxSuccess = 0; txRetries = 0; + txBadRate = 0; + txSuccessRate = 0; + rxSuccessRate = 0; + txRetriesRate = 0; } } + /** - * Flag indicating that AP has hinted that upstream connection is metered, - * and sensitive to heavy data transfers. + * This function is less powerful and used if the WifiLinkLayerStats API is not implemented + * at the Wifi HAL + * @hide */ + public void updatePacketRates(long txPackets, long rxPackets) { + //paranoia + txBad = 0; + txRetries = 0; + txBadRate = 0; + txRetriesRate = 0; + + txSuccessRate = (txSuccessRate * 0.5) + + ((double) (txPackets - txSuccess) * 0.5); + rxSuccessRate = (rxSuccessRate * 0.5) + + ((double) (rxPackets - rxSuccess) * 0.5); + txSuccess = txPackets; + rxSuccess = rxPackets; + } + + /** + * Flag indicating that AP has hinted that upstream connection is metered, + * and sensitive to heavy data transfers. + */ private boolean mMeteredHint; /** @hide */ @@ -175,9 +212,32 @@ public class WifiInfo implements Parcelable { mBSSID = null; mNetworkId = -1; mSupplicantState = SupplicantState.UNINITIALIZED; - mRssi = -9999; + mRssi = INVALID_RSSI; mLinkSpeed = -1; mFrequency = -1; + txBad = 0; + } + + /** @hide */ + public void reset() { + setInetAddress(null); + setBSSID(null); + setSSID(null); + setNetworkId(-1); + setRssi(INVALID_RSSI); + setLinkSpeed(-1); + setFrequency(-1); + setMeteredHint(false); + txSuccess = 0; + rxSuccess = 0; + txRetries = 0; + txBadRate = 0; + txSuccessRate = 0; + rxSuccessRate = 0; + txRetriesRate = 0; + lowRssiCount = 0; + badRssiCount = 0; + score = 0; } /** @@ -256,7 +316,7 @@ public class WifiInfo implements Parcelable { /** * Returns the received signal strength indicator of the current 802.11 * network, in dBm. - * @return the RSSI, in the range -110 to 10 + * @return the RSSI, in the range -127 to 200 */ public int getRssi() { return mRssi; @@ -264,6 +324,10 @@ public class WifiInfo implements Parcelable { /** @hide */ public void setRssi(int rssi) { + if (rssi < INVALID_RSSI) + rssi = INVALID_RSSI; + if (rssi > MAX_RSSI) + rssi = MAX_RSSI; mRssi = rssi; } diff --git a/wifi/java/android/net/wifi/WifiScanner.java b/wifi/java/android/net/wifi/WifiScanner.java index 3b65ca8..21b700d 100644 --- a/wifi/java/android/net/wifi/WifiScanner.java +++ b/wifi/java/android/net/wifi/WifiScanner.java @@ -153,12 +153,17 @@ public class WifiScanner { dest.writeInt(band); dest.writeInt(periodInMs); dest.writeInt(reportEvents); - dest.writeInt(channels.length); - for (int i = 0; i < channels.length; i++) { - dest.writeInt(channels[i].frequency); - dest.writeInt(channels[i].dwellTimeMS); - dest.writeInt(channels[i].passive ? 1 : 0); + if (channels != null) { + dest.writeInt(channels.length); + + for (int i = 0; i < channels.length; i++) { + dest.writeInt(channels[i].frequency); + dest.writeInt(channels[i].dwellTimeMS); + dest.writeInt(channels[i].passive ? 1 : 0); + } + } else { + dest.writeInt(0); } } @@ -211,10 +216,14 @@ public class WifiScanner { /** Implement the Parcelable interface {@hide} */ public void writeToParcel(Parcel dest, int flags) { - dest.writeInt(mResults.length); - for (int i = 0; i < mResults.length; i++) { - ScanResult result = mResults[i]; - result.writeToParcel(dest, flags); + if (mResults != null) { + dest.writeInt(mResults.length); + for (int i = 0; i < mResults.length; i++) { + ScanResult result = mResults[i]; + result.writeToParcel(dest, flags); + } + } else { + dest.writeInt(0); } } @@ -324,13 +333,17 @@ public class WifiScanner { dest.writeInt(unchangedSampleSize); dest.writeInt(minApsBreachingThreshold); dest.writeInt(periodInMs); - dest.writeInt(hotspotInfos.length); - for (int i = 0; i < hotspotInfos.length; i++) { - HotspotInfo info = hotspotInfos[i]; - dest.writeString(info.bssid); - dest.writeInt(info.low); - dest.writeInt(info.high); - dest.writeInt(info.frequencyHint); + if (hotspotInfos != null) { + dest.writeInt(hotspotInfos.length); + for (int i = 0; i < hotspotInfos.length; i++) { + HotspotInfo info = hotspotInfos[i]; + dest.writeString(info.bssid); + dest.writeInt(info.low); + dest.writeInt(info.high); + dest.writeInt(info.frequencyHint); + } + } else { + dest.writeInt(0); } } @@ -456,13 +469,18 @@ public class WifiScanner { /** Implement the Parcelable interface {@hide} */ public void writeToParcel(Parcel dest, int flags) { dest.writeInt(apLostThreshold); - dest.writeInt(hotspotInfos.length); - for (int i = 0; i < hotspotInfos.length; i++) { - HotspotInfo info = hotspotInfos[i]; - dest.writeString(info.bssid); - dest.writeInt(info.low); - dest.writeInt(info.high); - dest.writeInt(info.frequencyHint); + + if (hotspotInfos != null) { + dest.writeInt(hotspotInfos.length); + for (int i = 0; i < hotspotInfos.length; i++) { + HotspotInfo info = hotspotInfos[i]; + dest.writeString(info.bssid); + dest.writeInt(info.low); + dest.writeInt(info.high); + dest.writeInt(info.frequencyHint); + } + } else { + dest.writeInt(0); } } @@ -680,6 +698,42 @@ public class WifiScanner { } } + /** @hide */ + public static class OperationResult implements Parcelable { + public int reason; + public String description; + + public OperationResult(int reason, String description) { + this.reason = reason; + this.description = description; + } + + /** Implement the Parcelable interface {@hide} */ + public int describeContents() { + return 0; + } + + /** Implement the Parcelable interface {@hide} */ + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(reason); + dest.writeString(description); + } + + /** Implement the Parcelable interface {@hide} */ + public static final Creator<OperationResult> CREATOR = + new Creator<OperationResult>() { + public OperationResult createFromParcel(Parcel in) { + int reason = in.readInt(); + String description = in.readString(); + return new OperationResult(reason, description); + } + + public OperationResult[] newArray(int size) { + return new OperationResult[size]; + } + }; + } + private static class ServiceHandler extends Handler { ServiceHandler(Looper looper) { super(looper); @@ -717,9 +771,11 @@ public class WifiScanner { case CMD_OP_SUCCEEDED : ((ActionListener) listener).onSuccess(); break; - case CMD_OP_FAILED : - ((ActionListener) listener).onFailure(msg.arg1, (String)msg.obj); - removeListener(msg.arg2); + case CMD_OP_FAILED : { + OperationResult result = (OperationResult)msg.obj; + ((ActionListener) listener).onFailure(result.reason, result.description); + removeListener(msg.arg2); + } break; case CMD_SCAN_RESULT : ((ScanListener) listener).onResults( diff --git a/wifi/java/android/net/wifi/passpoint/IWifiPasspointManager.aidl b/wifi/java/android/net/wifi/passpoint/IWifiPasspointManager.aidl index 8375d09..61c2b8a 100644 --- a/wifi/java/android/net/wifi/passpoint/IWifiPasspointManager.aidl +++ b/wifi/java/android/net/wifi/passpoint/IWifiPasspointManager.aidl @@ -16,6 +16,8 @@ package android.net.wifi.passpoint; +import android.net.wifi.ScanResult; +import android.net.wifi.passpoint.WifiPasspointPolicy; import android.os.Messenger; /** @@ -27,5 +29,6 @@ interface IWifiPasspointManager { Messenger getMessenger(); int getPasspointState(); + List<WifiPasspointPolicy> requestCredentialMatch(in List<ScanResult> requested); } diff --git a/wifi/java/android/net/wifi/passpoint/WifiPasspointInfo.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointInfo.java index 8ab5c1e..aec87976 100644 --- a/wifi/java/android/net/wifi/passpoint/WifiPasspointInfo.java +++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointInfo.java @@ -286,10 +286,11 @@ public class WifiPasspointInfo implements Parcelable { public String toString() { StringBuffer sb = new StringBuffer(); - sb.append("BSSID: ").append(bssid); + sb.append("BSSID: ").append("(").append(bssid).append(")"); if (venueName != null) - sb.append(" venueName: ").append(venueName.replace("\n", "\\n")); + sb.append(" venueName: ").append("(") + .append(venueName.replace("\n", "\\n")).append(")"); if (networkAuthType != null) { sb.append(" networkAuthType: "); diff --git a/wifi/java/android/net/wifi/passpoint/WifiPasspointManager.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointManager.java index 55acbad..2f158c2 100644 --- a/wifi/java/android/net/wifi/passpoint/WifiPasspointManager.java +++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointManager.java @@ -22,6 +22,8 @@ import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.Messenger; +import android.os.Parcel; +import android.os.Parcelable; import android.os.RemoteException; import android.util.Log; @@ -45,58 +47,53 @@ public class WifiPasspointManager { /* Passpoint states values */ - /** Passpoint is in an known state. This should only occur in boot time @hide */ + /** Passpoint is in an unknown state. This should only occur in boot time */ public static final int PASSPOINT_STATE_UNKNOWN = 0; - /** Passpoint is disabled. This occurs when wifi is disabled. @hide */ + /** Passpoint is disabled. This occurs when wifi is disabled */ public static final int PASSPOINT_STATE_DISABLED = 1; - /** Passpoint is enabled and in discovery state. @hide */ + /** Passpoint is enabled and in discovery state */ public static final int PASSPOINT_STATE_DISCOVERY = 2; - /** Passpoint is enabled and in access state. @hide */ + /** Passpoint is enabled and in access state */ public static final int PASSPOINT_STATE_ACCESS = 3; - /** Passpoint is enabled and in provisioning state. @hide */ + /** Passpoint is enabled and in provisioning state */ public static final int PASSPOINT_STATE_PROVISION = 4; /* Passpoint callback error codes */ - /** Indicates that the operation failed due to an internal error @hide */ - public static final int ERROR = 0; + /** Indicates that the operation failed due to an internal error */ + public static final int REASON_ERROR = 0; - /** Indicates that the operation failed because wifi is disabled @hide */ - public static final int WIFI_DISABLED = 1; + /** Indicates that the operation failed because wifi is disabled */ + public static final int REASON_WIFI_DISABLED = 1; - /** Indicates that the operation failed because the framework is busy @hide */ - public static final int BUSY = 2; + /** Indicates that the operation failed because the framework is busy */ + public static final int REASON_BUSY = 2; + + /** Indicates that the operation failed because parameter is invalid */ + public static final int REASON_INVALID_PARAMETER = 3; + + /** Indicates that the operation failed because the server is not trusted */ + public static final int REASON_NOT_TRUSTED = 4; /** * protocol supported for Passpoint - * @hide */ public static final String PROTOCOL_DM = "OMA-DM-ClientInitiated"; /** * protocol supported for Passpoint - * @hide */ public static final String PROTOCOL_SOAP = "SPP-ClientInitiated"; /* Passpoint broadcasts */ /** - * Broadcast intent action indicating that Passpoint online sign up is - * avaiable. - * @hide - */ - public static final String PASSPOINT_OSU_AVAILABLE = - "android.net.wifi.passpoint.OSU_AVAILABLE"; - - /** * Broadcast intent action indicating that the state of Passpoint * connectivity has changed - * @hide */ public static final String PASSPOINT_STATE_CHANGED_ACTION = "android.net.wifi.passpoint.STATE_CHANGE"; @@ -104,7 +101,6 @@ public class WifiPasspointManager { /** * Broadcast intent action indicating that the saved Passpoint credential * list has changed - * @hide */ public static final String PASSPOINT_CRED_CHANGED_ACTION = "android.net.wifi.passpoint.CRED_CHANGE"; @@ -112,21 +108,18 @@ public class WifiPasspointManager { /** * Broadcast intent action indicating that Passpoint online sign up is * avaiable. - * @hide */ public static final String PASSPOINT_OSU_AVAILABLE_ACTION = "android.net.wifi.passpoint.OSU_AVAILABLE"; /** * Broadcast intent action indicating that user remediation is required - * @hide */ public static final String PASSPOINT_USER_REM_REQ_ACTION = "android.net.wifi.passpoint.USER_REM_REQ"; /** * Interface for callback invocation when framework channel is lost - * @hide */ public interface ChannelListener { /** @@ -138,14 +131,13 @@ public class WifiPasspointManager { /** * Interface for callback invocation on an application action - * @hide */ public interface ActionListener { /** The operation succeeded */ public void onSuccess(); /** - * * The operation failed + * The operation failed * * @param reason The reason for failure could be one of * {@link #WIFI_DISABLED}, {@link #ERROR} or {@link #BUSY} @@ -155,7 +147,6 @@ public class WifiPasspointManager { /** * Interface for callback invocation when doing OSU or user remediation - * @hide */ public interface OsuRemListener { /** The operation succeeded */ @@ -171,11 +162,11 @@ public class WifiPasspointManager { /** * Browser launch is requried for user interaction. When this callback - * is called, app should launch browser / webview to the given URL. + * is called, app should launch browser / webview to the given URI. * - * @param url URL for browser launch + * @param uri URI for browser launch */ - public void onBrowserLaunch(String url); + public void onBrowserLaunch(String uri); /** * When this is called, app should dismiss the previously lanched browser. @@ -187,7 +178,6 @@ public class WifiPasspointManager { * A channel that connects the application to the wifi passpoint framework. * Most passpoint operations require a Channel as an argument. * An instance of Channel is obtained by doing a call on {@link #initialize} - * @hide */ public static class Channel { private final static int INVALID_LISTENER_KEY = 0; @@ -288,7 +278,8 @@ public class WifiPasspointManager { @Override public void handleMessage(Message message) { - Object listener = getListener(message.arg2, false); + Object listener = null; + switch (message.what) { case AsyncChannel.CMD_CHANNEL_DISCONNECTED: if (mChannelListener != null) { @@ -300,6 +291,7 @@ public class WifiPasspointManager { case REQUEST_ANQP_INFO_SUCCEEDED: WifiPasspointInfo result = (WifiPasspointInfo) message.obj; anqpRequestFinish(result); + listener = getListener(message.arg2, false); if (listener != null) { ((ActionListener) listener).onSuccess(); } @@ -307,6 +299,7 @@ public class WifiPasspointManager { case REQUEST_ANQP_INFO_FAILED: anqpRequestFinish((ScanResult) message.obj); + listener = getListener(message.arg2, false); if (listener == null) getListener(message.arg2, true); if (listener != null) { @@ -314,6 +307,31 @@ public class WifiPasspointManager { } break; + case START_OSU_SUCCEEDED: + listener = getListener(message.arg2, true); + if (listener != null) { + ((OsuRemListener) listener).onSuccess(); + } + break; + + case START_OSU_FAILED: + listener = getListener(message.arg2, true); + if (listener != null) { + ((OsuRemListener) listener).onFailure(message.arg1); + } + break; + + case START_OSU_BROWSER: + listener = getListener(message.arg2, true); + if (listener != null) { + ParcelableString str = (ParcelableString) message.obj; + if (str.string == null) + ((OsuRemListener) listener).onBrowserDismiss(); + else + ((OsuRemListener) listener).onBrowserLaunch(str.string); + } + break; + default: Log.d(TAG, "Ignored " + message); break; @@ -323,25 +341,46 @@ public class WifiPasspointManager { } - private static final int BASE = Protocol.BASE_WIFI_PASSPOINT_MANAGER; - - /** @hide */ - public static final int REQUEST_ANQP_INFO = BASE + 1; + public static class ParcelableString implements Parcelable { + public String string; - /** @hide */ - public static final int REQUEST_ANQP_INFO_FAILED = BASE + 2; + @Override + public int describeContents() { + return 0; + } - /** @hide */ - public static final int REQUEST_ANQP_INFO_SUCCEEDED = BASE + 3; + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(string); + } - /** @hide */ - public static final int REQUEST_OSU_INFO = BASE + 4; + public static final Parcelable.Creator<ParcelableString> CREATOR = + new Parcelable.Creator<ParcelableString>() { + @Override + public ParcelableString createFromParcel(Parcel in) { + ParcelableString ret = new ParcelableString(); + ret.string = in.readString(); + return ret; + } + @Override + public ParcelableString[] newArray(int size) { + return new ParcelableString[size]; + } + }; + } - /** @hide */ - public static final int REQUEST_OSU_INFO_FAILED = BASE + 5; + private static final int BASE = Protocol.BASE_WIFI_PASSPOINT_MANAGER; - /** @hide */ - public static final int REQUEST_OSU_INFO_SUCCEEDED = BASE + 6; + public static final int REQUEST_ANQP_INFO = BASE + 1; + public static final int REQUEST_ANQP_INFO_FAILED = BASE + 2; + public static final int REQUEST_ANQP_INFO_SUCCEEDED = BASE + 3; + public static final int REQUEST_OSU_ICON = BASE + 4; + public static final int REQUEST_OSU_ICON_FAILED = BASE + 5; + public static final int REQUEST_OSU_ICON_SUCCEEDED = BASE + 6; + public static final int START_OSU = BASE + 7; + public static final int START_OSU_BROWSER = BASE + 8; + public static final int START_OSU_FAILED = BASE + 9; + public static final int START_OSU_SUCCEEDED = BASE + 10; private Context mContext; IWifiPasspointManager mService; @@ -350,7 +389,6 @@ public class WifiPasspointManager { * TODO: doc * @param context * @param service - * @hide */ public WifiPasspointManager(Context context, IWifiPasspointManager service) { mContext = context; @@ -368,7 +406,6 @@ public class WifiPasspointManager { * @return Channel instance that is necessary for performing any further * passpoint operations * - * @hide */ public Channel initialize(Context srcContext, Looper srcLooper, ChannelListener listener) { Messenger messenger = getMessenger(); @@ -387,8 +424,6 @@ public class WifiPasspointManager { /** * STOPSHIP: temp solution, should use supplicant manager instead, check * with b/13931972 - * - * @hide */ public Messenger getMessenger() { try { @@ -398,7 +433,6 @@ public class WifiPasspointManager { } } - /** @hide */ public int getPasspointState() { try { return mService.getPasspointState(); @@ -407,7 +441,6 @@ public class WifiPasspointManager { } } - /** @hide */ public void requestAnqpInfo(Channel c, List<ScanResult> requested, int mask, ActionListener listener) { Log.d(TAG, "requestAnqpInfo start"); @@ -434,14 +467,16 @@ public class WifiPasspointManager { Log.d(TAG, "requestAnqpInfo end"); } - /** @hide */ public void requestOsuIcons(Channel c, List<WifiPasspointOsuProvider> requested, int resolution, ActionListener listener) { } - /** @hide */ public List<WifiPasspointPolicy> requestCredentialMatch(List<ScanResult> requested) { - return null; + try { + return mService.requestCredentialMatch(requested); + } catch (RemoteException e) { + return null; + } } /** @@ -486,21 +521,21 @@ public class WifiPasspointManager { return true; } - /** @hide */ - public void startOsu(Channel c, WifiPasspointOsuProvider selected, OsuRemListener listener) { - + public void startOsu(Channel c, WifiPasspointOsuProvider osu, OsuRemListener listener) { + Log.d(TAG, "startOsu start"); + checkChannel(c); + int key = c.putListener(listener); + c.mAsyncChannel.sendMessage(START_OSU, 0, key, osu); + Log.d(TAG, "startOsu end"); } - /** @hide */ public void startUserRemediation(Channel c, OsuRemListener listener) { } - /** @hide */ - public void connect(WifiPasspointPolicy selected) { + public void connect(WifiPasspointPolicy policy) { } private static void checkChannel(Channel c) { - if (c == null) - throw new IllegalArgumentException("Channel needs to be initialized"); + if (c == null) throw new IllegalArgumentException("Channel needs to be initialized"); } } diff --git a/wifi/java/android/net/wifi/passpoint/WifiPasspointOsuProvider.java b/wifi/java/android/net/wifi/passpoint/WifiPasspointOsuProvider.java index f40dc4f..b54b70c 100644 --- a/wifi/java/android/net/wifi/passpoint/WifiPasspointOsuProvider.java +++ b/wifi/java/android/net/wifi/passpoint/WifiPasspointOsuProvider.java @@ -87,12 +87,12 @@ public class WifiPasspointOsuProvider implements Parcelable { @Override public String toString() { StringBuffer sb = new StringBuffer(); - sb.append("SSID: ").append(ssid); + sb.append("SSID: ").append("<").append(ssid).append(">"); if (friendlyName != null) - sb.append(" friendlyName: ").append(friendlyName); + sb.append(" friendlyName: ").append("<").append(friendlyName).append(">"); if (serverUri != null) - sb.append(" serverUri: ").append(serverUri); - sb.append(" osuMethod: ").append(osuMethod); + sb.append(" serverUri: ").append("<").append(serverUri).append(">"); + sb.append(" osuMethod: ").append("<").append(osuMethod).append(">"); if (iconFileName != null) { sb.append(" icon: <").append(iconWidth).append("x") .append(iconHeight).append(" ") @@ -100,9 +100,9 @@ public class WifiPasspointOsuProvider implements Parcelable { .append(iconFileName).append(">"); } if (osuNai != null) - sb.append(" osuNai: ").append(osuNai); + sb.append(" osuNai: ").append("<").append(osuNai).append(">"); if (osuService != null) - sb.append(" osuService: ").append(osuService); + sb.append(" osuService: ").append("<").append(osuService).append(">"); return sb.toString(); } |
