Jiyong Park | a7266ac | 2021-05-17 21:57:24 +0900 | [diff] [blame] | 1 | package { |
Aditya Choudhary | 61615bd | 2024-01-31 21:26:18 +0000 | [diff] [blame] | 2 | default_team: "trendy_team_virtualization", |
Jiyong Park | a7266ac | 2021-05-17 21:57:24 +0900 | [diff] [blame] | 3 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 4 | } |
| 5 | |
Alan Stokes | fe6df52 | 2023-08-18 15:31:57 +0100 | [diff] [blame] | 6 | android_app_certificate { |
| 7 | name: "MicrodroidTestAppCert", |
| 8 | |
| 9 | // The default app cert is the same as the default platform cert |
| 10 | // (on a test-keys build), which means we end up getting assigned |
| 11 | // the permissions via signature and can't reliably disclaim |
| 12 | // them. So instead we use our own custom cert. See b/290582742. |
| 13 | // Created via: development/tools/make_key microdroid_test_app '/CN=microdroid_test_app' |
| 14 | certificate: "microdroid_test_app", |
| 15 | } |
| 16 | |
Nikita Ioffe | 7ffb014 | 2023-02-01 22:22:23 +0000 | [diff] [blame] | 17 | java_defaults { |
| 18 | name: "MicrodroidTestAppsDefaults", |
Jiyong Park | 29de517 | 2022-02-08 00:37:05 +0900 | [diff] [blame] | 19 | test_suites: [ |
| 20 | "cts", |
| 21 | "general-tests", |
| 22 | ], |
Nikita Ioffe | bac2bcf | 2023-02-10 00:09:20 +0000 | [diff] [blame] | 23 | static_libs: [ |
| 24 | "com.android.microdroid.testservice-java", |
| 25 | "com.android.microdroid.test.vmshare_service-java", |
| 26 | ], |
Alan Stokes | fe6df52 | 2023-08-18 15:31:57 +0100 | [diff] [blame] | 27 | certificate: ":MicrodroidTestAppCert", |
Nikita Ioffe | 7ffb014 | 2023-02-01 22:22:23 +0000 | [diff] [blame] | 28 | sdk_version: "test_current", |
| 29 | jni_uses_platform_apis: true, |
| 30 | use_embedded_native_libs: true, |
| 31 | // We only support 64-bit ABI, but CTS demands all APKs to be multi-ABI. |
| 32 | compile_multilib: "both", |
| 33 | } |
| 34 | |
| 35 | android_test { |
| 36 | name: "MicrodroidTestApp", |
| 37 | defaults: ["MicrodroidTestAppsDefaults"], |
Jiyong Park | a7266ac | 2021-05-17 21:57:24 +0900 | [diff] [blame] | 38 | srcs: ["src/java/**/*.java"], |
Jiyong Park | bda1e21 | 2021-10-29 20:13:37 +0900 | [diff] [blame] | 39 | static_libs: [ |
Alice Wang | 7e0843d | 2022-09-01 11:30:21 +0000 | [diff] [blame] | 40 | "MicrodroidDeviceTestHelper", |
Jiyong Park | bda1e21 | 2021-10-29 20:13:37 +0900 | [diff] [blame] | 41 | "androidx.test.runner", |
| 42 | "androidx.test.ext.junit", |
Andrew Scull | 6ad6440 | 2022-07-04 13:12:53 +0000 | [diff] [blame] | 43 | "authfs_test_apk_assets", |
Andrew Scull | 6189208 | 2022-02-21 00:07:25 +0000 | [diff] [blame] | 44 | "cbor-java", |
Krzysztof KosiĆski | 9cf23c6 | 2023-10-07 00:48:09 +0000 | [diff] [blame] | 45 | "truth", |
Jiyong Park | 5517b10 | 2022-07-11 16:09:19 +0900 | [diff] [blame] | 46 | "compatibility-common-util-devicesidelib", |
Nikita Ioffe | a7cb367 | 2023-02-24 23:10:34 +0000 | [diff] [blame] | 47 | "measure_io_as_jar", |
Jiyong Park | bda1e21 | 2021-10-29 20:13:37 +0900 | [diff] [blame] | 48 | ], |
Alan Stokes | 38d00f8 | 2022-10-03 17:43:45 +0100 | [diff] [blame] | 49 | jni_libs: [ |
| 50 | "MicrodroidTestNativeLib", |
David Brazdil | f88c315 | 2022-11-08 15:36:16 +0000 | [diff] [blame] | 51 | "MicrodroidIdleNativeLib", |
Inseob Kim | 24358c6 | 2022-12-09 15:49:22 +0900 | [diff] [blame] | 52 | "MicrodroidEmptyNativeLib", |
Alan Stokes | 4a66deb | 2023-01-27 12:12:00 +0000 | [diff] [blame] | 53 | "MicrodroidExitNativeLib", |
Inseob Kim | 24358c6 | 2022-12-09 15:49:22 +0900 | [diff] [blame] | 54 | "MicrodroidPrivateLinkingNativeLib", |
Inseob Kim | ab1037d | 2023-02-08 17:03:31 +0900 | [diff] [blame] | 55 | "MicrodroidCrashNativeLib", |
Alan Stokes | 38d00f8 | 2022-10-03 17:43:45 +0100 | [diff] [blame] | 56 | ], |
Jiyong Park | 968635d | 2022-08-22 10:18:17 +0900 | [diff] [blame] | 57 | min_sdk_version: "33", |
Nikita Ioffe | 9c48068 | 2023-02-08 14:17:32 +0000 | [diff] [blame] | 58 | // Defined in ../vmshareapp/Android.bp |
Nikita Ioffe | 97dd06f | 2023-07-01 16:27:14 +0100 | [diff] [blame] | 59 | data: [ |
| 60 | ":MicrodroidVmShareApp", |
| 61 | ":test_microdroid_vendor_image", |
Seungjae Yoo | 1e053be | 2023-11-09 10:14:30 +0900 | [diff] [blame] | 62 | ":test_microdroid_vendor_image_unsigned", |
Nikita Ioffe | 97dd06f | 2023-07-01 16:27:14 +0100 | [diff] [blame] | 63 | ], |
Jiyong Park | a7266ac | 2021-05-17 21:57:24 +0900 | [diff] [blame] | 64 | } |
| 65 | |
Nikita Ioffe | 7ffb014 | 2023-02-01 22:22:23 +0000 | [diff] [blame] | 66 | // Defaults shared between MicrodroidTestNativeLib and MicrodroidPayloadInOtherAppNativeLib shared |
| 67 | // libs. They are expected to share everything apart from the name, so that one app |
| 68 | // (MicrodroidTestApp) can start a payload defined in the another app (MicrodroidVmShareApp). |
| 69 | cc_defaults { |
| 70 | name: "MicrodroidTestNativeLibDefaults", |
Jiyong Park | fe5b28e | 2021-06-24 00:19:02 +0900 | [diff] [blame] | 71 | srcs: ["src/native/testbinary.cpp"], |
Alan Stokes | 4bff0d6 | 2022-10-28 14:29:59 +0100 | [diff] [blame] | 72 | stl: "libc++_static", |
Alan Stokes | d4ea5a8 | 2022-11-10 12:17:42 +0000 | [diff] [blame] | 73 | header_libs: ["vm_payload_restricted_headers"], |
Andrew Scull | 6661661 | 2021-06-17 16:41:03 +0000 | [diff] [blame] | 74 | shared_libs: [ |
Andrew Scull | 6661661 | 2021-06-17 16:41:03 +0000 | [diff] [blame] | 75 | "libbinder_ndk", |
Nikita Ioffe | 3452ee2 | 2022-12-15 00:31:56 +0000 | [diff] [blame] | 76 | "libcap", |
Jiyong Park | fe5b28e | 2021-06-24 00:19:02 +0900 | [diff] [blame] | 77 | "MicrodroidTestNativeLibSub", |
Alan Stokes | bcc2ec2 | 2022-10-31 17:02:50 +0000 | [diff] [blame] | 78 | "libvm_payload#current", |
Andrew Scull | 6661661 | 2021-06-17 16:41:03 +0000 | [diff] [blame] | 79 | ], |
Inseob Kim | db31970 | 2022-01-20 13:12:43 +0900 | [diff] [blame] | 80 | static_libs: [ |
Alan Stokes | 1898645 | 2022-10-28 11:11:11 +0100 | [diff] [blame] | 81 | "com.android.microdroid.testservice-ndk", |
Alan Stokes | 4bff0d6 | 2022-10-28 14:29:59 +0100 | [diff] [blame] | 82 | "libbase", |
Nikita Ioffe | 29e15c8 | 2023-02-25 02:31:51 +0000 | [diff] [blame] | 83 | "libfstab", |
Inseob Kim | db31970 | 2022-01-20 13:12:43 +0900 | [diff] [blame] | 84 | "libfsverity_digests_proto_cc", |
| 85 | "liblog", |
| 86 | "libprotobuf-cpp-lite-ndk", |
| 87 | ], |
Jiyong Park | a7266ac | 2021-05-17 21:57:24 +0900 | [diff] [blame] | 88 | } |
Jiyong Park | 6de0857 | 2021-06-14 21:13:32 +0900 | [diff] [blame] | 89 | |
Jiyong Park | fe5b28e | 2021-06-24 00:19:02 +0900 | [diff] [blame] | 90 | cc_library_shared { |
Nikita Ioffe | 7ffb014 | 2023-02-01 22:22:23 +0000 | [diff] [blame] | 91 | name: "MicrodroidPayloadInOtherAppNativeLib", |
| 92 | defaults: ["MicrodroidTestNativeLibDefaults"], |
| 93 | } |
| 94 | |
| 95 | cc_library_shared { |
| 96 | name: "MicrodroidTestNativeLib", |
| 97 | defaults: ["MicrodroidTestNativeLibDefaults"], |
| 98 | } |
| 99 | |
| 100 | cc_library_shared { |
Jiyong Park | fe5b28e | 2021-06-24 00:19:02 +0900 | [diff] [blame] | 101 | name: "MicrodroidTestNativeLibSub", |
| 102 | srcs: ["src/native/testlib.cpp"], |
Alan Stokes | 4bff0d6 | 2022-10-28 14:29:59 +0100 | [diff] [blame] | 103 | stl: "libc++_static", |
Jiyong Park | fe5b28e | 2021-06-24 00:19:02 +0900 | [diff] [blame] | 104 | } |
Alan Stokes | 08c421a | 2022-11-15 16:06:26 +0000 | [diff] [blame] | 105 | |
| 106 | cc_library_shared { |
| 107 | name: "MicrodroidIdleNativeLib", |
| 108 | srcs: ["src/native/idlebinary.cpp"], |
| 109 | header_libs: ["vm_payload_headers"], |
| 110 | stl: "libc++_static", |
| 111 | } |
Inseob Kim | 24358c6 | 2022-12-09 15:49:22 +0900 | [diff] [blame] | 112 | |
| 113 | // An empty payload missing AVmPayload_main |
| 114 | cc_library_shared { |
| 115 | name: "MicrodroidEmptyNativeLib", |
| 116 | srcs: ["src/native/emptybinary.cpp"], |
| 117 | stl: "none", |
| 118 | } |
| 119 | |
Alan Stokes | 4a66deb | 2023-01-27 12:12:00 +0000 | [diff] [blame] | 120 | // A payload that exits immediately on start |
| 121 | cc_library_shared { |
| 122 | name: "MicrodroidExitNativeLib", |
| 123 | srcs: ["src/native/exitbinary.cpp"], |
| 124 | header_libs: ["vm_payload_headers"], |
| 125 | stl: "libc++_static", |
| 126 | } |
| 127 | |
Inseob Kim | 24358c6 | 2022-12-09 15:49:22 +0900 | [diff] [blame] | 128 | // A payload which tries to link against libselinux, one of private libraries |
| 129 | cc_library_shared { |
| 130 | name: "MicrodroidPrivateLinkingNativeLib", |
| 131 | srcs: ["src/native/idlebinary.cpp"], |
| 132 | header_libs: ["vm_payload_headers"], |
| 133 | // HACK: linking against "libselinux" will embed libselinux.so into the apk |
| 134 | // link against a stub to prevent libselinux.so from being embedded |
| 135 | shared_libs: ["libselinux#latest"], |
| 136 | stl: "libc++_static", |
| 137 | } |
Inseob Kim | ab1037d | 2023-02-08 17:03:31 +0900 | [diff] [blame] | 138 | |
| 139 | // A payload that crashes immediately on start |
| 140 | cc_library_shared { |
| 141 | name: "MicrodroidCrashNativeLib", |
| 142 | srcs: ["src/native/crashbinary.cpp"], |
| 143 | header_libs: ["vm_payload_headers"], |
| 144 | stl: "libc++_static", |
| 145 | } |