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

Commit ad3693d5 authored by Etan Cohen's avatar Etan Cohen
Browse files

[NAN] API cleanup - rename FLAGS. [DO NOT MERGE]

Per API guidelines - non-overlapping constants can be (should be)
named with "FLAG".

Bug: 27122760
Change-Id: If8b2c0f9b2818215a64b5635e76731c8fdfd3b8d
parent 2d3bea7f
Loading
Loading
Loading
Loading
+16 −16
Original line number Original line Diff line number Diff line
@@ -44,20 +44,20 @@ public class WifiNanEventCallback {
     * callback is {@link WifiNanEventCallback#onConfigCompleted(ConfigRequest)}
     * callback is {@link WifiNanEventCallback#onConfigCompleted(ConfigRequest)}
     * .
     * .
     */
     */
    public static final int LISTEN_CONFIG_COMPLETED = 0x1 << 0;
    public static final int FLAG_LISTEN_CONFIG_COMPLETED = 0x1 << 0;


    /**
    /**
     * Configuration failed callback event registration flag. Corresponding
     * Configuration failed callback event registration flag. Corresponding
     * callback is
     * callback is
     * {@link WifiNanEventCallback#onConfigFailed(ConfigRequest, int)}.
     * {@link WifiNanEventCallback#onConfigFailed(ConfigRequest, int)}.
     */
     */
    public static final int LISTEN_CONFIG_FAILED = 0x1 << 1;
    public static final int FLAG_LISTEN_CONFIG_FAILED = 0x1 << 1;


    /**
    /**
     * NAN cluster is down callback event registration flag. Corresponding
     * NAN cluster is down callback event registration flag. Corresponding
     * callback is {@link WifiNanEventCallback#onNanDown(int)}.
     * callback is {@link WifiNanEventCallback#onNanDown(int)}.
     */
     */
    public static final int LISTEN_NAN_DOWN = 0x1 << 2;
    public static final int FLAG_LISTEN_NAN_DOWN = 0x1 << 2;


    /**
    /**
     * NAN identity has changed event registration flag. This may be due to
     * NAN identity has changed event registration flag. This may be due to
@@ -66,7 +66,7 @@ public class WifiNanEventCallback {
     * recognize you and you need to re-establish your identity. Corresponding
     * recognize you and you need to re-establish your identity. Corresponding
     * callback is {@link WifiNanEventCallback#onIdentityChanged()}.
     * callback is {@link WifiNanEventCallback#onIdentityChanged()}.
     */
     */
    public static final int LISTEN_IDENTITY_CHANGED = 0x1 << 3;
    public static final int FLAG_LISTEN_IDENTITY_CHANGED = 0x1 << 3;


    private final Handler mHandler;
    private final Handler mHandler;


@@ -91,16 +91,16 @@ public class WifiNanEventCallback {
            public void handleMessage(Message msg) {
            public void handleMessage(Message msg) {
                if (DBG) Log.d(TAG, "What=" + msg.what + ", msg=" + msg);
                if (DBG) Log.d(TAG, "What=" + msg.what + ", msg=" + msg);
                switch (msg.what) {
                switch (msg.what) {
                    case LISTEN_CONFIG_COMPLETED:
                    case FLAG_LISTEN_CONFIG_COMPLETED:
                        WifiNanEventCallback.this.onConfigCompleted((ConfigRequest) msg.obj);
                        WifiNanEventCallback.this.onConfigCompleted((ConfigRequest) msg.obj);
                        break;
                        break;
                    case LISTEN_CONFIG_FAILED:
                    case FLAG_LISTEN_CONFIG_FAILED:
                        WifiNanEventCallback.this.onConfigFailed((ConfigRequest) msg.obj, msg.arg1);
                        WifiNanEventCallback.this.onConfigFailed((ConfigRequest) msg.obj, msg.arg1);
                        break;
                        break;
                    case LISTEN_NAN_DOWN:
                    case FLAG_LISTEN_NAN_DOWN:
                        WifiNanEventCallback.this.onNanDown(msg.arg1);
                        WifiNanEventCallback.this.onNanDown(msg.arg1);
                        break;
                        break;
                    case LISTEN_IDENTITY_CHANGED:
                    case FLAG_LISTEN_IDENTITY_CHANGED:
                        WifiNanEventCallback.this.onIdentityChanged();
                        WifiNanEventCallback.this.onIdentityChanged();
                        break;
                        break;
                }
                }
@@ -110,7 +110,7 @@ public class WifiNanEventCallback {


    /**
    /**
     * Called when NAN configuration is completed. Event will only be delivered
     * Called when NAN configuration is completed. Event will only be delivered
     * if registered using {@link WifiNanEventCallback#LISTEN_CONFIG_COMPLETED}.
     * if registered using {@link WifiNanEventCallback#FLAG_LISTEN_CONFIG_COMPLETED}.
     * A dummy (empty implementation printing out a warning). Make sure to
     * A dummy (empty implementation printing out a warning). Make sure to
     * override if registered.
     * override if registered.
     *
     *
@@ -125,7 +125,7 @@ public class WifiNanEventCallback {


    /**
    /**
     * Called when NAN configuration failed. Event will only be delivered if
     * Called when NAN configuration failed. Event will only be delivered if
     * registered using {@link WifiNanEventCallback#LISTEN_CONFIG_FAILED}. A
     * registered using {@link WifiNanEventCallback#FLAG_LISTEN_CONFIG_FAILED}. A
     * dummy (empty implementation printing out a warning). Make sure to
     * dummy (empty implementation printing out a warning). Make sure to
     * override if registered.
     * override if registered.
     *
     *
@@ -138,7 +138,7 @@ public class WifiNanEventCallback {


    /**
    /**
     * Called when NAN cluster is down. Event will only be delivered if
     * Called when NAN cluster is down. Event will only be delivered if
     * registered using {@link WifiNanEventCallback#LISTEN_NAN_DOWN}. A dummy
     * registered using {@link WifiNanEventCallback#FLAG_LISTEN_NAN_DOWN}. A dummy
     * (empty implementation printing out a warning). Make sure to override if
     * (empty implementation printing out a warning). Make sure to override if
     * registered.
     * registered.
     *
     *
@@ -155,7 +155,7 @@ public class WifiNanEventCallback {
     * implication is that peers you've been communicating with may no longer
     * implication is that peers you've been communicating with may no longer
     * recognize you and you need to re-establish your identity. Event will only
     * recognize you and you need to re-establish your identity. Event will only
     * be delivered if registered using
     * be delivered if registered using
     * {@link WifiNanEventCallback#LISTEN_IDENTITY_CHANGED}. A dummy (empty
     * {@link WifiNanEventCallback#FLAG_LISTEN_IDENTITY_CHANGED}. A dummy (empty
     * implementation printing out a warning). Make sure to override if
     * implementation printing out a warning). Make sure to override if
     * registered.
     * registered.
     */
     */
@@ -171,7 +171,7 @@ public class WifiNanEventCallback {
        public void onConfigCompleted(ConfigRequest completedConfig) {
        public void onConfigCompleted(ConfigRequest completedConfig) {
            if (VDBG) Log.v(TAG, "onConfigCompleted: configRequest=" + completedConfig);
            if (VDBG) Log.v(TAG, "onConfigCompleted: configRequest=" + completedConfig);


            Message msg = mHandler.obtainMessage(LISTEN_CONFIG_COMPLETED);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_CONFIG_COMPLETED);
            msg.obj = completedConfig;
            msg.obj = completedConfig;
            mHandler.sendMessage(msg);
            mHandler.sendMessage(msg);
        }
        }
@@ -182,7 +182,7 @@ public class WifiNanEventCallback {
                Log.v(TAG, "onConfigFailed: failedConfig=" + failedConfig + ", reason=" + reason);
                Log.v(TAG, "onConfigFailed: failedConfig=" + failedConfig + ", reason=" + reason);
            }
            }


            Message msg = mHandler.obtainMessage(LISTEN_CONFIG_FAILED);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_CONFIG_FAILED);
            msg.arg1 = reason;
            msg.arg1 = reason;
            msg.obj = failedConfig;
            msg.obj = failedConfig;
            mHandler.sendMessage(msg);
            mHandler.sendMessage(msg);
@@ -192,7 +192,7 @@ public class WifiNanEventCallback {
        public void onNanDown(int reason) {
        public void onNanDown(int reason) {
            if (VDBG) Log.v(TAG, "onNanDown: reason=" + reason);
            if (VDBG) Log.v(TAG, "onNanDown: reason=" + reason);


            Message msg = mHandler.obtainMessage(LISTEN_NAN_DOWN);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_NAN_DOWN);
            msg.arg1 = reason;
            msg.arg1 = reason;
            mHandler.sendMessage(msg);
            mHandler.sendMessage(msg);
        }
        }
@@ -201,7 +201,7 @@ public class WifiNanEventCallback {
        public void onIdentityChanged() {
        public void onIdentityChanged() {
            if (VDBG) Log.v(TAG, "onIdentityChanged");
            if (VDBG) Log.v(TAG, "onIdentityChanged");


            Message msg = mHandler.obtainMessage(LISTEN_IDENTITY_CHANGED);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_IDENTITY_CHANGED);
            mHandler.sendMessage(msg);
            mHandler.sendMessage(msg);
        }
        }
    };
    };
+29 −29
Original line number Original line Diff line number Diff line
@@ -52,13 +52,13 @@ public class WifiNanSessionCallback {
     *
     *
     * @hide
     * @hide
     */
     */
    public static final int LISTEN_PUBLISH_FAIL = 0x1 << 0;
    public static final int FLAG_LISTEN_PUBLISH_FAIL = 0x1 << 0;


    /**
    /**
     * Publish terminated callback event registration flag. Corresponding
     * Publish terminated callback event registration flag. Corresponding
     * callback is {@link WifiNanSessionCallback#onPublishTerminated(int)}.
     * callback is {@link WifiNanSessionCallback#onPublishTerminated(int)}.
     */
     */
    public static final int LISTEN_PUBLISH_TERMINATED = 0x1 << 1;
    public static final int FLAG_LISTEN_PUBLISH_TERMINATED = 0x1 << 1;


    /**
    /**
     * Subscribe fail callback event registration flag. Corresponding callback
     * Subscribe fail callback event registration flag. Corresponding callback
@@ -66,13 +66,13 @@ public class WifiNanSessionCallback {
     *
     *
     * @hide
     * @hide
     */
     */
    public static final int LISTEN_SUBSCRIBE_FAIL = 0x1 << 2;
    public static final int FLAG_LISTEN_SUBSCRIBE_FAIL = 0x1 << 2;


    /**
    /**
     * Subscribe terminated callback event registration flag. Corresponding
     * Subscribe terminated callback event registration flag. Corresponding
     * callback is {@link WifiNanSessionCallback#onSubscribeTerminated(int)}.
     * callback is {@link WifiNanSessionCallback#onSubscribeTerminated(int)}.
     */
     */
    public static final int LISTEN_SUBSCRIBE_TERMINATED = 0x1 << 3;
    public static final int FLAG_LISTEN_SUBSCRIBE_TERMINATED = 0x1 << 3;


    /**
    /**
     * Match (discovery: publish or subscribe) callback event registration flag.
     * Match (discovery: publish or subscribe) callback event registration flag.
@@ -81,7 +81,7 @@ public class WifiNanSessionCallback {
     *
     *
     * @hide
     * @hide
     */
     */
    public static final int LISTEN_MATCH = 0x1 << 4;
    public static final int FLAG_LISTEN_MATCH = 0x1 << 4;


    /**
    /**
     * Message sent successfully callback event registration flag. Corresponding
     * Message sent successfully callback event registration flag. Corresponding
@@ -89,7 +89,7 @@ public class WifiNanSessionCallback {
     *
     *
     * @hide
     * @hide
     */
     */
    public static final int LISTEN_MESSAGE_SEND_SUCCESS = 0x1 << 5;
    public static final int FLAG_LISTEN_MESSAGE_SEND_SUCCESS = 0x1 << 5;


    /**
    /**
     * Message sending failure callback event registration flag. Corresponding
     * Message sending failure callback event registration flag. Corresponding
@@ -97,7 +97,7 @@ public class WifiNanSessionCallback {
     *
     *
     * @hide
     * @hide
     */
     */
    public static final int LISTEN_MESSAGE_SEND_FAIL = 0x1 << 6;
    public static final int FLAG_LISTEN_MESSAGE_SEND_FAIL = 0x1 << 6;


    /**
    /**
     * Message received callback event registration flag. Corresponding callback
     * Message received callback event registration flag. Corresponding callback
@@ -105,7 +105,7 @@ public class WifiNanSessionCallback {
     *
     *
     * @hide
     * @hide
     */
     */
    public static final int LISTEN_MESSAGE_RECEIVED = 0x1 << 7;
    public static final int FLAG_LISTEN_MESSAGE_RECEIVED = 0x1 << 7;


    /**
    /**
     * List of hidden events: which are mandatory - i.e. they will be added to
     * List of hidden events: which are mandatory - i.e. they will be added to
@@ -113,9 +113,9 @@ public class WifiNanSessionCallback {
     *
     *
     * @hide
     * @hide
     */
     */
    public static final int LISTEN_HIDDEN_FLAGS = LISTEN_PUBLISH_FAIL | LISTEN_SUBSCRIBE_FAIL
    public static final int LISTEN_HIDDEN_FLAGS = FLAG_LISTEN_PUBLISH_FAIL
            | LISTEN_MATCH | LISTEN_MESSAGE_SEND_SUCCESS | LISTEN_MESSAGE_SEND_FAIL
            | FLAG_LISTEN_SUBSCRIBE_FAIL | FLAG_LISTEN_MATCH | FLAG_LISTEN_MESSAGE_SEND_SUCCESS
            | LISTEN_MESSAGE_RECEIVED;
            | FLAG_LISTEN_MESSAGE_SEND_FAIL | FLAG_LISTEN_MESSAGE_RECEIVED;


    /**
    /**
     * Failure reason flag for {@link WifiNanEventCallback} and
     * Failure reason flag for {@link WifiNanEventCallback} and
@@ -192,31 +192,31 @@ public class WifiNanSessionCallback {
            public void handleMessage(Message msg) {
            public void handleMessage(Message msg) {
                if (DBG) Log.d(TAG, "What=" + msg.what + ", msg=" + msg);
                if (DBG) Log.d(TAG, "What=" + msg.what + ", msg=" + msg);
                switch (msg.what) {
                switch (msg.what) {
                    case LISTEN_PUBLISH_FAIL:
                    case FLAG_LISTEN_PUBLISH_FAIL:
                        WifiNanSessionCallback.this.onPublishFail(msg.arg1);
                        WifiNanSessionCallback.this.onPublishFail(msg.arg1);
                        break;
                        break;
                    case LISTEN_PUBLISH_TERMINATED:
                    case FLAG_LISTEN_PUBLISH_TERMINATED:
                        WifiNanSessionCallback.this.onPublishTerminated(msg.arg1);
                        WifiNanSessionCallback.this.onPublishTerminated(msg.arg1);
                        break;
                        break;
                    case LISTEN_SUBSCRIBE_FAIL:
                    case FLAG_LISTEN_SUBSCRIBE_FAIL:
                        WifiNanSessionCallback.this.onSubscribeFail(msg.arg1);
                        WifiNanSessionCallback.this.onSubscribeFail(msg.arg1);
                        break;
                        break;
                    case LISTEN_SUBSCRIBE_TERMINATED:
                    case FLAG_LISTEN_SUBSCRIBE_TERMINATED:
                        WifiNanSessionCallback.this.onSubscribeTerminated(msg.arg1);
                        WifiNanSessionCallback.this.onSubscribeTerminated(msg.arg1);
                        break;
                        break;
                    case LISTEN_MATCH:
                    case FLAG_LISTEN_MATCH:
                        WifiNanSessionCallback.this.onMatch(
                        WifiNanSessionCallback.this.onMatch(
                                msg.getData().getInt(MESSAGE_BUNDLE_KEY_PEER_ID),
                                msg.getData().getInt(MESSAGE_BUNDLE_KEY_PEER_ID),
                                msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE), msg.arg1,
                                msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE), msg.arg1,
                                msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE2), msg.arg2);
                                msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE2), msg.arg2);
                        break;
                        break;
                    case LISTEN_MESSAGE_SEND_SUCCESS:
                    case FLAG_LISTEN_MESSAGE_SEND_SUCCESS:
                        WifiNanSessionCallback.this.onMessageSendSuccess(msg.arg1);
                        WifiNanSessionCallback.this.onMessageSendSuccess(msg.arg1);
                        break;
                        break;
                    case LISTEN_MESSAGE_SEND_FAIL:
                    case FLAG_LISTEN_MESSAGE_SEND_FAIL:
                        WifiNanSessionCallback.this.onMessageSendFail(msg.arg1, msg.arg2);
                        WifiNanSessionCallback.this.onMessageSendFail(msg.arg1, msg.arg2);
                        break;
                        break;
                    case LISTEN_MESSAGE_RECEIVED:
                    case FLAG_LISTEN_MESSAGE_RECEIVED:
                        WifiNanSessionCallback.this.onMessageReceived(msg.arg2,
                        WifiNanSessionCallback.this.onMessageReceived(msg.arg2,
                                msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE), msg.arg1);
                                msg.getData().getByteArray(MESSAGE_BUNDLE_KEY_MESSAGE), msg.arg1);
                        break;
                        break;
@@ -240,7 +240,7 @@ public class WifiNanSessionCallback {
    /**
    /**
     * Called when a publish operation terminates. Event will only be delivered
     * Called when a publish operation terminates. Event will only be delivered
     * if registered using
     * if registered using
     * {@link WifiNanSessionCallback#LISTEN_PUBLISH_TERMINATED}. A dummy (empty
     * {@link WifiNanSessionCallback#FLAG_LISTEN_PUBLISH_TERMINATED}. A dummy (empty
     * implementation printing out a warning). Make sure to override if
     * implementation printing out a warning). Make sure to override if
     * registered.
     * registered.
     *
     *
@@ -266,7 +266,7 @@ public class WifiNanSessionCallback {
    /**
    /**
     * Called when a subscribe operation terminates. Event will only be
     * Called when a subscribe operation terminates. Event will only be
     * delivered if registered using
     * delivered if registered using
     * {@link WifiNanSessionCallback#LISTEN_SUBSCRIBE_TERMINATED}. A dummy
     * {@link WifiNanSessionCallback#FLAG_LISTEN_SUBSCRIBE_TERMINATED}. A dummy
     * (empty implementation printing out a warning). Make sure to override if
     * (empty implementation printing out a warning). Make sure to override if
     * registered.
     * registered.
     *
     *
@@ -353,7 +353,7 @@ public class WifiNanSessionCallback {
        public void onPublishFail(int reason) {
        public void onPublishFail(int reason) {
            if (VDBG) Log.v(TAG, "onPublishFail: reason=" + reason);
            if (VDBG) Log.v(TAG, "onPublishFail: reason=" + reason);


            Message msg = mHandler.obtainMessage(LISTEN_PUBLISH_FAIL);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_PUBLISH_FAIL);
            msg.arg1 = reason;
            msg.arg1 = reason;
            mHandler.sendMessage(msg);
            mHandler.sendMessage(msg);
        }
        }
@@ -362,7 +362,7 @@ public class WifiNanSessionCallback {
        public void onPublishTerminated(int reason) {
        public void onPublishTerminated(int reason) {
            if (VDBG) Log.v(TAG, "onPublishResponse: reason=" + reason);
            if (VDBG) Log.v(TAG, "onPublishResponse: reason=" + reason);


            Message msg = mHandler.obtainMessage(LISTEN_PUBLISH_TERMINATED);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_PUBLISH_TERMINATED);
            msg.arg1 = reason;
            msg.arg1 = reason;
            mHandler.sendMessage(msg);
            mHandler.sendMessage(msg);
        }
        }
@@ -371,7 +371,7 @@ public class WifiNanSessionCallback {
        public void onSubscribeFail(int reason) {
        public void onSubscribeFail(int reason) {
            if (VDBG) Log.v(TAG, "onSubscribeFail: reason=" + reason);
            if (VDBG) Log.v(TAG, "onSubscribeFail: reason=" + reason);


            Message msg = mHandler.obtainMessage(LISTEN_SUBSCRIBE_FAIL);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_SUBSCRIBE_FAIL);
            msg.arg1 = reason;
            msg.arg1 = reason;
            mHandler.sendMessage(msg);
            mHandler.sendMessage(msg);
        }
        }
@@ -380,7 +380,7 @@ public class WifiNanSessionCallback {
        public void onSubscribeTerminated(int reason) {
        public void onSubscribeTerminated(int reason) {
            if (VDBG) Log.v(TAG, "onSubscribeTerminated: reason=" + reason);
            if (VDBG) Log.v(TAG, "onSubscribeTerminated: reason=" + reason);


            Message msg = mHandler.obtainMessage(LISTEN_SUBSCRIBE_TERMINATED);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_SUBSCRIBE_TERMINATED);
            msg.arg1 = reason;
            msg.arg1 = reason;
            mHandler.sendMessage(msg);
            mHandler.sendMessage(msg);
        }
        }
@@ -395,7 +395,7 @@ public class WifiNanSessionCallback {
            data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE, serviceSpecificInfo);
            data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE, serviceSpecificInfo);
            data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE2, matchFilter);
            data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE2, matchFilter);


            Message msg = mHandler.obtainMessage(LISTEN_MATCH);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_MATCH);
            msg.arg1 = serviceSpecificInfoLength;
            msg.arg1 = serviceSpecificInfoLength;
            msg.arg2 = matchFilterLength;
            msg.arg2 = matchFilterLength;
            msg.setData(data);
            msg.setData(data);
@@ -406,7 +406,7 @@ public class WifiNanSessionCallback {
        public void onMessageSendSuccess(int messageId) {
        public void onMessageSendSuccess(int messageId) {
            if (VDBG) Log.v(TAG, "onMessageSendSuccess");
            if (VDBG) Log.v(TAG, "onMessageSendSuccess");


            Message msg = mHandler.obtainMessage(LISTEN_MESSAGE_SEND_SUCCESS);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_MESSAGE_SEND_SUCCESS);
            msg.arg1 = messageId;
            msg.arg1 = messageId;
            mHandler.sendMessage(msg);
            mHandler.sendMessage(msg);
        }
        }
@@ -415,7 +415,7 @@ public class WifiNanSessionCallback {
        public void onMessageSendFail(int messageId, int reason) {
        public void onMessageSendFail(int messageId, int reason) {
            if (VDBG) Log.v(TAG, "onMessageSendFail: reason=" + reason);
            if (VDBG) Log.v(TAG, "onMessageSendFail: reason=" + reason);


            Message msg = mHandler.obtainMessage(LISTEN_MESSAGE_SEND_FAIL);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_MESSAGE_SEND_FAIL);
            msg.arg1 = messageId;
            msg.arg1 = messageId;
            msg.arg2 = reason;
            msg.arg2 = reason;
            mHandler.sendMessage(msg);
            mHandler.sendMessage(msg);
@@ -431,7 +431,7 @@ public class WifiNanSessionCallback {
            Bundle data = new Bundle();
            Bundle data = new Bundle();
            data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE, message);
            data.putByteArray(MESSAGE_BUNDLE_KEY_MESSAGE, message);


            Message msg = mHandler.obtainMessage(LISTEN_MESSAGE_RECEIVED);
            Message msg = mHandler.obtainMessage(FLAG_LISTEN_MESSAGE_RECEIVED);
            msg.arg1 = messageLength;
            msg.arg1 = messageLength;
            msg.arg2 = peerId;
            msg.arg2 = peerId;
            msg.setData(data);
            msg.setData(data);