1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/android/base_jni_registrar.h"
6
7 #include "base/android/animation_frame_time_histogram.h"
8 #include "base/android/apk_assets.h"
9 #include "base/android/application_status_listener.h"
10 #include "base/android/build_info.h"
11 #include "base/android/callback_android.h"
12 #include "base/android/command_line_android.h"
13 #include "base/android/content_uri_utils.h"
14 #include "base/android/context_utils.h"
15 #include "base/android/cpu_features.h"
16 #include "base/android/event_log.h"
17 #include "base/android/field_trial_list.h"
18 #include "base/android/important_file_writer_android.h"
19 #include "base/android/java_handler_thread.h"
20 #include "base/android/java_runtime.h"
21 #include "base/android/jni_android.h"
22 #include "base/android/jni_registrar.h"
23 #include "base/android/jni_utils.h"
24 #include "base/android/locale_utils.h"
25 #include "base/android/memory_pressure_listener_android.h"
26 #include "base/android/path_service_android.h"
27 #include "base/android/path_utils.h"
28 #include "base/android/record_histogram.h"
29 #include "base/android/record_user_action.h"
30 #include "base/android/sys_utils.h"
31 #include "base/android/thread_utils.h"
32 #include "base/android/trace_event_binding.h"
33 #include "base/macros.h"
34 #include "base/message_loop/message_pump_android.h"
35 #include "base/power_monitor/power_monitor_device_source_android.h"
36 #include "base/trace_event/trace_event.h"
37
38 namespace base {
39 namespace android {
40
41 static RegistrationMethod kBaseRegisteredMethods[] = {
42 {"AnimationFrameTimeHistogram",
43 base::android::RegisterAnimationFrameTimeHistogram},
44 {"ApkAssets", base::android::RegisterApkAssets},
45 {"ApplicationStatusListener",
46 base::android::ApplicationStatusListener::RegisterBindings},
47 {"BuildInfo", base::android::BuildInfo::RegisterBindings},
48 {"CallbackAndroid", base::android::RegisterCallbackAndroid},
49 {"CommandLine", base::android::RegisterCommandLine},
50 {"ContentUriUtils", base::RegisterContentUriUtils},
51 {"ContextUtils", base::android::RegisterContextUtils},
52 {"CpuFeatures", base::android::RegisterCpuFeatures},
53 {"EventLog", base::android::RegisterEventLog},
54 {"FieldTrialList", base::android::RegisterFieldTrialList},
55 {"ImportantFileWriterAndroid",
56 base::android::RegisterImportantFileWriterAndroid},
57 {"JNIUtils", base::android::RegisterJNIUtils},
58 {"LocaleUtils", base::android::RegisterLocaleUtils},
59 {"MemoryPressureListenerAndroid",
60 base::android::MemoryPressureListenerAndroid::Register},
61 {"JavaHandlerThread", base::android::JavaHandlerThread::RegisterBindings},
62 {"PathService", base::android::RegisterPathService},
63 {"PathUtils", base::android::RegisterPathUtils},
64 {"PowerMonitor", base::RegisterPowerMonitor},
65 {"RecordHistogram", base::android::RegisterRecordHistogram},
66 {"RecordUserAction", base::android::RegisterRecordUserAction},
67 {"Runtime", base::android::JavaRuntime::Register},
68 {"SystemMessageHandler", base::MessagePumpForUI::RegisterBindings},
69 {"SysUtils", base::android::SysUtils::Register},
70 {"ThreadUtils", base::RegisterThreadUtils},
71 {"TraceEvent", base::android::RegisterTraceEvent},
72 };
73
RegisterJni(JNIEnv * env)74 bool RegisterJni(JNIEnv* env) {
75 TRACE_EVENT0("startup", "base_android::RegisterJni");
76 return RegisterNativeMethods(env, kBaseRegisteredMethods,
77 arraysize(kBaseRegisteredMethods));
78 }
79
80 } // namespace android
81 } // namespace base
82