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

Commit 304a8d95 authored by Ricky Wai's avatar Ricky Wai Committed by android-build-merger
Browse files

Merge \\"Make Settings->Apps can handle work apps even work profile not...

Merge \\"Make Settings->Apps can handle work apps even work profile not enabled yet\\" into nyc-dev am: 18c8690b
am: 711629a2

Change-Id: Ib56df7b06fe643f5fe30c4101e95045241e3027b
parents 5e41f2b5 711629a2
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -46,6 +46,8 @@ import android.text.format.Formatter;
import android.util.Log;
import android.util.SparseArray;

import com.android.internal.util.ArrayUtils;

import java.io.File;
import java.text.Collator;
import java.text.Normalizer;
@@ -123,8 +125,8 @@ public class ApplicationsState {
        mPm = mContext.getPackageManager();
        mIpm = AppGlobals.getPackageManager();
        mUm = (UserManager) app.getSystemService(Context.USER_SERVICE);
        for (UserHandle user : mUm.getUserProfiles()) {
            mEntriesMap.put(user.getIdentifier(), new HashMap<String, AppEntry>());
        for (int userId : mUm.getProfileIdsWithDisabled(UserHandle.myUserId())) {
            mEntriesMap.put(userId, new HashMap<String, AppEntry>());
        }
        mThread = new HandlerThread("ApplicationsState.Loader",
                Process.THREAD_PRIORITY_BACKGROUND);
@@ -426,7 +428,8 @@ public class ApplicationsState {
    }

    private void addUser(int userId) {
        if (mUm.getUserProfiles().contains(new UserHandle(userId))) {
        final int profileIds[] = mUm.getProfileIdsWithDisabled(UserHandle.myUserId());
        if (ArrayUtils.contains(profileIds, userId)) {
            synchronized (mEntriesMap) {
                mEntriesMap.put(userId, new HashMap<String, AppEntry>());
                if (mResumed) {