am 6df4c12b: am d59b0643: Use user restrictions instead of isLinkedUser
* commit '6df4c12b475aca7087f79c3fa5c3d56a2b18f8b7':
Use user restrictions instead of isLinkedUser
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index fc42f3f..0aab2ac 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -3796,9 +3796,13 @@
// seeded when they start up for the first time. Clings won't work well with that
boolean supportsLimitedUsers =
android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2;
- if (supportsLimitedUsers) {
- final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
- if (um.isLinkedUser()) return false;
+ Account[] accounts = AccountManager.get(this).getAccounts();
+ if (supportsLimitedUsers && accounts.length == 0) {
+ UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
+ Bundle restrictions = um.getUserRestrictions();
+ if (restrictions.getBoolean(UserManager.DISALLOW_MODIFY_ACCOUNTS, false)) {
+ return false;
+ }
}
return true;
}