diff options
author | Amith Yamasani <yamasani@google.com> | 2013-04-25 15:18:12 -0700 |
---|---|---|
committer | Steve Kondik <shade@chemlab.org> | 2013-08-17 02:35:26 -0700 |
commit | 68c01fa7d6ff99c193015a6fda031f2c589c630c (patch) | |
tree | 7c26f36469508d0225396da75e09a48ececccda9 /src/com/cyanogenmod | |
parent | 930ab6c32f4c44f298b6212d86de06d33f7ddcc9 (diff) | |
download | android_packages_apps_Trebuchet-68c01fa7d6ff99c193015a6fda031f2c589c630c.tar.gz android_packages_apps_Trebuchet-68c01fa7d6ff99c193015a6fda031f2c589c630c.tar.bz2 android_packages_apps_Trebuchet-68c01fa7d6ff99c193015a6fda031f2c589c630c.zip |
Use user restrictions instead of isLinkedUser
Use a different API to query if the user is likely to have fewer apps installed.
Bug: 8720520
Change-Id: Ic4cbca47679627b33e08fd83653f8d20de294675
Diffstat (limited to 'src/com/cyanogenmod')
-rw-r--r-- | src/com/cyanogenmod/trebuchet/Launcher.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/com/cyanogenmod/trebuchet/Launcher.java b/src/com/cyanogenmod/trebuchet/Launcher.java index d2dcd9ef7..26084f5ff 100644 --- a/src/com/cyanogenmod/trebuchet/Launcher.java +++ b/src/com/cyanogenmod/trebuchet/Launcher.java @@ -67,11 +67,8 @@ import android.os.Handler; import android.os.Message; import android.os.StrictMode; import android.os.SystemClock; -<<<<<<< HEAD:src/com/cyanogenmod/trebuchet/Launcher.java import android.os.UserHandle; -======= import android.os.UserManager; ->>>>>>> e233a8b... Hide clings in child mode:src/com/android/launcher2/Launcher.java import android.provider.Settings; import android.speech.RecognizerIntent; import android.text.Selection; @@ -4279,9 +4276,13 @@ public final class Launcher extends Activity // 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.isUserLimited()) 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; } |