Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit baa4d940 authored by Etan Cohen's avatar Etan Cohen Committed by android-build-merger
Browse files

[NAN] Provide inteface MAC address to app.

am: d097f8a4

Change-Id: I62b0b2cfd4a95c23b89c938cef1118ab81c304ce
parents bc47300b d097f8a4
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+8 −6
Original line number Diff line number Diff line
@@ -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 */
    }
}
+4 −3
Original line number Diff line number Diff line
@@ -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);
        }