Add stub NearbyService am: e96e7c4de4 am: 830cbbe1f5
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2009155
Change-Id: Ib7d72a56e18d7cb6cb34ef865093c46ad86e1e4d
diff --git a/nearby/Android.bp b/nearby/Android.bp
index baa0740..b968f5d 100644
--- a/nearby/Android.bp
+++ b/nearby/Android.bp
@@ -31,7 +31,7 @@
java_library {
name: "service-nearby",
- srcs: [],
+ srcs: ["service-src/**/*.java"],
sdk_version: "module_current",
min_sdk_version: "30",
apex_available: ["com.android.tethering"],
diff --git a/nearby/service-src/com/android/server/nearby/NearbyService.java b/nearby/service-src/com/android/server/nearby/NearbyService.java
new file mode 100644
index 0000000..88752cc
--- /dev/null
+++ b/nearby/service-src/com/android/server/nearby/NearbyService.java
@@ -0,0 +1,36 @@
+/*
+ * 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.nearby;
+
+import android.content.Context;
+import android.os.Binder;
+
+/**
+ * Stub NearbyService class, used until NearbyService code is available in all branches.
+ *
+ * This can be published as an empty service in branches that use it.
+ */
+public final class NearbyService extends Binder {
+ public NearbyService(Context ctx) {
+ throw new UnsupportedOperationException("This is a stub service");
+ }
+
+ /** Called by the service initializer on each boot phase */
+ public void onBootPhase(int phase) {
+ // Do nothing
+ }
+}