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

Commit a269b334 authored by Kenny Root's avatar Kenny Root
Browse files

Add function to query ADB state

This is what the USB manager will use to query the current ADB state in
the future.

Bug: 63820489
Test: make
Change-Id: I70484f97e56af4e5104611dc3b43ef83885671d7
parent 33504d7d
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -36,4 +36,9 @@ public abstract class AdbManagerInternal {
     * @param transport previously-added ADB transport interface to be removed
     */
    public abstract void unregisterTransport(IAdbTransport transport);

    /**
     * Returns {@code true} if ADB debugging is enabled.
     */
    public abstract boolean isAdbEnabled();
}
+7 −0
Original line number Diff line number Diff line
@@ -63,6 +63,11 @@ public class AdbService extends IAdbManager.Stub {
        public void unregisterTransport(IAdbTransport transport) {
            mTransports.remove(transport.asBinder());
        }

        @Override
        public boolean isAdbEnabled() {
            return mAdbEnabled;
        }
    }

    private static final String TAG = "AdbService";
@@ -70,6 +75,8 @@ public class AdbService extends IAdbManager.Stub {
    private final Context mContext;
    private final ArrayMap<IBinder, IAdbTransport> mTransports = new ArrayMap<>();

    private boolean mAdbEnabled;

    private AdbService(Context context) {
        mContext = context;