Merge "Move NetworkStatsFactory into service directory"

This commit is contained in:
TreeHugger Robot
2019-04-03 23:44:26 +00:00
committed by Android (Google) Code Review
2 changed files with 54 additions and 6 deletions

View File

@@ -1,11 +1,8 @@
//########################################################################
// Build FrameworksNetTests package
//########################################################################
android_test {
name: "FrameworksNetTests",
// Include all test java files.
srcs: ["java/**/*.java"],
java_defaults {
name: "FrameworksNetTests-jni-defaults",
static_libs: [
"frameworks-base-testutils",
"framework-protos",
@@ -20,6 +17,53 @@ android_test {
"android.test.base",
"android.test.mock",
],
jni_libs: [
"ld-android",
"libartbase",
"libbacktrace",
"libbase",
"libbinder",
"libbinderthreadstate",
"libbpf",
"libbpf_android",
"libc++",
"libcgrouprc",
"libcrypto",
"libcutils",
"libdexfile",
"libdl_android",
"libhidl-gen-utils",
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libjsoncpp",
"liblog",
"liblzma",
"libnativehelper",
"libnetdbpf",
"libnetdutils",
"libpackagelistparser",
"libpcre2",
"libprocessgroup",
"libselinux",
"libui",
"libutils",
"libvintf",
"libvndksupport",
"libtinyxml2",
"libunwindstack",
"libutilscallstack",
"libziparchive",
"libz",
"netd_aidl_interface-cpp",
"libnetworkstatsfactorytestjni",
],
}
android_test {
name: "FrameworksNetTests",
defaults: ["FrameworksNetTests-jni-defaults"],
srcs: ["java/**/*.java"],
platform_apis: true,
test_suites: ["device-tests"],
certificate: "platform",

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
package com.android.internal.net;
package com.android.server.net;
import static android.net.NetworkStats.DEFAULT_NETWORK_NO;
import static android.net.NetworkStats.METERED_NO;
@@ -70,6 +70,10 @@ public class NetworkStatsFactoryTest {
IoUtils.deleteContents(mTestProc);
}
// The libandroid_servers which have the native method is not available to
// applications. So in order to have a test support native library, the native code
// related to networkStatsFactory is compiled to a minimal native library and loaded here.
System.loadLibrary("networkstatsfactorytestjni");
mFactory = new NetworkStatsFactory(mTestProc, false);
}