1 // Copyright 2014 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.
5 #include "components/variations/android/variations_associated_data_android.h"
9 #include "base/android/jni_string.h"
10 #include "components/variations/variations_associated_data.h"
11 #include "jni/VariationsAssociatedData_jni.h"
13 using base::android::ConvertJavaStringToUTF8
;
14 using base::android::ConvertUTF8ToJavaString
;
16 namespace variations
{
20 jstring
GetVariationParamValue(JNIEnv
* env
,
23 jstring jparam_name
) {
24 std::string
trial_name(ConvertJavaStringToUTF8(env
, jtrial_name
));
25 std::string
param_name(ConvertJavaStringToUTF8(env
, jparam_name
));
26 std::string param_value
=
27 variations::GetVariationParamValue(trial_name
, param_name
);
28 return ConvertUTF8ToJavaString(env
, param_value
).Release();
31 bool RegisterVariationsAssociatedData(JNIEnv
* env
) {
32 return RegisterNativesImpl(env
);
35 } // namespace android
37 } // namespace variations