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

Commit 394ff12b authored by Roman Kiryanov's avatar Roman Kiryanov
Browse files

adb: Revert "Allow UsbDeviceManager to start adbd again."



This reverts commit 7a380099.

Reason for revert: a proper fix (ag/10420943)
    landed into system/core/init to prevent USB
    configured  as "none/adb" and this workaround
    is no longer required.

Bug: 402444824
Flag: EXEMPT cleanup
Test: flashed a recent Pixel device with both
    user and userdebug builds, booted,
    enabled USB debugging, rebooted and
    checked that `adb shell` still works.
Change-Id: Idaa167940c6e5eab252b051c4ab0b35fe2ac3edd
Signed-off-by: default avatarRoman Kiryanov <rkir@google.com>
parent 5fec3c5c
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -59,14 +59,4 @@ public abstract class AdbManagerInternal {
     * reloaded.
     */
    public abstract void notifyKeyFilesUpdated();

    /**
     * Starts adbd for a transport.
     */
    public abstract void startAdbdForTransport(byte transportType);

    /**
     * Stops adbd for a transport.
     */
    public abstract void stopAdbdForTransport(byte transportType);
}
+0 −25
Original line number Diff line number Diff line
@@ -145,18 +145,6 @@ public class AdbService extends IAdbManager.Stub {
        public void notifyKeyFilesUpdated() {
            mDebuggingManager.notifyKeyFilesUpdated();
        }

        @Override
        public void startAdbdForTransport(byte transportType) {
            FgThread.getHandler().sendMessage(obtainMessage(
                    AdbService::setAdbdEnabledForTransport, AdbService.this, true, transportType));
        }

        @Override
        public void stopAdbdForTransport(byte transportType) {
            FgThread.getHandler().sendMessage(obtainMessage(
                    AdbService::setAdbdEnabledForTransport, AdbService.this, false, transportType));
        }
    }

    private void registerContentObservers() {
@@ -406,19 +394,6 @@ public class AdbService extends IAdbManager.Stub {
        }
    }

    private void setAdbdEnabledForTransport(boolean enable, byte transportType) {
        if (transportType == AdbTransportType.USB) {
            mIsAdbUsbEnabled = enable;
        } else if (transportType == AdbTransportType.WIFI) {
            mIsAdbWifiEnabled = enable;
        }
        if (enable) {
            startAdbd();
        } else {
            stopAdbd();
        }
    }

    private WifiManager.MulticastLock mAdbMulticastLock = null;

    private void acquireMulticastLock() {
+0 −13
Original line number Diff line number Diff line
@@ -2498,19 +2498,6 @@ public class UsbDeviceManager implements ActivityTaskManagerInternal.ScreenObser
                    return;
                }
                try {
                    if ((config & UsbManager.FUNCTION_ADB) != 0) {
                        /**
                         * Start adbd if ADB function is included in the configuration.
                         */
                        LocalServices.getService(AdbManagerInternal.class)
                                .startAdbdForTransport(AdbTransportType.USB);
                    } else {
                        /**
                         * Stop adbd otherwise
                         */
                        LocalServices.getService(AdbManagerInternal.class)
                                .stopAdbdForTransport(AdbTransportType.USB);
                    }
                    mUsbGadgetHal.setCurrentUsbFunctions(mCurrentRequest,
                            config, chargingFunctions,
                            SET_FUNCTIONS_TIMEOUT_MS - SET_FUNCTIONS_LEEWAY_MS, operationId);