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

Commit 76d2afb8 authored by Joshua Duong's avatar Joshua Duong
Browse files

[adbwifi] Handle tls port changes.

Events such as adbd restarts can change the connection port. We need
to update the UI accordingly.

Bug: 158219145

Test: Manual.
1) Enable wireless debugging in Settings and validate port in UI via
> adb shell su 0 netstat -plnt | grep LISTEN
2) Restart adbd: > adb root
3) validate port again (may have changed)

Change-Id: I93339a6a258fbf69fa3f45186863a01126d279ce
parent 03b20f86
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -113,11 +113,9 @@ public class WirelessDebuggingFragment extends DashboardFragment
            } else if (AdbManager.WIRELESS_DEBUG_STATE_CHANGED_ACTION.equals(action)) {
                int status = intent.getIntExtra(AdbManager.WIRELESS_STATUS_EXTRA,
                        AdbManager.WIRELESS_STATUS_DISCONNECTED);
                if (status == AdbManager.WIRELESS_STATUS_CONNECTED) {
                    int port = intent.getIntExtra(AdbManager.WIRELESS_DEBUG_PORT_EXTRA, 0);
                    Log.i(TAG, "Got adbwifi port=" + port);
                } else {
                    Log.i(TAG, "adbwifi server disconnected");
                if (status == AdbManager.WIRELESS_STATUS_CONNECTED
                        || status == AdbManager.WIRELESS_STATUS_DISCONNECTED) {
                    sAdbIpAddressPreferenceController.updateState(mIpAddrPreference);
                }
            } else if (AdbManager.WIRELESS_DEBUG_PAIRING_RESULT_ACTION.equals(action)) {
                Integer res = intent.getIntExtra(