Merge "Make Settings->Apps can handle work apps even work profile not enabled yet" into nyc-dev
This commit is contained in:
@@ -46,6 +46,8 @@ import android.text.format.Formatter;
|
|||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.SparseArray;
|
import android.util.SparseArray;
|
||||||
|
|
||||||
|
import com.android.internal.util.ArrayUtils;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.text.Collator;
|
import java.text.Collator;
|
||||||
import java.text.Normalizer;
|
import java.text.Normalizer;
|
||||||
@@ -123,8 +125,8 @@ public class ApplicationsState {
|
|||||||
mPm = mContext.getPackageManager();
|
mPm = mContext.getPackageManager();
|
||||||
mIpm = AppGlobals.getPackageManager();
|
mIpm = AppGlobals.getPackageManager();
|
||||||
mUm = (UserManager) app.getSystemService(Context.USER_SERVICE);
|
mUm = (UserManager) app.getSystemService(Context.USER_SERVICE);
|
||||||
for (UserHandle user : mUm.getUserProfiles()) {
|
for (int userId : mUm.getProfileIdsWithDisabled(UserHandle.myUserId())) {
|
||||||
mEntriesMap.put(user.getIdentifier(), new HashMap<String, AppEntry>());
|
mEntriesMap.put(userId, new HashMap<String, AppEntry>());
|
||||||
}
|
}
|
||||||
mThread = new HandlerThread("ApplicationsState.Loader",
|
mThread = new HandlerThread("ApplicationsState.Loader",
|
||||||
Process.THREAD_PRIORITY_BACKGROUND);
|
Process.THREAD_PRIORITY_BACKGROUND);
|
||||||
@@ -426,7 +428,8 @@ public class ApplicationsState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addUser(int userId) {
|
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) {
|
synchronized (mEntriesMap) {
|
||||||
mEntriesMap.put(userId, new HashMap<String, AppEntry>());
|
mEntriesMap.put(userId, new HashMap<String, AppEntry>());
|
||||||
if (mResumed) {
|
if (mResumed) {
|
||||||
|
|||||||
Reference in New Issue
Block a user