From 4f7e2e334e4ca5f1a67baf4bdd40cd080b954161 Mon Sep 17 00:00:00 2001 From: Amith Yamasani Date: Thu, 14 Aug 2014 18:49:48 -0700 Subject: Copy certain settings to the managed profile All reads of those specific settings will go to the primary user. Inserts to primary also go to managed profiles in order to notify any observers. This enables Location settings to be shared by both profiles. Also some other settings related to IME and Accessibility since those services are shared across the profiles. Bug: 16457210 Change-Id: Ib8fd697b5c78027fcbaf245d82dda5e6d6aab4f0 --- core/java/android/os/UserManager.java | 2 +- core/java/android/provider/Settings.java | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) (limited to 'core/java/android') diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index f9e7b78..10c955e 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -718,7 +718,7 @@ public class UserManager { /** * Returns list of the profiles of userHandle including * userHandle itself. - * Note that it this returns both enabled and not enabled profiles. See + * Note that this returns both enabled and not enabled profiles. See * {@link #getUserProfiles()} if you need only the enabled ones. * * Requires {@link android.Manifest.permission#MANAGE_USERS} permission. diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 8886559..c2a3012 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -2667,6 +2667,16 @@ public final class Settings { }; /** + * These entries are considered common between the personal and the managed profile, + * since the managed profile doesn't get to change them. + * @hide + */ + public static final String[] CLONE_TO_MANAGED_PROFILE = { + DATE_FORMAT, + TIME_12_24 + }; + + /** * When to use Wi-Fi calling * * @see android.telephony.TelephonyManager.WifiCallingChoices @@ -4797,6 +4807,26 @@ public final class Settings { }; /** + * These entries are considered common between the personal and the managed profile, + * since the managed profile doesn't get to change them. + * @hide + */ + public static final String[] CLONE_TO_MANAGED_PROFILE = { + ACCESSIBILITY_ENABLED, + ALLOW_MOCK_LOCATION, + ALLOWED_GEOLOCATION_ORIGINS, + DEFAULT_INPUT_METHOD, + ENABLED_ACCESSIBILITY_SERVICES, + ENABLED_INPUT_METHODS, + LOCATION_MODE, + LOCATION_PROVIDERS_ALLOWED, + LOCK_SCREEN_ALLOW_PRIVATE_NOTIFICATIONS, + SELECTED_INPUT_METHOD_SUBTYPE, + SELECTED_SPELL_CHECKER, + SELECTED_SPELL_CHECKER_SUBTYPE + }; + + /** * Helper method for determining if a location provider is enabled. * * @param cr the content resolver to use -- cgit v1.1