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

Commit b4fb9a61 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "adb: Revert "Allow UsbDeviceManager to start adbd again."" into main

parents 1b7a0d33 394ff12b
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
@@ -2507,19 +2507,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);