• Home
Name Date Size #Lines LOC

..--

java/src/org/chromium/base/04-Jul-2025-26,84915,665

javatests/src/org/chromium/base/04-Jul-2025-3,8952,957

jni_generator/04-Jul-2025-64

junit/src/org/chromium/base/04-Jul-2025-10,6777,935

library_loader/04-Jul-2025-874541

linker/04-Jul-2025-1,6291,007

orderfile/04-Jul-2025-557364

proguard/04-Jul-2025-151124

shared_preferences/04-Jul-2025-12187

task_scheduler/04-Jul-2025-304200

COMMON_METADATAD04-Jul-202512 21

DIR_METADATAD04-Jul-202541 21

README.mdD04-Jul-20252.7 KiB7049

android_hardware_buffer_compat.ccD04-Jul-20254 KiB12886

android_hardware_buffer_compat.hD04-Jul-20253.1 KiB7859

android_image_reader_compat.ccD04-Jul-2025475 2011

android_image_reader_compat.hD04-Jul-2025514 209

android_input_receiver_compat.ccD04-Jul-20252.6 KiB7853

android_input_receiver_compat.hD04-Jul-20253.1 KiB8060

android_input_receiver_compat_unittest.ccD04-Jul-20251.4 KiB3625

apk_assets.ccD04-Jul-20252.4 KiB7254

apk_assets.hD04-Jul-20251.7 KiB4821

application_status_listener.ccD04-Jul-20253.9 KiB13096

application_status_listener.hD04-Jul-20253.1 KiB9837

application_status_listener_unittest.ccD04-Jul-20253.7 KiB12987

base_feature_map.ccD04-Jul-20251.1 KiB3722

base_jni_onload.ccD04-Jul-2025507 2213

base_jni_onload.hD04-Jul-2025521 2311

binder.ccD04-Jul-202516.5 KiB557461

binder.hD04-Jul-202515.8 KiB409224

binder_box.ccD04-Jul-20252.7 KiB9470

binder_box.hD04-Jul-20251.3 KiB4016

binder_unittest.ccD04-Jul-202520.9 KiB653532

build_info.ccD04-Jul-20253.9 KiB12093

build_info.hD04-Jul-20257.2 KiB233138

bundle_utils.ccD04-Jul-20254.8 KiB12772

bundle_utils.hD04-Jul-20251.7 KiB4518

callback_android.ccD04-Jul-20252.8 KiB8163

callback_android.hD04-Jul-20252.2 KiB6742

child_process_binding_types.hD04-Jul-2025669 2715

child_process_service.ccD04-Jul-20253.1 KiB9271

child_process_unittest.ccD04-Jul-20251.2 KiB4330

command_line_android.ccD04-Jul-20253 KiB8561

content_uri_utils.ccD04-Jul-20256.8 KiB195153

content_uri_utils.hD04-Jul-20253.4 KiB9040

content_uri_utils_unittest.ccD04-Jul-20258.5 KiB206160

cpu_features.ccD04-Jul-2025599 2513

early_trace_event_binding.ccD04-Jul-20255.1 KiB138115

early_trace_event_binding.hD04-Jul-2025726 2510

event_log.ccD04-Jul-2025501 199

event_log.hD04-Jul-2025439 2110

feature_list_jni.ccD04-Jul-2025488 199

feature_map.ccD04-Jul-20254.2 KiB124101

feature_map.hD04-Jul-20251.2 KiB3818

features_jni.ccD04-Jul-20251.3 KiB4230

field_trial_list.ccD04-Jul-20254 KiB11375

important_file_writer_android.ccD04-Jul-20251.1 KiB3621

input_hint_checker.ccD04-Jul-202511.4 KiB353275

input_hint_checker.hD04-Jul-20254.8 KiB14059

int_string_callback.ccD04-Jul-20251 KiB3115

int_string_callback.hD04-Jul-2025783 2613

jank_metric_uma_recorder.ccD04-Jul-202514 KiB351297

jank_metric_uma_recorder.hD04-Jul-20251.8 KiB5738

