Avi Drissman | e4622aa | 2022-09-08 20:36:06 | [diff] [blame] | 1 | // Copyright 2017 The Chromium Authors |
Jungshik Shin | ffb4fbf | 2017-06-28 22:07:30 | [diff] [blame] | 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/timezone_utils.h" |
| 6 | |
Jan Wilken Dörrie | ad587c3 | 2021-03-11 14:09:27 | [diff] [blame] | 7 | #include <string> |
| 8 | |
Jungshik Shin | ffb4fbf | 2017-06-28 22:07:30 | [diff] [blame] | 9 | #include "base/android/jni_android.h" |
| 10 | #include "base/android/jni_string.h" |
Andrew Grieve | ecb885bb | 2024-05-29 18:14:19 | [diff] [blame] | 11 | |
| 12 | // Must come after all headers that specialize FromJniType() / ToJniType(). |
Andrew Grieve | 1c7dbda | 2023-05-26 15:34:55 | [diff] [blame] | 13 | #include "base/base_jni/TimezoneUtils_jni.h" |
Jungshik Shin | ffb4fbf | 2017-06-28 22:07:30 | [diff] [blame] | 14 | |
| 15 | namespace base { |
| 16 | namespace android { |
| 17 | |
Jan Wilken Dörrie | 85285b0 | 2021-03-11 23:38:47 | [diff] [blame] | 18 | std::u16string GetDefaultTimeZoneId() { |
Jungshik Shin | ffb4fbf | 2017-06-28 22:07:30 | [diff] [blame] | 19 | JNIEnv* env = base::android::AttachCurrentThread(); |
| 20 | ScopedJavaLocalRef<jstring> timezone_id = |
| 21 | Java_TimezoneUtils_getDefaultTimeZoneId(env); |
| 22 | return ConvertJavaStringToUTF16(timezone_id); |
| 23 | } |
| 24 | |
| 25 | } // namespace android |
| 26 | } // namespace base |