Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 501f2c2c authored by Kenny Guy's avatar Kenny Guy Committed by Android Git Automerger
Browse files

am f4824a06: Fix issue with not allowing activities for current user.

* commit 'f4824a06':
  Fix issue with not allowing activities for current user.
parents 4ae6e2f9 f4824a06
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -545,6 +545,7 @@ public class InputMethodUtils {

        public boolean isCurrentProfile(int userId) {
            synchronized (this) {
                if (userId == mCurrentUserId) return true;
                for (int i = 0; i < mCurrentProfileIds.length; i++) {
                    if (userId == mCurrentProfileIds[i]) return true;
                }
+1 −1
Original line number Diff line number Diff line
@@ -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 {
+1 −0
Original line number Diff line number Diff line
@@ -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;
        }
+3 −1
Original line number Diff line number Diff line
@@ -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;

@@ -5257,6 +5258,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;
        }