To allow unit tests to run without platform certificates, remove
signature permission usage in ConnectivityServiceTest.
This mocks permission checks done in ConnectivityService for which the
test assumed that the permission was held, and mocks calls to
BatteryStatsManager. Calls to ActivityManagerService (through
PendingIntent) are done with shell permissions as the test uses real
PendingIntent mechanics.
Bug: 187935317
Test: atest FrameworksNetTests
Merged-In: If309d653ac2e9bbcf1b94bcee6336367289df359
Change-Id: If309d653ac2e9bbcf1b94bcee6336367289df359
Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/1736615
(cherry picked from commit 595dda3604)
Change-Id: Idb19b0f7cb87bb4d9de7a0b1a0e4128c2d6b9c6d
89 lines
2.3 KiB
Plaintext
89 lines
2.3 KiB
Plaintext
//########################################################################
|
|
// Build FrameworksNetTests package
|
|
//########################################################################
|
|
package {
|
|
// See: http://go/android-license-faq
|
|
// A large-scale-change added 'default_applicable_licenses' to import
|
|
// all of the 'license_kinds' from "Android-Apache-2.0"
|
|
// to get the below license kinds:
|
|
// SPDX-license-identifier-Apache-2.0
|
|
default_applicable_licenses: ["Android-Apache-2.0"],
|
|
}
|
|
|
|
java_defaults {
|
|
name: "FrameworksNetTests-jni-defaults",
|
|
jni_libs: [
|
|
"ld-android",
|
|
"libbacktrace",
|
|
"libbase",
|
|
"libbinder",
|
|
"libbpf",
|
|
"libbpf_android",
|
|
"libc++",
|
|
"libcgrouprc",
|
|
"libcrypto",
|
|
"libcutils",
|
|
"libdl_android",
|
|
"libhidl-gen-utils",
|
|
"libhidlbase",
|
|
"libjsoncpp",
|
|
"liblog",
|
|
"liblzma",
|
|
"libnativehelper",
|
|
"libnetdbpf",
|
|
"libnetdutils",
|
|
"libnetworkstatsfactorytestjni",
|
|
"libpackagelistparser",
|
|
"libpcre2",
|
|
"libprocessgroup",
|
|
"libselinux",
|
|
"libtinyxml2",
|
|
"libui",
|
|
"libunwindstack",
|
|
"libutils",
|
|
"libutilscallstack",
|
|
"libvndksupport",
|
|
"libziparchive",
|
|
"libz",
|
|
"netd_aidl_interface-V5-cpp",
|
|
],
|
|
}
|
|
|
|
android_test {
|
|
name: "FrameworksNetTests",
|
|
defaults: [
|
|
"framework-connectivity-test-defaults",
|
|
"FrameworksNetTests-jni-defaults",
|
|
],
|
|
srcs: [
|
|
"java/**/*.java",
|
|
"java/**/*.kt",
|
|
],
|
|
test_suites: ["device-tests"],
|
|
jarjar_rules: "jarjar-rules.txt",
|
|
static_libs: [
|
|
"androidx.test.rules",
|
|
"bouncycastle-repackaged-unbundled",
|
|
"FrameworksNetCommonTests",
|
|
"frameworks-base-testutils",
|
|
"frameworks-net-integration-testutils",
|
|
"framework-protos",
|
|
"mockito-target-minus-junit4",
|
|
"net-tests-utils",
|
|
"platform-test-annotations",
|
|
"service-connectivity-pre-jarjar",
|
|
"services.core",
|
|
"services.net",
|
|
],
|
|
libs: [
|
|
"android.net.ipsec.ike.stubs.module_lib",
|
|
"android.test.runner",
|
|
"android.test.base",
|
|
"android.test.mock",
|
|
"ServiceConnectivityResources",
|
|
],
|
|
jni_libs: [
|
|
"libservice-connectivity",
|
|
],
|
|
}
|