Provide a stub ethernet service to build in sc-mainline-prod.

This CL also creates a fake ethernet-service.jar to ensure that
targets that depend on ethernet-service do not break.
Because ethernet-service.jar is on the system server classpath,
these classes cannot be in the com.android.server.ethernet
package, otherwise ConnectivityServiceInitializer will load
them instead of the real classes.

Test: m
Bug: 210586283
Merged-In: I6a4a0dc68233d4229d1cae4e5b196e287ef2ed5b
Change-Id: I591dcaf0fe6303cffa15aa0b869e429c626dc887
diff --git a/ethernet/Android.bp b/ethernet/Android.bp
new file mode 100644
index 0000000..36978c5
--- /dev/null
+++ b/ethernet/Android.bp
@@ -0,0 +1,25 @@
+// Copyright (C) 2022 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.
+
+// TODO: delete once:
+// - The ethernet code has been moved to p/m/C.
+// - All dependencies in the tree are gone.
+java_library {
+    name: "ethernet-service",
+    installable: true,
+    srcs: [
+        "src/**/*.java",
+    ],
+}
+
diff --git a/ethernet/src/com/android/server/ethernet/stub/EthernetService.java b/ethernet/src/com/android/server/ethernet/stub/EthernetService.java
new file mode 100644
index 0000000..d0010c1
--- /dev/null
+++ b/ethernet/src/com/android/server/ethernet/stub/EthernetService.java
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2022 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 com.android.server.ethernet.stub;
+
+import android.content.Context;
+import android.os.Binder;
+
+/**
+ * Fake EthernetService class for branches that do not have the updatable EthernetService yet,
+ * to allow building the T service-connectivity before sources are moved to the branch.
+ * TODO: Once ethernet-service is no longer on the system server
+ * classpath, move these files from com.android.server.ethernet.stub
+ * to com.android.server.ethernet.
+ */
+public final class EthernetService extends Binder {
+    /** Create instance */
+    public static EthernetServiceImpl create(Context ctx) {
+        throw new RuntimeException("This is a stub class");
+    }
+}
diff --git a/ethernet/src/com/android/server/ethernet/stub/EthernetServiceImpl.java b/ethernet/src/com/android/server/ethernet/stub/EthernetServiceImpl.java
new file mode 100644
index 0000000..ff7aaf9
--- /dev/null
+++ b/ethernet/src/com/android/server/ethernet/stub/EthernetServiceImpl.java
@@ -0,0 +1,25 @@
+/*
+ * Copyright (C) 2022 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 com.android.server.ethernet.stub;
+
+/** Stub class for EthernetServiceImpl */
+public class EthernetServiceImpl {
+    /** Start service */
+    public void start() {
+        throw new RuntimeException("This is a stub class");
+    }
+}