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

Commit 8ebd8bf8 authored by Kenny Root's avatar Kenny Root
Browse files

Add systemReady call for AdbService

Needed for migrating functionality to the ADB service.

Bug: 63820489
Test: make
Change-Id: I79923ac4406e451ef0bcf6d1166d141c39df7086
parent a269b334
Loading
Loading
Loading
Loading
+17 −0
Original line number Original line Diff line number Diff line
@@ -22,6 +22,7 @@ import android.debug.IAdbTransport;
import android.os.Binder;
import android.os.Binder;
import android.os.IBinder;
import android.os.IBinder;
import android.util.ArrayMap;
import android.util.ArrayMap;
import android.util.Slog;


import com.android.internal.util.DumpUtils;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.IndentingPrintWriter;
import com.android.internal.util.IndentingPrintWriter;
@@ -51,6 +52,13 @@ public class AdbService extends IAdbManager.Stub {
            mAdbService = new AdbService(getContext());
            mAdbService = new AdbService(getContext());
            publishBinderService(Context.ADB_SERVICE, mAdbService);
            publishBinderService(Context.ADB_SERVICE, mAdbService);
        }
        }

        @Override
        public void onBootPhase(int phase) {
            if (phase == SystemService.PHASE_ACTIVITY_MANAGER_READY) {
                mAdbService.systemReady();
            }
        }
    }
    }


    private class AdbManagerInternalImpl extends AdbManagerInternal {
    private class AdbManagerInternalImpl extends AdbManagerInternal {
@@ -71,6 +79,7 @@ public class AdbService extends IAdbManager.Stub {
    }
    }


    private static final String TAG = "AdbService";
    private static final String TAG = "AdbService";
    private static final boolean DEBUG = false;


    private final Context mContext;
    private final Context mContext;
    private final ArrayMap<IBinder, IAdbTransport> mTransports = new ArrayMap<>();
    private final ArrayMap<IBinder, IAdbTransport> mTransports = new ArrayMap<>();
@@ -83,6 +92,14 @@ public class AdbService extends IAdbManager.Stub {
        LocalServices.addService(AdbManagerInternal.class, new AdbManagerInternalImpl());
        LocalServices.addService(AdbManagerInternal.class, new AdbManagerInternalImpl());
    }
    }


    /**
     * Called in response to {@code SystemService.PHASE_ACTIVITY_MANAGER_READY} from {@code
     * SystemServer}.
     */
    public void systemReady() {
        if (DEBUG) Slog.d(TAG, "systemReady");
    }

    @Override
    @Override
    public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
    public void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
        if (!DumpUtils.checkDumpPermission(mContext, TAG, writer)) return;
        if (!DumpUtils.checkDumpPermission(mContext, TAG, writer)) return;