jank_metric_uma_recorder_unittest.ccD04-Jul-202510.6 KiB276212

java_exception_reporter.ccD04-Jul-20253.6 KiB11180

java_exception_reporter.hD04-Jul-20251.7 KiB4920

java_handler_thread.ccD04-Jul-20256.4 KiB183136

java_handler_thread.hD04-Jul-20253.5 KiB11861

java_handler_thread_unittest.ccD04-Jul-20255.1 KiB153121

java_heap_dump_generator.ccD04-Jul-2025719 2714

java_heap_dump_generator.hD04-Jul-2025740 2511

java_runtime.ccD04-Jul-2025920 2817

java_runtime.hD04-Jul-2025741 2613

jni_android.ccD04-Jul-202510.8 KiB273179

jni_android.hD04-Jul-20254.1 KiB12166

jni_android_unittest.ccD04-Jul-20259 KiB265202

jni_array.ccD04-Jul-202520 KiB566477

jni_array.hD04-Jul-20258.6 KiB244151

jni_array_unittest.ccD04-Jul-202521.8 KiB638499

jni_bytebuffer.ccD04-Jul-20251.5 KiB4932

jni_bytebuffer.hD04-Jul-20251.6 KiB4417

jni_bytebuffer_unittest.ccD04-Jul-20252.1 KiB6845

jni_registrar.ccD04-Jul-2025953 3625

jni_registrar.hD04-Jul-2025792 2914

jni_string.ccD04-Jul-20255.8 KiB159108

jni_string.hD04-Jul-20253 KiB9772

jni_string_unittest.ccD04-Jul-20252.4 KiB7965

jni_utils.ccD04-Jul-20251.3 KiB4633

jni_utils.hD04-Jul-2025813 3213

jni_weak_ref.hD04-Jul-2025413 146

locale_utils.ccD04-Jul-20251.1 KiB3724

locale_utils.hD04-Jul-2025738 3013

meminfo_dump_provider.ccD04-Jul-20254.4 KiB10658

meminfo_dump_provider.hD04-Jul-20251.2 KiB3925

meminfo_dump_provider_unittest.ccD04-Jul-20253.9 KiB10378

memory_pressure_listener_android.ccD04-Jul-20251.3 KiB4125

memory_pressure_listener_android.hD04-Jul-2025868 3016

memory_purge_manager_android.ccD04-Jul-20251.5 KiB3726

memory_purge_manager_android.hD04-Jul-2025809 3015

native_uma_recorder.ccD04-Jul-202511.8 KiB336277

path_service_android.ccD04-Jul-2025576 2211

path_utils.ccD04-Jul-20253 KiB9676

path_utils.hD04-Jul-20252.2 KiB6019

path_utils_unittest.ccD04-Jul-20252 KiB6340

pmf_utils.ccD04-Jul-20253.1 KiB9868

pmf_utils.hD04-Jul-2025751 2817

pmf_utils_unittest.ccD04-Jul-20251.5 KiB4734

pre_freeze_background_memory_trimmer.ccD04-Jul-202521.1 KiB639440

pre_freeze_background_memory_trimmer.hD04-Jul-20259.4 KiB238143

pre_freeze_background_memory_trimmer_unittest.ccD04-Jul-202522.4 KiB767522

radio_utils.ccD04-Jul-20252 KiB8057

radio_utils.hD04-Jul-20251.5 KiB6747

radio_utils_unittest.ccD04-Jul-2025865 2615

requires_api.hD04-Jul-20251.5 KiB399

robolectric_jni_onload.ccD04-Jul-2025403 148

scoped_hardware_buffer_fence_sync.ccD04-Jul-2025974 3623

scoped_hardware_buffer_fence_sync.hD04-Jul-20251.4 KiB4527

scoped_hardware_buffer_handle.ccD04-Jul-20253.2 KiB12287

scoped_hardware_buffer_handle.hD04-Jul-20253.4 KiB9334

scoped_java_ref.hD04-Jul-2025930 3121

