diff options
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/app/backup/BackupManager.java | 22 | ||||
| -rw-r--r-- | core/java/android/os/UserManager.java | 22 | ||||
| -rw-r--r-- | core/java/android/provider/Settings.java | 30 |
3 files changed, 73 insertions, 1 deletions
diff --git a/core/java/android/app/backup/BackupManager.java b/core/java/android/app/backup/BackupManager.java index e9297b9..1bb4eba 100644 --- a/core/java/android/app/backup/BackupManager.java +++ b/core/java/android/app/backup/BackupManager.java @@ -229,6 +229,28 @@ public class BackupManager { } /** + * Enable/disable data restore at application install time. When enabled, app + * installation will include an attempt to fetch the app's historical data from + * the archival restore dataset (if any). When disabled, no such attempt will + * be made. + * + * <p>Callers must hold the android.permission.BACKUP permission to use this method. + * + * @hide + */ + @SystemApi + public void setAutoRestore(boolean isEnabled) { + checkServiceBinder(); + if (sService != null) { + try { + sService.setAutoRestore(isEnabled); + } catch (RemoteException e) { + Log.e(TAG, "setAutoRestore() couldn't connect"); + } + } + } + + /** * Identify the currently selected transport. Callers must hold the * android.permission.BACKUP permission to use this method. * @return The name of the currently active backup transport. In case of diff --git a/core/java/android/os/UserManager.java b/core/java/android/os/UserManager.java index f9e7b78..9d1a7bc 100644 --- a/core/java/android/os/UserManager.java +++ b/core/java/android/os/UserManager.java @@ -499,7 +499,12 @@ public class UserManager { * Sets all the user-wide restrictions for this user. * Requires the MANAGE_USERS permission. * @param restrictions the Bundle containing all the restrictions. + * @deprecated use {@link android.app.admin.DevicePolicyManager#addUserRestriction( + * android.content.ComponentName, String)} or + * {@link android.app.admin.DevicePolicyManager#clearUserRestriction( + * android.content.ComponentName, String)} instead. */ + @Deprecated public void setUserRestrictions(Bundle restrictions) { setUserRestrictions(restrictions, Process.myUserHandle()); } @@ -509,7 +514,12 @@ public class UserManager { * Requires the MANAGE_USERS permission. * @param restrictions the Bundle containing all the restrictions. * @param userHandle the UserHandle of the user for whom to set the restrictions. + * @deprecated use {@link android.app.admin.DevicePolicyManager#addUserRestriction( + * android.content.ComponentName, String)} or + * {@link android.app.admin.DevicePolicyManager#clearUserRestriction( + * android.content.ComponentName, String)} instead. */ + @Deprecated public void setUserRestrictions(Bundle restrictions, UserHandle userHandle) { try { mService.setUserRestrictions(restrictions, userHandle.getIdentifier()); @@ -523,7 +533,12 @@ public class UserManager { * Requires the MANAGE_USERS permission. * @param key the key of the restriction * @param value the value for the restriction + * @deprecated use {@link android.app.admin.DevicePolicyManager#addUserRestriction( + * android.content.ComponentName, String)} or + * {@link android.app.admin.DevicePolicyManager#clearUserRestriction( + * android.content.ComponentName, String)} instead. */ + @Deprecated public void setUserRestriction(String key, boolean value) { Bundle bundle = getUserRestrictions(); bundle.putBoolean(key, value); @@ -537,7 +552,12 @@ public class UserManager { * @param key the key of the restriction * @param value the value for the restriction * @param userHandle the user whose restriction is to be changed. + * @deprecated use {@link android.app.admin.DevicePolicyManager#addUserRestriction( + * android.content.ComponentName, String)} or + * {@link android.app.admin.DevicePolicyManager#clearUserRestriction( + * android.content.ComponentName, String)} instead. */ + @Deprecated public void setUserRestriction(String key, boolean value, UserHandle userHandle) { Bundle bundle = getUserRestrictions(userHandle); bundle.putBoolean(key, value); @@ -718,7 +738,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 |
