summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/current.txt4
-rw-r--r--wifi/java/android/net/wifi/WifiInfo.java25
2 files changed, 27 insertions, 2 deletions
diff --git a/api/current.txt b/api/current.txt
index 23a7006..9351fff 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -15384,6 +15384,7 @@ package android.net.wifi {
method public int describeContents();
method public java.lang.String getBSSID();
method public static android.net.NetworkInfo.DetailedState getDetailedStateOf(android.net.wifi.SupplicantState);
+ method public int getFrequency();
method public boolean getHiddenSSID();
method public int getIpAddress();
method public int getLinkSpeed();
@@ -15393,6 +15394,7 @@ package android.net.wifi {
method public java.lang.String getSSID();
method public android.net.wifi.SupplicantState getSupplicantState();
method public void writeToParcel(android.os.Parcel, int);
+ field public static final java.lang.String FREQUENCY_UNITS = "MHz";
field public static final java.lang.String LINK_SPEED_UNITS = "Mbps";
}
@@ -18362,7 +18364,7 @@ package android.os {
public abstract class CountDownTimer {
ctor public CountDownTimer(long, long);
- method public final void cancel();
+ method public final synchronized void cancel();
method public abstract void onFinish();
method public abstract void onTick(long);
method public final synchronized android.os.CountDownTimer start();
diff --git a/wifi/java/android/net/wifi/WifiInfo.java b/wifi/java/android/net/wifi/WifiInfo.java
index 6a13067..4a6821c 100644
--- a/wifi/java/android/net/wifi/WifiInfo.java
+++ b/wifi/java/android/net/wifi/WifiInfo.java
@@ -69,6 +69,10 @@ public class WifiInfo implements Parcelable {
public static final String LINK_SPEED_UNITS = "Mbps";
private int mLinkSpeed;
+ /** Frequency in MHz */
+ public static final String FREQUENCY_UNITS = "MHz";
+ private int mFrequency;
+
private InetAddress mIpAddress;
private String mMacAddress;
@@ -86,6 +90,7 @@ public class WifiInfo implements Parcelable {
mSupplicantState = SupplicantState.UNINITIALIZED;
mRssi = -9999;
mLinkSpeed = -1;
+ mFrequency = -1;
}
/**
@@ -100,6 +105,7 @@ public class WifiInfo implements Parcelable {
mNetworkId = source.mNetworkId;
mRssi = source.mRssi;
mLinkSpeed = source.mLinkSpeed;
+ mFrequency = source.mFrequency;
mIpAddress = source.mIpAddress;
mMacAddress = source.mMacAddress;
mMeteredHint = source.mMeteredHint;
@@ -179,6 +185,20 @@ public class WifiInfo implements Parcelable {
}
/**
+ * Returns the current frequency in {@link #FREQUENCY_UNITS}.
+ * @return the frequency.
+ * @see #FREQUENCY_UNITS
+ */
+ public int getFrequency() {
+ return mFrequency;
+ }
+
+ /** @hide */
+ public void setFrequency(int frequency) {
+ this.mFrequency = frequency;
+ }
+
+ /**
* Record the MAC address of the WLAN interface
* @param macAddress the MAC address in {@code XX:XX:XX:XX:XX:XX} form
* @hide
@@ -303,7 +323,8 @@ public class WifiInfo implements Parcelable {
append(", Supplicant state: ").
append(mSupplicantState == null ? none : mSupplicantState).
append(", RSSI: ").append(mRssi).
- append(", Link speed: ").append(mLinkSpeed).
+ append(", Link speed: ").append(mLinkSpeed).append(LINK_SPEED_UNITS).
+ append(", Frequency: ").append(mFrequency).append(FREQUENCY_UNITS).
append(", Net ID: ").append(mNetworkId).
append(", Metered hint: ").append(mMeteredHint);
@@ -320,6 +341,7 @@ public class WifiInfo implements Parcelable {
dest.writeInt(mNetworkId);
dest.writeInt(mRssi);
dest.writeInt(mLinkSpeed);
+ dest.writeInt(mFrequency);
if (mIpAddress != null) {
dest.writeByte((byte)1);
dest.writeByteArray(mIpAddress.getAddress());
@@ -346,6 +368,7 @@ public class WifiInfo implements Parcelable {
info.setNetworkId(in.readInt());
info.setRssi(in.readInt());
info.setLinkSpeed(in.readInt());
+ info.setFrequency(in.readInt());
if (in.readByte() == 1) {
try {
info.setInetAddress(InetAddress.getByAddress(in.createByteArray()));