diff options
| author | “Ankita <ankitavyas@google.com> | 2021-09-10 12:20:43 +0000 |
|---|---|---|
| committer | “Ankita <ankitavyas@google.com> | 2021-10-06 05:25:43 +0000 |
| commit | f2d3022e5d88db854bc6a77fd72612cde0a8a296 (patch) | |
| tree | cba9ea643a1ed024b5dfb75b5f35b8cd66348c8a /core/java | |
| parent | 396c9c5f5dd08a4bdf4f4bc7c782bdf8c9249a7b (diff) | |
Add new LocaleManagerService and its shell commands
Ignore-AOSP-First: permission present in internal branch only
Test: tested manually via adb
Bug: 194094788
Bug: 194484378
Change-Id: I413a74fc1b15d164de7f2098e975e0b792685394
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/ILocaleManager.aidl | 43 | ||||
| -rw-r--r-- | core/java/android/content/Context.java | 10 |
2 files changed, 53 insertions, 0 deletions
diff --git a/core/java/android/app/ILocaleManager.aidl b/core/java/android/app/ILocaleManager.aidl new file mode 100644 index 000000000000..348cb2d30739 --- /dev/null +++ b/core/java/android/app/ILocaleManager.aidl @@ -0,0 +1,43 @@ + +/* + * Copyright (C) 2021 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.app; + +import android.os.LocaleList; + +/** + * Internal interface used to control app-specific locales. + * + * <p>Use the {@link android.app.LocaleManager} class rather than going through + * this Binder interface directly. See {@link android.app.LocaleManager} for + * more complete documentation. + * + * @hide + */ + interface ILocaleManager { + + /** + * Sets a specified app’s app-specific UI locales. + */ + void setApplicationLocales(String packageName, int userId, in LocaleList locales); + + /** + * Returns the specified app's app-specific locales. + */ + LocaleList getApplicationLocales(String packageName, int userId); + + }
\ No newline at end of file diff --git a/core/java/android/content/Context.java b/core/java/android/content/Context.java index 3ab070f2395c..20ee695d1986 100644 --- a/core/java/android/content/Context.java +++ b/core/java/android/content/Context.java @@ -3801,6 +3801,7 @@ public abstract class Context { //@hide: TIME_ZONE_DETECTOR_SERVICE, PERMISSION_SERVICE, LIGHTS_SERVICE, + LOCALE_SERVICE, //@hide: PEOPLE_SERVICE, //@hide: DEVICE_STATE_SERVICE, //@hide: SPEECH_RECOGNITION_SERVICE, @@ -5784,6 +5785,15 @@ public abstract class Context { public static final String DISPLAY_HASH_SERVICE = "display_hash"; /** + * Use with {@link #getSystemService(String)} to retrieve a + * {@link android.app.LocaleManager}. + * + * @see #getSystemService(String) + * @hide + */ + public static final String LOCALE_SERVICE = "locale"; + + /** * Determine whether the given permission is allowed for a particular * process and user ID running in the system. * |
