@@ -355,17 +355,21 @@ void AddToBundle(JNIEnv* env, jobject bundle, const char* key, int64_t value) {
355355 env->DeleteLocalRef (key_string);
356356}
357357
358- void AddArrayListToBundle (JNIEnv* env, jobject bundle, const char * key, jobject arraylist) {
358+ void AddArrayListToBundle (JNIEnv* env, jobject bundle, const char * key,
359+ jobject arraylist) {
359360 jstring key_string = env->NewStringUTF (key);
360- env->CallVoidMethod (bundle, util::bundle::GetMethodId (util::bundle::kPutParcelableArrayList ),
361- key_string, arraylist);
361+ env->CallVoidMethod (
362+ bundle, util::bundle::GetMethodId (util::bundle::kPutParcelableArrayList ),
363+ key_string, arraylist);
362364 util::CheckAndClearJniExceptions (env);
363365 env->DeleteLocalRef (key_string);
364366}
365367
366- void AddBundleToBundle (JNIEnv* env, jobject bundle, const char * key, jobject inner_bundle) {
368+ void AddBundleToBundle (JNIEnv* env, jobject bundle, const char * key,
369+ jobject inner_bundle) {
367370 jstring key_string = env->NewStringUTF (key);
368- env->CallVoidMethod (bundle, util::bundle::GetMethodId (util::bundle::kPutBundle ),
371+ env->CallVoidMethod (bundle,
372+ util::bundle::GetMethodId (util::bundle::kPutBundle ),
369373 key_string, inner_bundle);
370374 util::CheckAndClearJniExceptions (env);
371375 env->DeleteLocalRef (key_string);
@@ -374,15 +378,16 @@ void AddBundleToBundle(JNIEnv* env, jobject bundle, const char* key, jobject inn
374378jobject MapToBundle (JNIEnv* env, const std::map<Variant, Variant>& map);
375379
376380jobject VectorToArrayList (JNIEnv* env, const std::vector<Variant>& vector) {
377- jobject arraylist =
378- env-> NewObject ( util::array_list::GetClass (),
379- util::array_list::GetMethodId (util::array_list::kConstructor ));
381+ jobject arraylist = env-> NewObject (
382+ util::array_list::GetClass (),
383+ util::array_list::GetMethodId (util::array_list::kConstructor ));
380384
381385 for (const Variant& element : vector) {
382386 if (element.is_map ()) {
383387 jobject bundle = MapToBundle (env, element.map ());
384- env->CallBooleanMethod (arraylist, util::array_list::GetMethodId (util::array_list::kAdd ),
385- bundle);
388+ env->CallBooleanMethod (
389+ arraylist, util::array_list::GetMethodId (util::array_list::kAdd ),
390+ bundle);
386391 env->DeleteLocalRef (bundle);
387392 } else {
388393 LogError (" VectorToArrayList: Unsupported type (%s) within vector." ,
@@ -392,15 +397,14 @@ jobject VectorToArrayList(JNIEnv* env, const std::vector<Variant>& vector) {
392397 return arraylist;
393398}
394399
395- bool AddVariantToBundle (JNIEnv* env, jobject bundle, const char * key, const Variant& value) {
400+ bool AddVariantToBundle (JNIEnv* env, jobject bundle, const char * key,
401+ const Variant& value) {
396402 if (value.is_int64 ()) {
397403 AddToBundle (env, bundle, key, value.int64_value ());
398404 } else if (value.is_double ()) {
399- AddToBundle (env, bundle, key,
400- value.double_value ());
405+ AddToBundle (env, bundle, key, value.double_value ());
401406 } else if (value.is_string ()) {
402- AddToBundle (env, bundle, key,
403- value.string_value ());
407+ AddToBundle (env, bundle, key, value.string_value ());
404408 } else if (value.is_bool ()) {
405409 // Just use integer 0 or 1.
406410 AddToBundle (env, bundle, key,
@@ -433,9 +437,11 @@ jobject MapToBundle(JNIEnv* env, const std::map<Variant, Variant>& map) {
433437 if (!pair.first .is_string ()) {
434438 continue ;
435439 }
436- if (!AddVariantToBundle (env, bundle, pair.first .string_value (), pair.second )) {
440+ if (!AddVariantToBundle (env, bundle, pair.first .string_value (),
441+ pair.second )) {
437442 LogError (" MapToBundle: Unsupported type (%s) within map with key %s." ,
438- Variant::TypeName (pair.second .type ()), pair.first .string_value ());
443+ Variant::TypeName (pair.second .type ()),
444+ pair.first .string_value ());
439445 }
440446 util::CheckAndClearJniExceptions (env);
441447 }
0 commit comments