From 77f3dd80c2dc791a5763e5fca78bc925d2481546 Mon Sep 17 00:00:00 2001 From: Xiao Ma Date: Wed, 16 Mar 2022 13:36:15 +0900 Subject: [PATCH] DO NOT MERGE: Add stub class and filegroup for Ethernet service. Add stub classes EthernetService, EthernetServiceImpl and build stubs for ethernet service updatable resource, which are required to ensure ConnectivityServiceInitializer can build in the sc-mainline-prod. Test: m service-connectivity Test: cherry-pick the CL on p/m/Connectivity of ethernet-mainline topic and m com.android.tethering Ignore-AOSP-First: needed in sc-mainline-prod only Change-Id: I8a9e82250df61f1d47a3e7f5b3609cf459aeffb3 --- buildstubs-t/Android.bp | 5 +++ .../com/android/server/EthernetService.java | 31 +++++++++++++++++++ .../android/server/EthernetServiceImpl.java | 28 +++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 buildstubs-t/stubs-src/com/android/server/EthernetService.java create mode 100644 buildstubs-t/stubs-src/com/android/server/EthernetServiceImpl.java diff --git a/buildstubs-t/Android.bp b/buildstubs-t/Android.bp index 385abc6791..9ca3fd27c7 100644 --- a/buildstubs-t/Android.bp +++ b/buildstubs-t/Android.bp @@ -37,6 +37,11 @@ filegroup { srcs: [], } +filegroup { + name: "ethernet-service-updatable-sources", + srcs: [], +} + filegroup { name: "services.connectivity-netstats-jni-sources", srcs: [ diff --git a/buildstubs-t/stubs-src/com/android/server/EthernetService.java b/buildstubs-t/stubs-src/com/android/server/EthernetService.java new file mode 100644 index 0000000000..4a06e1ef61 --- /dev/null +++ b/buildstubs-t/stubs-src/com/android/server/EthernetService.java @@ -0,0 +1,31 @@ +/* + * 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; + +import android.content.Context; + +/** + * 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. + */ +public final class EthernetService { + /** Create instance */ + public static EthernetServiceImpl create(Context ctx) { + throw new RuntimeException("This is a stub class"); + } +} + diff --git a/buildstubs-t/stubs-src/com/android/server/EthernetServiceImpl.java b/buildstubs-t/stubs-src/com/android/server/EthernetServiceImpl.java new file mode 100644 index 0000000000..eb3bfa06b5 --- /dev/null +++ b/buildstubs-t/stubs-src/com/android/server/EthernetServiceImpl.java @@ -0,0 +1,28 @@ +/* + * 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; + +import android.os.Binder; + +/** Stub class for EthernetServiceImpl */ +public class EthernetServiceImpl extends Binder { + /** Start service */ + public void start() { + throw new RuntimeException("This is a stub class"); + } +} +