Disallow switching managed profile to foreground

Another check in the ActivityManager to stop us from getting into an
invalid state by a fat-fingered 'am switch' etc.

@bug 16814252

Change-Id: Id65ab647d5a535cc2f965139a1b717cf65aa7e69
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index ae2ef06..07ad9e4 100755
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -17244,6 +17244,10 @@
                     Slog.w(TAG, "No user info for user #" + userId);
                     return false;
                 }
+                if (foreground && userInfo.isManagedProfile()) {
+                    Slog.w(TAG, "Cannot switch to User #" + userId + ": not a full user");
+                    return false;
+                }
 
                 if (foreground) {
                     mWindowManager.startFreezingScreen(R.anim.screen_user_exit,