Add empty AdbManagerInternal for system server
This will allow the call of internal-only AdbService functions from within
the system server.
Bug: 63820489
Test: make
Change-Id: Ic761b513a8c10ce0173ddb6bc761a6372799f15c
diff --git a/core/java/android/debug/AdbManagerInternal.java b/core/java/android/debug/AdbManagerInternal.java
new file mode 100644
index 0000000..916609d
--- /dev/null
+++ b/core/java/android/debug/AdbManagerInternal.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright (C) 2018 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.debug;
+
+/**
+ * This class allows the control of ADB-related functions that should only be called from the system
+ * server.
+ *
+ * @hide Only should be called from the system server.
+ */
+public abstract class AdbManagerInternal {
+}
diff --git a/services/core/java/com/android/server/adb/AdbService.java b/services/core/java/com/android/server/adb/AdbService.java
index fdfc115..558d7cc 100644
--- a/services/core/java/com/android/server/adb/AdbService.java
+++ b/services/core/java/com/android/server/adb/AdbService.java
@@ -16,11 +16,13 @@
package com.android.server.adb;
import android.content.Context;
+import android.debug.AdbManagerInternal;
import android.debug.IAdbManager;
import android.os.Binder;
import com.android.internal.util.DumpUtils;
import com.android.internal.util.IndentingPrintWriter;
+import com.android.server.LocalServices;
import com.android.server.SystemService;
import java.io.FileDescriptor;
@@ -48,12 +50,17 @@
}
}
+ private class AdbManagerInternalImpl extends AdbManagerInternal {
+ }
+
private static final String TAG = "AdbService";
private final Context mContext;
private AdbService(Context context) {
mContext = context;
+
+ LocalServices.addService(AdbManagerInternal.class, new AdbManagerInternalImpl());
}
@Override