summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Jurka <mikejurka@google.com>2013-03-19 13:49:20 +0100
committerMichael Jurka <mikejurka@google.com>2013-03-29 15:45:49 -0700
commite233a8bf79d624c5419805fde4bb0e025c66b020 (patch)
treed80f6e539bdb1fc08d32892ebcb49028481cf163 /src
parent98720c96ee8c1eab026903dd83507a3cc50de900 (diff)
downloadandroid_packages_apps_Trebuchet-e233a8bf79d624c5419805fde4bb0e025c66b020.tar.gz
android_packages_apps_Trebuchet-e233a8bf79d624c5419805fde4bb0e025c66b020.tar.bz2
android_packages_apps_Trebuchet-e233a8bf79d624c5419805fde4bb0e025c66b020.zip
Hide clings in child mode
Bug: 8349525 Change-Id: Ie92153e77f1714b88986813a689a4fa7e444d1dc
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/Launcher.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 545ee2e6c..9e651c60c 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -63,6 +63,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.StrictMode;
import android.os.SystemClock;
+import android.os.UserManager;
import android.provider.Settings;
import android.speech.RecognizerIntent;
import android.text.Selection;
@@ -3686,6 +3687,14 @@ public final class Launcher extends Activity
// disable clings when running in a test harness
if(ActivityManager.isRunningInTestHarness()) return false;
+ // Restricted secondary users (child mode) will potentially have very few apps
+ // seeded when they start up for the first time. Clings won't work well with that
+ boolean supportsRestrictedUsers =
+ android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.JELLY_BEAN_MR2;
+ if (supportsRestrictedUsers) {
+ final UserManager um = (UserManager) getSystemService(Context.USER_SERVICE);
+ if (um.isUserRestricted()) return false;
+ }
return true;
}