DO NOT MERGE: Add build stubs to sc-mainline-prod for NetworkStats
Test: m service-connectivity
Ignore-AOSP-First: needed in sc-mainline-prod only
Bug: 197717846
Change-Id: Idb6da7ce678fbb3f4839604726cbdbdf223144c1
diff --git a/buildstubs-t/Android.bp b/buildstubs-t/Android.bp
index dfca6b3..7af320f 100644
--- a/buildstubs-t/Android.bp
+++ b/buildstubs-t/Android.bp
@@ -32,6 +32,16 @@
srcs: ["stubs-src/**/*.java"],
}
+filegroup {
+ name: "framework-connectivity-api-shared-srcs",
+ srcs: [],
+}
+
+filegroup {
+ name: "services.connectivity-netstats-jni-sources",
+ srcs: [],
+}
+
// Empty replacement for framework-connectivity-tiramisu.impl and stubs,
// as framework-connectivity is disabled in the branch
java_library {
diff --git a/buildstubs-t/stubs-src/android/net/TrafficStats.java b/buildstubs-t/stubs-src/android/net/TrafficStats.java
new file mode 100644
index 0000000..0b208ac
--- /dev/null
+++ b/buildstubs-t/stubs-src/android/net/TrafficStats.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 android.net;
+
+import android.content.Context;
+
+/**
+ * Fake TrafficStats class for sc-mainline-prod,
+ * to allow building the T service-connectivity before sources
+ * are moved to the branch.
+ */
+public final class TrafficStats {
+ /** Init */
+ public static void init(Context context) {
+ throw new RuntimeException("This is a stub class");
+ }
+}
diff --git a/buildstubs-t/stubs-src/com/android/server/net/NetworkStatsService.java b/buildstubs-t/stubs-src/com/android/server/net/NetworkStatsService.java
new file mode 100644
index 0000000..8568e2a
--- /dev/null
+++ b/buildstubs-t/stubs-src/com/android/server/net/NetworkStatsService.java
@@ -0,0 +1,37 @@
+/*
+ * 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.net;
+
+import android.content.Context;
+import android.os.Binder;
+
+/**
+ * Fake NetworkStatsService class for sc-mainline-prod,
+ * to allow building the T service-connectivity before sources
+ * are moved to the branch
+ */
+public final class NetworkStatsService extends Binder {
+ /** Create instance */
+ public static NetworkStatsService create(Context ctx) {
+ throw new RuntimeException("This is a stub class");
+ }
+
+ /** System Ready */
+ public void systemReady() {
+ throw new RuntimeException("This is a stub class");
+ }
+}