From dc72f289c129bddf62cc7fac032dbcece6e5d54e Mon Sep 17 00:00:00 2001 From: markchien Date: Fri, 18 Feb 2022 00:09:20 +0800 Subject: [PATCH] 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 --- Tethering/apex/Android.bp | 6 ++++- buildstubs-t/Android.bp | 18 ++++++++++++- .../mock_android_net_TrafficStats.cpp | 25 +++++++++++++++++++ ...android_server_net_NetworkStatsFactory.cpp | 25 +++++++++++++++++++ ...android_server_net_NetworkStatsService.cpp | 25 +++++++++++++++++++ 5 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 buildstubs-t/stubs-src-jni/mock_android_net_TrafficStats.cpp create mode 100644 buildstubs-t/stubs-src-jni/mock_com_android_server_net_NetworkStatsFactory.cpp create mode 100644 buildstubs-t/stubs-src-jni/mock_com_android_server_net_NetworkStatsService.cpp diff --git a/Tethering/apex/Android.bp b/Tethering/apex/Android.bp index f4250cc381..4ccad22863 100644 --- a/Tethering/apex/Android.bp +++ b/Tethering/apex/Android.bp @@ -138,7 +138,11 @@ bootclasspath_fragment { // 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 7af320f20d..396827f902 100644 --- a/buildstubs-t/Android.bp +++ b/buildstubs-t/Android.bp @@ -39,7 +39,23 @@ filegroup { 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 0000000000..ef5d874f43 --- /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 + +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 0000000000..594a174775 --- /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 + +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 0000000000..b0c42b0566 --- /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 + +namespace android { + +int register_android_server_net_NetworkStatsService(JNIEnv* env) { + return JNI_ERR; +} + +}; // namespace android