summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wifi/java/android/net/wifi/nan/IWifiNanEventCallback.aidl2
-rw-r--r--wifi/java/android/net/wifi/nan/WifiNanEventCallback.java14
-rw-r--r--wifi/java/android/net/wifi/nan/WifiNanManager.java7
3 files changed, 13 insertions, 10 deletions
diff --git a/wifi/java/android/net/wifi/nan/IWifiNanEventCallback.aidl b/wifi/java/android/net/wifi/nan/IWifiNanEventCallback.aidl
index b95140e88ae7..a4e590beca59 100644
--- a/wifi/java/android/net/wifi/nan/IWifiNanEventCallback.aidl
+++ b/wifi/java/android/net/wifi/nan/IWifiNanEventCallback.aidl
@@ -28,7 +28,7 @@ oneway interface IWifiNanEventCallback
{
void onConnectSuccess();
void onConnectFail(int reason);
- void onIdentityChanged();
+ void onIdentityChanged(in byte[] mac);
void onRangingSuccess(int rangingId, in RttManager.ParcelableRttResults results);
void onRangingFailure(int rangingId, int reason, in String description);
diff --git a/wifi/java/android/net/wifi/nan/WifiNanEventCallback.java b/wifi/java/android/net/wifi/nan/WifiNanEventCallback.java
index 2b9a5fa133b0..148307d70430 100644
--- a/wifi/java/android/net/wifi/nan/WifiNanEventCallback.java
+++ b/wifi/java/android/net/wifi/nan/WifiNanEventCallback.java
@@ -62,7 +62,7 @@ public class WifiNanEventCallback {
* Called when NAN connect operation
* {@link WifiNanManager#connect(android.os.Looper, WifiNanEventCallback)}
* is completed. Doesn't necessarily mean that have joined or started a NAN
- * cluster. An indication is provided by {@link #onIdentityChanged()}.
+ * cluster. An indication is provided by {@link #onIdentityChanged(byte[])}.
*/
public void onConnectSuccess() {
/* empty */
@@ -81,12 +81,14 @@ public class WifiNanEventCallback {
}
/**
- * Called when NAN identity has changed. This may be due to joining a
- * cluster, starting a cluster, or discovery interface change. The
- * implication is that peers you've been communicating with may no longer
- * recognize you and you need to re-establish your identity.
+ * Called when NAN identity has changed and after {@link #onConnectSuccess()}. Call may be
+ * due to joining a cluster, starting a cluster, or discovery interface change. The
+ * implication is that peers you've been communicating with may no longer recognize you and
+ * you need to re-establish your identity.
+ * @param mac The MAC address of the NAN discovery interface. Depending on the permission
+ * model may be all 0's.
*/
- public void onIdentityChanged() {
+ public void onIdentityChanged(byte[] mac) {
/* empty */
}
}
diff --git a/wifi/java/android/net/wifi/nan/WifiNanManager.java b/wifi/java/android/net/wifi/nan/WifiNanManager.java
index 84de93467866..dd440e2bf41a 100644
--- a/wifi/java/android/net/wifi/nan/WifiNanManager.java
+++ b/wifi/java/android/net/wifi/nan/WifiNanManager.java
@@ -819,7 +819,7 @@ public class WifiNanManager {
originalCallback.onConnectFail(msg.arg1);
break;
case CALLBACK_IDENTITY_CHANGED:
- originalCallback.onIdentityChanged();
+ originalCallback.onIdentityChanged((byte[]) msg.obj);
break;
case CALLBACK_RANGING_SUCCESS: {
RttManager.RttListener listener = getAndRemoveRangingListener(msg.arg1);
@@ -875,10 +875,11 @@ public class WifiNanManager {
}
@Override
- public void onIdentityChanged() {
- if (VDBG) Log.v(TAG, "onIdentityChanged");
+ public void onIdentityChanged(byte[] mac) {
+ if (VDBG) Log.v(TAG, "onIdentityChanged: mac=" + new String(HexEncoding.encode(mac)));
Message msg = mHandler.obtainMessage(CALLBACK_IDENTITY_CHANGED);
+ msg.obj = mac;
mHandler.sendMessage(msg);
}