1 /*
2  * Copyright (C) 2011 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package libcore.icu;
18 
19 import com.android.tools.layoutlib.annotations.LayoutlibDelegate;
20 
21 import java.util.Locale;
22 
23 /**
24  * Delegate implementing the native methods of libcore.icu.ICU
25  *
26  * Through the layoutlib_create tool, the original native methods of ICU have been replaced
27  * by calls to methods of the same name in this delegate class.
28  *
29  */
30 public class ICU_Delegate {
31     // --- Native methods accessing ICU's database.
32 
33     @LayoutlibDelegate
getAvailableLocalesNative()34     /*package*/ static String[] getAvailableLocalesNative() {
35         return new String[0];
36     }
37 
38     @LayoutlibDelegate
getISO3Country(String locale)39     /*package*/ static String getISO3Country(String locale) {
40         return "";
41     }
42 
43     @LayoutlibDelegate
getISO3Language(String locale)44     /*package*/ static String getISO3Language(String locale) {
45         return "";
46     }
47 
48     @LayoutlibDelegate
getScript(String locale)49     /*package*/ static String getScript(String locale) {
50         return "";
51     }
52 
53     @LayoutlibDelegate
getISOLanguagesNative()54     /*package*/ static String[] getISOLanguagesNative() {
55         return Locale.getISOLanguages();
56     }
57 
58     @LayoutlibDelegate
getISOCountriesNative()59     /*package*/ static String[] getISOCountriesNative() {
60         return Locale.getISOCountries();
61     }
62 
63     @LayoutlibDelegate
getDefaultLocale()64     /*package*/ static String getDefaultLocale() {
65         return Locale.getDefault().toString();
66     }
67 
68     @LayoutlibDelegate
getCldrVersion()69     /*package*/ static String getCldrVersion() {
70         return "";
71     }
72 
73     @LayoutlibDelegate
getIcuVersion()74     /*package*/ static String getIcuVersion() {
75         return "";
76     }
77 
78     @LayoutlibDelegate
getUnicodeVersion()79     /*package*/ static String getUnicodeVersion() {
80         return "";
81     }
82 }
83