1 // Copyright 2016 The Chromium Authors 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 <string> 6 7 #include "base/android/jni_string.h" 8 #include "base/base_jni_headers/StatisticsRecorderAndroid_jni.h" 9 #include "base/metrics/histogram_base.h" 10 #include "base/metrics/statistics_recorder.h" 11 #include "base/system/sys_info.h" 12 13 using base::android::JavaParamRef; 14 using base::android::ConvertUTF8ToJavaString; 15 16 namespace base { 17 namespace android { 18 JNI_StatisticsRecorderAndroid_ToJson(JNIEnv * env,jint verbosityLevel)19static ScopedJavaLocalRef<jstring> JNI_StatisticsRecorderAndroid_ToJson( 20 JNIEnv* env, 21 jint verbosityLevel) { 22 return ConvertUTF8ToJavaString( 23 env, base::StatisticsRecorder::ToJSON( 24 static_cast<JSONVerbosityLevel>(verbosityLevel))); 25 } 26 27 } // namespace android 28 } // namespace base 29