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

Commit e834e57a authored by Fabien Sanglard's avatar Fabien Sanglard
Browse files

Delete useless MSG_TLS_SERVER_PORT

Message MSG_TLS_SERVER_PORT has no purpose since it only used to call
onServerPortReceived (which in turns sends a message to the hander).

This CL directly sends the correct message to the hander.

Bug: NA
Test: manual
Flag: EXEMPT (simplification)
Change-Id: I348df8588ceb90f93c9e48a74f3639fbe9a314a1
parent 1220a22c
Loading
Loading
Loading
Loading
+4 −16
Original line number Diff line number Diff line
@@ -322,15 +322,6 @@ public class AdbDebuggingManager {
        }
    }

    private void onServerPortReceived(int port) {
        Slog.d(TAG, "Received tls port=" + port);
        Message msg = mHandler.obtainMessage(port > 0
                ? AdbDebuggingHandler.MSG_SERVER_CONNECTED
                : AdbDebuggingHandler.MSG_SERVER_DISCONNECTED);
        msg.obj = port;
        mHandler.sendMessage(msg);
    }

    @VisibleForTesting
    static class AdbDebuggingThread extends Thread {
        private boolean mStopped;
@@ -503,8 +494,10 @@ public class AdbDebuggingManager {
                        bytes.order(ByteOrder.LITTLE_ENDIAN);

                        int port = bytes.getShort() & 0xFFFF;
                        Message msg = mHandler.obtainMessage(
                                AdbDebuggingHandler.MSG_TLS_SERVER_PORT);
                        Slog.d(TAG, "Received tls port=" + port);
                        Message msg = mHandler.obtainMessage(port > 0
                                ? AdbDebuggingHandler.MSG_SERVER_CONNECTED
                                : AdbDebuggingHandler.MSG_SERVER_DISCONNECTED);
                        msg.obj = port;
                        mHandler.sendMessage(msg);
                    } else {
@@ -777,8 +770,6 @@ public class AdbDebuggingManager {
        // === Messages from other parts of the system
        private static final int MESSAGE_KEY_FILES_UPDATED = 28;

        private static final int MSG_TLS_SERVER_PORT = 29;

        // === Messages we can send to adbd ===========
        static final String MSG_DISCONNECT_DEVICE = "DD";

@@ -1231,9 +1222,6 @@ public class AdbDebuggingManager {
                    mAdbKeyStore.reloadKeyMap();
                    break;
                }
                case MSG_TLS_SERVER_PORT: {
                    onServerPortReceived((int) msg.obj);
                }
            }
        }