1package {
2    default_applicable_licenses: ["frameworks_base_core_jni_license"],
3}
4
5// Added automatically by a large-scale-change
6// See: http://go/android-license-faq
7license {
8    name: "frameworks_base_core_jni_license",
9    visibility: [":__subpackages__"],
10    license_kinds: [
11        "SPDX-license-identifier-Apache-2.0",
12    ],
13    license_text: [
14        "NOTICE",
15    ],
16}
17
18cc_library_shared {
19    name: "libandroid_runtime",
20    host_supported: true,
21    cflags: [
22        "-Wno-unused-parameter",
23        "-Wno-non-virtual-dtor",
24        "-Wno-maybe-uninitialized",
25        "-Wno-parentheses",
26
27        "-DGL_GLEXT_PROTOTYPES",
28        "-DEGL_EGLEXT_PROTOTYPES",
29
30        "-DU_USING_ICU_NAMESPACE=0",
31
32        "-Wall",
33        "-Werror",
34        "-Wno-error=deprecated-declarations",
35        "-Wunused",
36        "-Wunreachable-code",
37
38        "-DNAMESPACE_FOR_HASH_FUNCTIONS=farmhash",
39    ],
40
41    cppflags: ["-Wno-conversion-null"],
42
43    product_variables: {
44        eng: {
45            cflags: ["-DNO_RESET_STACK_PROTECTOR"],
46        },
47    },
48
49    cpp_std: "gnu++20",
50
51    srcs: [
52        "android_animation_PropertyValuesHolder.cpp",
53        "android_os_SystemClock.cpp",
54        "android_os_SystemProperties.cpp",
55        "android_os_Trace.cpp",
56        "android_text_AndroidCharacter.cpp",
57        "android_util_EventLog.cpp",
58        "android_util_Log.cpp",
59        "android_util_StringBlock.cpp",
60        "android_util_XmlBlock.cpp",
61        "android_util_jar_StrictJarFile.cpp",
62        "com_android_internal_util_VirtualRefBasePtr.cpp",
63        "core_jni_helpers.cpp",
64        ":deviceproductinfoconstants_aidl",
65    ],
66
67    include_dirs: [
68        "external/skia/include/private",
69        "frameworks/base/media/jni",
70        "system/media/camera/include",
71        "system/media/private/camera/include",
72    ],
73
74    shared_libs: [
75        "libbase",
76        "libcutils",
77        "libharfbuzz_ng",
78        "liblog",
79        "libminikin",
80        "libz",
81    ],
82
83    static_libs: [
84        "libnativehelper_lazy",
85        "libziparchive_for_incfs",
86    ],
87
88    export_include_dirs: [
89        ".",
90        "include",
91    ],
92
93    defaults: [
94        "latest_android_media_audio_common_types_cpp_target_shared",
95    ],
96
97    target: {
98        android: {
99            srcs: [
100                "AndroidRuntime.cpp",
101                "com_android_internal_content_F2fsUtils.cpp",
102                "com_android_internal_content_NativeLibraryHelper.cpp",
103                "com_google_android_gles_jni_EGLImpl.cpp",
104                "com_google_android_gles_jni_GLImpl.cpp", // TODO: .arm
105                "android_app_Activity.cpp",
106                "android_app_ActivityThread.cpp",
107                "android_app_NativeActivity.cpp",
108                "android_app_admin_SecurityLog.cpp",
109                "android_opengl_EGL14.cpp",
110                "android_opengl_EGL15.cpp",
111                "android_opengl_EGLExt.cpp",
112                "android_opengl_GLES10.cpp",
113                "android_opengl_GLES10Ext.cpp",
114                "android_opengl_GLES11.cpp",
115                "android_opengl_GLES11Ext.cpp",
116                "android_opengl_GLES20.cpp",
117                "android_opengl_GLES30.cpp",
118                "android_opengl_GLES31.cpp",
119                "android_opengl_GLES31Ext.cpp",
120                "android_opengl_GLES32.cpp",
121                "android_database_CursorWindow.cpp",
122                "android_database_SQLiteCommon.cpp",
123                "android_database_SQLiteConnection.cpp",
124                "android_database_SQLiteGlobal.cpp",
125                "android_database_SQLiteDebug.cpp",
126                "android_graphics_GraphicBuffer.cpp",
127                "android_graphics_SurfaceTexture.cpp",
128                "android_view_CompositionSamplingListener.cpp",
129                "android_view_DisplayEventReceiver.cpp",
130                "android_view_InputChannel.cpp",
131                "android_view_InputDevice.cpp",
132                "android_view_InputEventReceiver.cpp",
133                "android_view_InputEventSender.cpp",
134                "android_view_InputQueue.cpp",
135                "android_view_KeyCharacterMap.cpp",
136                "android_view_KeyEvent.cpp",
137                "android_view_MotionEvent.cpp",
138                "android_view_MotionPredictor.cpp",
139                "android_view_PointerIcon.cpp",
140                "android_view_Surface.cpp",
141                "android_view_SurfaceControl.cpp",
142                "android_view_SurfaceControlHdrLayerInfoListener.cpp",
143                "android_graphics_BLASTBufferQueue.cpp",
144                "android_view_SurfaceSession.cpp",
145                "android_view_TextureView.cpp",
146                "android_view_TunnelModeEnabledListener.cpp",
147                "android_view_VelocityTracker.cpp",
148                "android_view_VerifiedKeyEvent.cpp",
149                "android_view_VerifiedMotionEvent.cpp",
150                "android_text_Hyphenator.cpp",
151                "android_os_Debug.cpp",
152                "android_os_GraphicsEnvironment.cpp",
153                "android_os_HidlMemory.cpp",
154                "android_os_HidlSupport.cpp",
155                "android_os_HwBinder.cpp",
156                "android_os_HwBlob.cpp",
157                "android_os_HwParcel.cpp",
158                "android_os_HwRemoteBinder.cpp",
159                "android_os_NativeHandle.cpp",
160                "android_os_MemoryFile.cpp",
161                "android_os_MessageQueue.cpp",
162                "android_os_Parcel.cpp",
163                "android_os_PerformanceHintManager.cpp",
164                "android_os_SELinux.cpp",
165                "android_os_ServiceManager.cpp",
166                "android_os_SharedMemory.cpp",
167                "android_os_storage_StorageManager.cpp",
168                "android_os_UEventObserver.cpp",
169                "android_os_VintfObject.cpp",
170                "android_os_VintfRuntimeInfo.cpp",
171                "android_os_incremental_IncrementalManager.cpp",
172                "android_net_LocalSocketImpl.cpp",
173                "android_service_DataLoaderService.cpp",
174                "android_util_AssetManager.cpp",
175                "android_util_Binder.cpp",
176                "android_util_CharsetUtils.cpp",
177                "android_util_MemoryIntArray.cpp",
178                "android_util_Process.cpp",
179                "android_media_audio_common_AidlConversion.cpp",
180                "android_media_AudioDeviceAttributes.cpp",
181                "android_media_AudioEffectDescriptor.cpp",
182                "android_media_AudioRecord.cpp",
183                "android_media_AudioSystem.cpp",
184                "android_media_AudioTrackCallback.cpp",
185                "android_media_AudioTrack.cpp",
186                "android_media_AudioAttributes.cpp",
187                "android_media_AudioProductStrategies.cpp",
188                "android_media_AudioVolumeGroups.cpp",
189                "android_media_AudioVolumeGroupCallback.cpp",
190                "android_media_DeviceCallback.cpp",
191                "android_media_MediaMetricsJNI.cpp",
192                "android_media_MicrophoneInfo.cpp",
193                "android_media_midi.cpp",
194                "android_media_RemoteDisplay.cpp",
195                "android_media_ToneGenerator.cpp",
196                "android_hardware_Camera.cpp",
197                "android_hardware_camera2_CameraMetadata.cpp",
198                "android_hardware_camera2_DngCreator.cpp",
199                "android_hardware_camera2_impl_CameraExtensionJpegProcessor.cpp",
200                "android_hardware_camera2_utils_SurfaceUtils.cpp",
201                "android_hardware_display_DisplayManagerGlobal.cpp",
202                "android_hardware_display_DisplayViewport.cpp",
203                "android_hardware_HardwareBuffer.cpp",
204                "android_hardware_OverlayProperties.cpp",
205                "android_hardware_SensorManager.cpp",
206                "android_hardware_SerialPort.cpp",
207                "android_hardware_SyncFence.cpp",
208                "android_hardware_UsbDevice.cpp",
209                "android_hardware_UsbDeviceConnection.cpp",
210                "android_hardware_UsbRequest.cpp",
211                "android_hardware_location_ActivityRecognitionHardware.cpp",
212                "android_util_FileObserver.cpp",
213                "android/opengl/poly_clip.cpp", // TODO: .arm
214                "android/opengl/util.cpp",
215                "android_ddm_DdmHandleNativeHeap.cpp",
216                "android_backup_BackupDataInput.cpp",
217                "android_backup_BackupDataOutput.cpp",
218                "android_backup_FileBackupHelperBase.cpp",
219                "android_backup_BackupHelperDispatcher.cpp",
220                "android_app_backup_FullBackup.cpp",
221                "android_content_res_ApkAssets.cpp",
222                "android_content_res_ObbScanner.cpp",
223                "android_content_res_Configuration.cpp",
224                "android_content_res_ResourceTimer.cpp",
225                "android_security_Scrypt.cpp",
226                "com_android_internal_content_om_OverlayConfig.cpp",
227                "com_android_internal_content_om_OverlayManagerImpl.cpp",
228                "com_android_internal_net_NetworkUtilsInternal.cpp",
229                "com_android_internal_os_ClassLoaderFactory.cpp",
230                "com_android_internal_os_FuseAppLoop.cpp",
231                "com_android_internal_os_KernelAllocationStats.cpp",
232                "com_android_internal_os_KernelCpuBpfTracking.cpp",
233                "com_android_internal_os_KernelCpuTotalBpfMapReader.cpp",
234                "com_android_internal_os_KernelCpuUidBpfMapReader.cpp",
235                "com_android_internal_os_KernelSingleProcessCpuThreadReader.cpp",
236                "com_android_internal_os_KernelSingleUidTimeReader.cpp",
237                "com_android_internal_os_LongArrayMultiStateCounter.cpp",
238                "com_android_internal_os_LongMultiStateCounter.cpp",
239                "com_android_internal_os_Zygote.cpp",
240                "com_android_internal_os_ZygoteCommandBuffer.cpp",
241                "com_android_internal_os_ZygoteInit.cpp",
242                "com_android_internal_security_VerityUtils.cpp",
243                "hwbinder/EphemeralStorage.cpp",
244                "fd_utils.cpp",
245                "android_hardware_input_InputWindowHandle.cpp",
246                "android_hardware_input_InputApplicationHandle.cpp",
247                "android_window_WindowInfosListener.cpp",
248                "android_window_ScreenCapture.cpp",
249                "jni_common.cpp",
250            ],
251
252            static_libs: [
253                "libasync_safe",
254                "libbinderthreadstateutils",
255                "libdmabufinfo",
256                "libgif",
257                "libgui_window_info_static",
258                "libseccomp_policy",
259                "libgrallocusage",
260                "libscrypt_static",
261                "libstatssocket_lazy",
262                "libskia",
263                "libtextclassifier_hash_static",
264                "libexpresslog_jni",
265            ],
266
267            shared_libs: [
268                "audioclient-types-aidl-cpp",
269                "audioflinger-aidl-cpp",
270                "audiopolicy-types-aidl-cpp",
271                "spatializer-aidl-cpp",
272                "av-types-aidl-cpp",
273                "android.hardware.camera.device@3.2",
274                "libandroid_net",
275                "libbattery",
276                "libnetdutils",
277                "libmemtrack",
278                "libandroidfw",
279                "libappfuse",
280                "libcrypto",
281                "libcutils",
282                "libdebuggerd_client",
283                "libutils",
284                "libbinder",
285                "libbinder_ndk",
286                "libui",
287                "libgraphicsenv",
288                "libgui",
289                "libhwui",
290                "libmediandk",
291                "libpermission",
292                "libPlatformProperties",
293                "libsensor",
294                "libinput",
295                "libicu",
296                "libcamera_client",
297                "libcamera_metadata",
298                "libprocinfo",
299                "libsqlite",
300                "libEGL",
301                "libGLESv1_CM",
302                "libGLESv2",
303                "libGLESv3",
304                "libincfs",
305                "libdataloader",
306                "libvulkan",
307                "libETC1",
308                "libjpeg",
309                "libhardware",
310                "libhardware_legacy",
311                "libselinux",
312                "libmedia",
313                "libmedia_helper",
314                "libmediametrics",
315                "libmeminfo",
316                "libaudioclient",
317                "libaudioclient_aidl_conversion",
318                "libaudiofoundation",
319                "libaudiopolicy",
320                "libusbhost",
321                "libpdfium",
322                "libimg_utils",
323                "libnetd_client",
324                "libprocessgroup",
325                "libnativebridge_lazy",
326                "libnativeloader_lazy",
327                "libmemunreachable",
328                "libhidlbase",
329                "libvintf",
330                "libnativedisplay",
331                "libnativewindow",
332                "libdl",
333                "libdl_android",
334                "libtimeinstate",
335                "server_configurable_flags",
336                "libimage_io",
337                "libultrahdr",
338            ],
339            export_shared_lib_headers: [
340                // our headers include libnativewindow's public headers
341                "libnativewindow",
342            ],
343            export_static_lib_headers: [
344                // AndroidRuntime.h depends on nativehelper/jni.h
345                "libnativehelper_lazy",
346            ],
347            header_libs: [
348                "bionic_libc_platform_headers",
349                "dnsproxyd_protocol_headers",
350                "flatbuffer_headers",
351                "libtextclassifier_hash_headers",
352                "tensorflow_headers",
353            ],
354            runtime_libs: [
355                "libidmap2",
356            ],
357        },
358        host: {
359            cflags: [
360                "-Wno-unused-const-variable",
361                "-Wno-unused-function",
362            ],
363            srcs: [
364                "LayoutlibLoader.cpp",
365            ],
366            include_dirs: [
367                "external/vulkan-headers/include",
368                "frameworks/native/libs/math/include",
369                "frameworks/native/libs/nativebase/include",
370                "frameworks/native/libs/nativewindow/include",
371            ],
372            shared_libs: [
373                "libicui18n",
374                "libicuuc",
375            ],
376            static_libs: [
377                "libandroidfw",
378                "libbinary_parse",
379                "libdng_sdk",
380                "libft2",
381                "libhostgraphics",
382                "libhwui",
383                "libimage_type_recognition",
384                "libjpeg",
385                "libpiex",
386                "libpng",
387                "libtiff_directory",
388                "libui-types",
389                "libutils",
390                "libwebp-decode",
391                "libwebp-encode",
392                "libwuffs_mirror_release_c",
393                "libimage_io",
394                "libjpegdecoder",
395                "libjpegencoder",
396                "libultrahdr",
397            ],
398        },
399        host_linux: {
400            srcs: [
401                "android_content_res_ApkAssets.cpp",
402                "android_database_CursorWindow.cpp",
403                "android_database_SQLiteCommon.cpp",
404                "android_database_SQLiteConnection.cpp",
405                "android_database_SQLiteGlobal.cpp",
406                "android_database_SQLiteDebug.cpp",
407                "android_hardware_input_InputApplicationHandle.cpp",
408                "android_os_MessageQueue.cpp",
409                "android_os_Parcel.cpp",
410
411                "android_view_KeyCharacterMap.cpp",
412                "android_view_KeyEvent.cpp",
413                "android_view_InputChannel.cpp",
414                "android_view_InputDevice.cpp",
415                "android_view_InputEventReceiver.cpp",
416                "android_view_InputEventSender.cpp",
417                "android_view_MotionEvent.cpp",
418                "android_view_VelocityTracker.cpp",
419                "android_view_VerifiedKeyEvent.cpp",
420                "android_view_VerifiedMotionEvent.cpp",
421
422                "android_util_AssetManager.cpp",
423                "android_util_Binder.cpp",
424
425                "android_util_FileObserver.cpp",
426            ],
427            static_libs: [
428                "libinput",
429                "libbinderthreadstateutils",
430                "libsqlite",
431                "libgui_window_info_static",
432            ],
433            shared_libs: [
434                // libbinder needs to be shared since it has global state
435                // (e.g. gDefaultServiceManager)
436                "libbinder",
437                "libhidlbase", // libhwbinder is in here
438                "libvintf",
439            ],
440        },
441    },
442
443    // Workaround Clang LTO crash.
444    lto: {
445        never: true,
446    },
447}
448