• Home
Name Date Size #Lines LOC

..--

java/src/org/chromium/base/03-May-2024-22,29312,332

javatests/src/org/chromium/base/03-May-2024-3,7692,768

jni_generator/03-May-2024-20,99917,387

junit/src/org/chromium/base/03-May-2024-7,0075,197

library_loader/03-May-2024-857531

linker/03-May-2024-1,7471,101

orderfile/03-May-2024-1,169810

proguard/03-May-2024-186155

task_scheduler/03-May-2024-324213

COMMON_METADATAD03-May-202412 21

DIR_METADATAD03-May-202441 21

README.mdD03-May-20242.7 KiB7049

android_hardware_buffer_compat.ccD03-May-20244 KiB12886

android_hardware_buffer_compat.hD03-May-20243.1 KiB7859

android_image_reader_abi.hD03-May-20244.1 KiB11761

android_image_reader_compat.ccD03-May-20245.4 KiB167124

android_image_reader_compat.hD03-May-20243.9 KiB9064

android_image_reader_compat_unittest.ccD03-May-20241.4 KiB4324

apk_assets.ccD03-May-20241.9 KiB5641

apk_assets.hD03-May-20241.5 KiB4420

application_status_listener.ccD03-May-20243.9 KiB12896

application_status_listener.hD03-May-20243.1 KiB9837

application_status_listener_unittest.ccD03-May-20243.7 KiB12987

base_feature_list.ccD03-May-20241.5 KiB4832

base_features.ccD03-May-20241.4 KiB3513

base_features.hD03-May-2024698 239

base_jni_onload.ccD03-May-2024606 2415

base_jni_onload.hD03-May-2024521 2311

build_info.ccD03-May-20243.1 KiB9776

build_info.hD03-May-20245.7 KiB202128

bundle_utils.ccD03-May-20243.5 KiB10469

bundle_utils.hD03-May-20241.7 KiB4518

callback_android.ccD03-May-20242.1 KiB5943

callback_android.hD03-May-20241.6 KiB4828

child_process_binding_types.hD03-May-2024669 2715

child_process_service.ccD03-May-20242.9 KiB8467

child_process_unittest.ccD03-May-20241.2 KiB4330

command_line_android.ccD03-May-20243.7 KiB10180

content_uri_utils.ccD03-May-20242.8 KiB8765

content_uri_utils.hD03-May-20241.4 KiB4217

content_uri_utils_unittest.ccD03-May-20241.3 KiB3924

cpu_features.ccD03-May-2024530 2313

early_trace_event_binding.ccD03-May-20245.1 KiB136115

early_trace_event_binding.hD03-May-2024726 2510

event_log.ccD03-May-2024422 179

event_log.hD03-May-2024439 2110

feature_list_jni.ccD03-May-2024419 179

features_jni.ccD03-May-20241.1 KiB3223

field_trial_list.ccD03-May-20244.5 KiB12789

important_file_writer_android.ccD03-May-20241.2 KiB3826

int_string_callback.ccD03-May-2024958 2915

int_string_callback.hD03-May-2024783 2613

java_exception_reporter.ccD03-May-20243.3 KiB10173

java_exception_reporter.hD03-May-20241.5 KiB4318

java_handler_thread.ccD03-May-20246.4 KiB183137

java_handler_thread.hD03-May-20243.5 KiB11861

java_handler_thread_unittest.ccD03-May-20245.1 KiB153121

java_heap_dump_generator.ccD03-May-2024615 2313

java_heap_dump_generator.hD03-May-2024756 2411

java_runtime.ccD03-May-2024848 2617

java_runtime.hD03-May-2024741 2613

jni_android.ccD03-May-202410.1 KiB315239

jni_android.hD03-May-20246.8 KiB18488

jni_android_unittest.ccD03-May-20241.7 KiB6343

jni_array.ccD03-May-202419.1 KiB540460

jni_array.hD03-May-20249.1 KiB248156

jni_array_unittest.ccD03-May-202421.1 KiB627491

jni_int_wrapper.hD03-May-20241.9 KiB5724

jni_registrar.ccD03-May-2024816 3122

jni_registrar.hD03-May-2024792 2914

jni_string.ccD03-May-20244.2 KiB12793

jni_string.hD03-May-20241.8 KiB5234

jni_string_unittest.ccD03-May-20241.5 KiB4937

jni_utils.ccD03-May-20241.2 KiB4128

jni_utils.hD03-May-2024813 3213

jni_weak_ref.ccD03-May-20241.9 KiB7957

jni_weak_ref.hD03-May-20241.8 KiB5226

locale_utils.ccD03-May-20241 KiB3524

locale_utils.hD03-May-2024738 3013

meminfo_dump_provider.ccD03-May-20244.4 KiB10658

meminfo_dump_provider.hD03-May-20241.2 KiB3925

meminfo_dump_provider_unittest.ccD03-May-20243.8 KiB10277

memory_pressure_listener_android.ccD03-May-2024855 3018

memory_pressure_listener_android.hD03-May-2024868 3016

native_uma_recorder.ccD03-May-202411.8 KiB334277

path_service_android.ccD03-May-2024673 2315

path_utils.ccD03-May-20242.9 KiB9576

path_utils.hD03-May-20242.2 KiB6019

path_utils_unittest.ccD03-May-20242.1 KiB6643

radio_utils.ccD03-May-20241.9 KiB7857

radio_utils.hD03-May-20241.5 KiB6647

radio_utils_unittest.ccD03-May-2024865 2615

reached_addresses_bitset.ccD03-May-20244.1 KiB11974

reached_addresses_bitset.hD03-May-20242.7 KiB7730

reached_addresses_bitset_unittest.ccD03-May-20242.5 KiB7959

reached_code_profiler.ccD03-May-20249.4 KiB304228

reached_code_profiler.hD03-May-20241.3 KiB3513

reached_code_profiler_stub.ccD03-May-2024476 2313

remove_stale_data.ccD03-May-20241.6 KiB5842

remove_stale_data.hD03-May-2024757 2610

resource_exclusions.gniD03-May-20241.1 KiB2822

scoped_hardware_buffer_fence_sync.ccD03-May-20241,020 3825

scoped_hardware_buffer_fence_sync.hD03-May-20241.5 KiB4830

scoped_hardware_buffer_handle.ccD03-May-20243.2 KiB12287

scoped_hardware_buffer_handle.hD03-May-20243.4 KiB9334

scoped_java_ref.ccD03-May-20242.1 KiB9372

scoped_java_ref.hD03-May-202418.2 KiB538287

scoped_java_ref_unittest.ccD03-May-202410.7 KiB341267

statistics_recorder_android.ccD03-May-2024817 2919

sys_utils.ccD03-May-20241.7 KiB5637

sys_utils.hD03-May-2024713 2714

sys_utils_unittest.ccD03-May-2024702 2514

thread_instruction_count.ccD03-May-20242.6 KiB9163

thread_instruction_count.hD03-May-20241.9 KiB6431

timezone_utils.ccD03-May-2024658 2515

timezone_utils.hD03-May-2024527 2411

trace_event_binding.ccD03-May-202412.2 KiB327274

trace_event_binding.hD03-May-2024528 2011

unguessable_token_android.ccD03-May-20241.4 KiB4534

unguessable_token_android.hD03-May-20241.4 KiB4526

unguessable_token_android_unittest.ccD03-May-20241.6 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