DO NOT MERGE Add mock filegroups to deal with merge conflict problem
This is a preparing CL to cherry-pick netstats jni from git_master to
aosp. Define some mock files to deal with merge conflict problem between aosp
and sc-mainline-prod. The filegroups framework-connectivity-tiramisu-jni-sources
and services.connectivity-netstats-jni-sources is located in
framework/base which do not open for development in sc-mainline-prod.
Bug: 197717846
Test: m libservice-connectivity
Test: m com.google.android.Tethering
Ignore-AOSP-First: this is used to prevent merge conflict.
Change-Id: I33e0d699086c87ce8e940036c9a52908bbbcf6c5
diff --git a/Tethering/apex/Android.bp b/Tethering/apex/Android.bp
index f4250cc..4ccad22 100644
--- a/Tethering/apex/Android.bp
+++ b/Tethering/apex/Android.bp
@@ -138,7 +138,11 @@
// Changed in sc-mainline-prod only: no list for
// framework-connectivity-tiramisu APIs as it is not in the APEX
],
- unsupported: ["hiddenapi/hiddenapi-unsupported.txt"],
+ unsupported: [
+ "hiddenapi/hiddenapi-unsupported.txt",
+ // Changed in sc-mainline-prod only: no framework-connectivity-tiramisu
+ // "hiddenapi/hiddenapi-unsupported-tiramisu.txt",
+ ],
},
}
diff --git a/buildstubs-t/Android.bp b/buildstubs-t/Android.bp
index 7af320f..396827f 100644
--- a/buildstubs-t/Android.bp
+++ b/buildstubs-t/Android.bp
@@ -39,7 +39,23 @@
filegroup {
name: "services.connectivity-netstats-jni-sources",
- srcs: [],
+ srcs: [
+ "stubs-src-jni/mock_com_android_server_net_NetworkStatsFactory.cpp",
+ "stubs-src-jni/mock_com_android_server_net_NetworkStatsService.cpp",
+ ],
+ visibility: [
+ "//packages/modules/Connectivity:__subpackages__",
+ ],
+}
+
+filegroup {
+ name: "framework-connectivity-tiramisu-jni-sources",
+ srcs: [
+ "stubs-src-jni/mock_android_net_TrafficStats.cpp",
+ ],
+ visibility: [
+ "//packages/modules/Connectivity:__subpackages__",
+ ],
}
// Empty replacement for framework-connectivity-tiramisu.impl and stubs,
diff --git a/buildstubs-t/stubs-src-jni/mock_android_net_TrafficStats.cpp b/buildstubs-t/stubs-src-jni/mock_android_net_TrafficStats.cpp
new file mode 100644
index 0000000..ef5d874
--- /dev/null
+++ b/buildstubs-t/stubs-src-jni/mock_android_net_TrafficStats.cpp
@@ -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.
+ */
+
+#include <nativehelper/JNIHelp.h>
+
+namespace android {
+
+int register_android_net_TrafficStats(JNIEnv* env) {
+ return JNI_ERR;
+}
+
+}; // namespace android
diff --git a/buildstubs-t/stubs-src-jni/mock_com_android_server_net_NetworkStatsFactory.cpp b/buildstubs-t/stubs-src-jni/mock_com_android_server_net_NetworkStatsFactory.cpp
new file mode 100644
index 0000000..594a174
--- /dev/null
+++ b/buildstubs-t/stubs-src-jni/mock_com_android_server_net_NetworkStatsFactory.cpp
@@ -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.
+ */
+
+#include <nativehelper/JNIHelp.h>
+
+namespace android {
+
+int register_android_server_net_NetworkStatsFactory(JNIEnv* env) {
+ return JNI_ERR;
+}
+
+}; // namespace android
diff --git a/buildstubs-t/stubs-src-jni/mock_com_android_server_net_NetworkStatsService.cpp b/buildstubs-t/stubs-src-jni/mock_com_android_server_net_NetworkStatsService.cpp
new file mode 100644
index 0000000..b0c42b0
--- /dev/null
+++ b/buildstubs-t/stubs-src-jni/mock_com_android_server_net_NetworkStatsService.cpp
@@ -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.
+ */
+
+#include <nativehelper/JNIHelp.h>
+
+namespace android {
+
+int register_android_server_net_NetworkStatsService(JNIEnv* env) {
+ return JNI_ERR;
+}
+
+}; // namespace android