From ccbeb61ac21527839deb115199cbe98fa2b73c05 Mon Sep 17 00:00:00 2001 From: Guang Zhu Date: Tue, 21 Oct 2014 14:33:50 -0700 Subject: Block monkey from creating user profiles Bug: 17721767 Change-Id: Ibf686d6aa5da29411ee23f8ce6826ed93c1fa970 --- .../com/android/systemui/statusbar/policy/UserSwitcherController.java | 3 +++ 1 file changed, 3 insertions(+) (limited to 'packages/SystemUI/src') diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java index eb808c2..5c7909a 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/UserSwitcherController.java @@ -571,6 +571,9 @@ public class UserSwitcherController { cancel(); } else { dismiss(); + if (ActivityManager.isUserAMonkey()) { + return; + } UserInfo user = mUserManager.createSecondaryUser( mContext.getString(R.string.user_new_user_name), 0 /* flags */); if (user == null) { -- cgit v1.1