scoped_java_ref_unittest.ccD04-Jul-202510.8 KiB346270

statistics_recorder_android.ccD04-Jul-2025720 2715

sys_utils.ccD04-Jul-20251.8 KiB5837

sys_utils.hD04-Jul-2025713 2714

sys_utils_unittest.ccD04-Jul-2025702 2514

thread_instruction_count.ccD04-Jul-20252.6 KiB9163

thread_instruction_count.hD04-Jul-20251.9 KiB6431

timezone_utils.ccD04-Jul-2025727 2715

timezone_utils.hD04-Jul-2025527 2411

token_android.ccD04-Jul-20251.3 KiB3927

token_android.hD04-Jul-20251.4 KiB5134

token_android_unittest.ccD04-Jul-2025707 2716

trace_event_binding.ccD04-Jul-202520.4 KiB560484

trace_event_binding.hD04-Jul-2025528 2011

unguessable_token_android.ccD04-Jul-20251.7 KiB5440

unguessable_token_android.hD04-Jul-20251.9 KiB6040

unguessable_token_android_unittest.ccD04-Jul-20251.5 KiB4735

README.md

1# //base/android
2
3This directory contains:
4
5* C++ APIs that are broadly useful and are unique to `target_os="android"`, and
6* Java APIs that are broadly useful, along C++ bindings when necessary.
7
8This directory does not contain Android-specific implementations / extensions
9to APIs declared directly in `//base`. Those live in `//base/*_android.cc`, or
10behind `#ifdef`s.
11
12## Adding New APIs
13
14The advice laid out in [//base/README.md] applies to this directory as well.
15The bars for what APIs should exist and for code quality are generally higher
16than for other directories. If you find yourself wanting to add a new API, you
17should expect that code reviews take multiple revisions and that they be met
18with (respectful) scrutiny.
19
20If you are not sure whether an API would make sense to add, you can ask via
21java@chromium.org.
22It is common to add APIs to `//chrome` (or elsewhere) first, and move them into
23`//base` after their usefulness has been proven.
24
25[//base/README.md]: /base/README.md
26
27### What Uses //base/android?
28
29The main two clients are Chrome and WebView, but it is also used by other
30Chromium-based apps, such as Chromecast and Chrome Remote desktop. Some
31`//base/android` classes are used by `//build` (this is a layering violation,
32tracked in [crbug/1364192] and [crbug/1377351]).
33
34Two considerations for WebView:
35
361. The application Context is that of the host app's.
372. The UI thread might be different from the main thread.
38
39[crbug/1364192]: https://crbug.com/1364192
40[crbug/1377351]: https://crbug.com/1377351
41
42
43### New API Checklist
44
45Here is a list of checks you should go through when adding a new API:
46
471. The functionality does not already exist in system libraries (Java APIs,
48   Android SDK) or in already adopted `third_party` libraries, such as AndroidX.
492. Reasonable effort has been made to ensure the new API is discoverable. E.g.:
50   Coordinate refactorings of existing patterns to it, add a [presubmit check],
51   to recommend it, etc.
523. Tests (ideally Robolectric) are added.
534. Thought has been put into API design.
54   * E.g. adding `@Nullable`, or `@DoNotMock`
55   * E.g. adding test helpers, such as `ForTesting()` methods or `TestRule`s
56   * E.g. adding asserts or comments about thread-safety
57   * E.g. could usage of the API be made harder to get wrong?
58
59[presumbit check]: https://chromium.googlesource.com/chromium/src/+/main/build/android/docs/java_toolchain.md#Static-Analysis-Code-Checks
60
61### Choosing a Reviewer
62
63All members of [`//base/android/OWNERS`] will be CC'ed on reviews through a
64[`//WATCHLIST`] entry. For new APIs, feel free to pick a reviewer at random.
65For modifying existing files, it is best to use a reviewer from prior changes to
66the file.
67
68[`//base/android/OWNERS`]: /base/android/OWNERS
69[`//WATCHLIST`]: /WATCHLIST
70