summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorKenny Guy <kennyguy@google.com>2014-04-02 19:17:41 +0100
committerKenny Guy <kennyguy@google.com>2014-04-02 19:17:41 +0100
commitf4824a06884e096beef921646cba4be29d7f36fc (patch)
tree5ded85e32a2ddf9ea1a710ce0c8b836d83209599 /services
parenta8b937115ac3bf047c8fc6c750f052fd633c5dd8 (diff)
downloadframeworks_base-f4824a06884e096beef921646cba4be29d7f36fc.zip
frameworks_base-f4824a06884e096beef921646cba4be29d7f36fc.tar.gz
frameworks_base-f4824a06884e096beef921646cba4be29d7f36fc.tar.bz2
Fix issue with not allowing activities for current user.
Change-Id: Ic2e30c3f4990a03aac9801ee9bf5f270a5e90ef8
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/am/ActivityManagerService.java2
-rwxr-xr-xservices/core/java/com/android/server/am/ActivityStack.java1
-rw-r--r--services/core/java/com/android/server/wm/WindowManagerService.java4
3 files changed, 5 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java
index ac6f684..afb389e 100644
--- a/services/core/java/com/android/server/am/ActivityManagerService.java
+++ b/services/core/java/com/android/server/am/ActivityManagerService.java
@@ -1019,7 +1019,7 @@ public final class ActivityManagerService extends ActivityManagerNative
final ActivityThread mSystemThread;
int mCurrentUserId = 0;
- int[] mCurrentProfileIds = new int[0]; // Accessed by ActivityStack
+ int[] mCurrentProfileIds = new int[] {UserHandle.USER_OWNER}; // Accessed by ActivityStack
private UserManagerService mUserManager;
private final class AppDeathRecipient implements IBinder.DeathRecipient {
diff --git a/services/core/java/com/android/server/am/ActivityStack.java b/services/core/java/com/android/server/am/ActivityStack.java
index d949ba0..b894724 100755
--- a/services/core/java/com/android/server/am/ActivityStack.java
+++ b/services/core/java/com/android/server/am/ActivityStack.java
@@ -344,6 +344,7 @@ final class ActivityStack {
* Checks whether the userid is a profile of the current user.
*/
private boolean isCurrentProfileLocked(int userId) {
+ if (userId == mCurrentUser) return true;
for (int i = 0; i < mService.mCurrentProfileIds.length; i++) {
if (mService.mCurrentProfileIds[i] == userId) return true;
}
diff --git a/services/core/java/com/android/server/wm/WindowManagerService.java b/services/core/java/com/android/server/wm/WindowManagerService.java
index 2e5b8de..b12ae4f 100644
--- a/services/core/java/com/android/server/wm/WindowManagerService.java
+++ b/services/core/java/com/android/server/wm/WindowManagerService.java
@@ -86,6 +86,7 @@ import android.os.StrictMode;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.os.Trace;
+import android.os.UserHandle;
import android.os.WorkSource;
import android.provider.Settings;
import android.util.DisplayMetrics;
@@ -311,7 +312,7 @@ public class WindowManagerService extends IWindowManager.Stub
* Users that are profiles of the current user. These are also allowed to show windows
* on the current user.
*/
- int[] mCurrentProfileIds = new int[0];
+ int[] mCurrentProfileIds = new int[] {UserHandle.USER_OWNER};
final Context mContext;
@@ -5255,6 +5256,7 @@ public class WindowManagerService extends IWindowManager.Stub
/* Called by WindowState */
boolean isCurrentProfileLocked(int userId) {
+ if (userId == mCurrentUserId) return true;
for (int i = 0; i < mCurrentProfileIds.length; i++) {
if (mCurrentProfileIds[i] == userId) return true;
}