Tej Singh | c03d009 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2019 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| 17 | // ========================================================== |
| 18 | // Native library to register a pull atom callback with statsd |
| 19 | // ========================================================== |
Tej Singh | d78f4da | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 20 | cc_defaults { |
| 21 | name: "libstatspull_defaults", |
Tej Singh | c03d009 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 22 | srcs: [ |
Tej Singh | c03d009 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 23 | "stats_pull_atom_callback.cpp", |
| 24 | ], |
| 25 | cflags: [ |
| 26 | "-Wall", |
| 27 | "-Werror", |
| 28 | ], |
| 29 | export_include_dirs: ["include"], |
| 30 | shared_libs: [ |
Ruchir Rastogi | 223dadb | 2020-01-24 18:21:36 -0800 | [diff] [blame] | 31 | "libbinder_ndk", |
Jeffrey Huang | b0a85dc | 2020-02-12 14:22:01 -0800 | [diff] [blame] | 32 | "liblog", |
Tej Singh | d78f4da | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 33 | "libstatssocket", |
Tej Singh | c03d009 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 34 | ], |
| 35 | static_libs: [ |
Tej Singh | c03d009 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 36 | "libutils", |
Tej Singh | 5d8f770 | 2020-04-06 15:01:41 -0700 | [diff] [blame] | 37 | "statsd-aidl-ndk_platform", |
Tej Singh | d78f4da | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 38 | ], |
| 39 | } |
| 40 | cc_library_shared { |
| 41 | name: "libstatspull", |
| 42 | defaults: [ |
| 43 | "libstatspull_defaults" |
Tej Singh | a8fd39d | 2020-01-14 13:46:27 -0800 | [diff] [blame] | 44 | ], |
| 45 | // enumerate stable entry points for APEX use |
| 46 | stubs: { |
| 47 | symbol_file: "libstatspull.map.txt", |
| 48 | versions: [ |
| 49 | "30", |
| 50 | ], |
| 51 | }, |
Jeffrey Huang | b0a85dc | 2020-02-12 14:22:01 -0800 | [diff] [blame] | 52 | apex_available: [ |
| 53 | "com.android.os.statsd", |
| 54 | "test_com.android.os.statsd", |
| 55 | ], |
Tej Singh | 5d8f770 | 2020-04-06 15:01:41 -0700 | [diff] [blame] | 56 | |
| 57 | stl: "libc++_static", |
| 58 | |
Hsin-Yi Chen | e3bdbfa | 2020-03-23 11:26:38 +0800 | [diff] [blame] | 59 | // TODO(b/151102177): Enable it when the build error is fixed. |
| 60 | header_abi_checker: { |
| 61 | enabled: false, |
| 62 | }, |
Tej Singh | c03d009 | 2019-11-21 12:47:37 -0800 | [diff] [blame] | 63 | } |
Tej Singh | d78f4da | 2020-01-29 15:56:52 -0800 | [diff] [blame] | 64 | |
| 65 | // ONLY USE IN TESTS. |
| 66 | cc_library_static { |
| 67 | name: "libstatspull_private", |
| 68 | defaults: [ |
| 69 | "libstatspull_defaults", |
| 70 | ], |
| 71 | visibility: [ |
| 72 | "//frameworks/base/apex/statsd/tests/libstatspull", |
| 73 | ], |
| 74 | } |
Tej Singh | c06f147 | 2020-03-13 19:14:05 -0700 | [diff] [blame] | 75 | |
| 76 | // Note: These unit tests only test PullAtomMetadata. |
| 77 | // For full E2E tests of libstatspull, use LibStatsPullTests |
| 78 | cc_test { |
| 79 | name: "libstatspull_test", |
| 80 | srcs: [ |
| 81 | "tests/pull_atom_metadata_test.cpp", |
| 82 | ], |
| 83 | shared_libs: [ |
| 84 | "libstatspull", |
| 85 | "libstatssocket", |
| 86 | ], |
Jeffrey Huang | 2f51ad7 | 2020-04-22 17:09:30 -0700 | [diff] [blame] | 87 | test_suites: ["general-tests", "mts"], |
Chen Zhu | c724fb6 | 2020-05-20 13:06:24 -0700 | [diff] [blame] | 88 | test_config: "libstatspull_test.xml", |
| 89 | |
Jeffrey Huang | 2f51ad7 | 2020-04-22 17:09:30 -0700 | [diff] [blame] | 90 | //TODO(b/153588990): Remove when the build system properly separates |
| 91 | //32bit and 64bit architectures. |
| 92 | compile_multilib: "both", |
| 93 | multilib: { |
| 94 | lib64: { |
| 95 | suffix: "64", |
Chen Zhu | c724fb6 | 2020-05-20 13:06:24 -0700 | [diff] [blame] | 96 | }, |
| 97 | lib32: { |
| 98 | suffix: "32", |
| 99 | }, |
Jeffrey Huang | 2f51ad7 | 2020-04-22 17:09:30 -0700 | [diff] [blame] | 100 | }, |
Tej Singh | c06f147 | 2020-03-13 19:14:05 -0700 | [diff] [blame] | 101 | cflags: [ |
| 102 | "-Wall", |
| 103 | "-Werror", |
| 104 | "-Wno-missing-field-initializers", |
| 105 | "-Wno-unused-variable", |
| 106 | "-Wno-unused-function", |
| 107 | "-Wno-unused-parameter", |
| 108 | ], |
Jeffrey Huang | 18d239c | 2020-04-24 10:43:08 -0700 | [diff] [blame] | 109 | require_root: true, |
Hsin-Yi Chen | e3bdbfa | 2020-03-23 11:26:38 +0800 | [diff] [blame] | 110 | } |