application_info_helper.cc 737 B

123456789101112131415161718192021
  1. // Copyright 2021 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. #include "weblayer/browser/android/application_info_helper.h"
  5. #include "base/android/jni_android.h"
  6. #include "base/android/jni_string.h"
  7. #include "weblayer/browser/java/jni/ApplicationInfoHelper_jni.h"
  8. namespace weblayer {
  9. // static
  10. bool GetApplicationMetadataAsBoolean(const std::string& key,
  11. bool default_value) {
  12. auto* env = base::android::AttachCurrentThread();
  13. return Java_ApplicationInfoHelper_getMetadataAsBoolean(
  14. env, base::android::ConvertUTF8ToJavaString(env, key), default_value);
  15. }
  16. } // namespace weblayer