Merge "Add logs to check which userId is used for workProfile matcher" into udc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e201480e77
@@ -97,7 +97,11 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP
|
||||
StatsLogManager statsLogManager) {
|
||||
mUserManager = userManager;
|
||||
mAllApps = allApps;
|
||||
if (FeatureFlags.ENABLE_APP_CLONING_CHANGES_IN_LAUNCHER.get()) {
|
||||
boolean cloningChanges = FeatureFlags.ENABLE_APP_CLONING_CHANGES_IN_LAUNCHER.get();
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(WORK_TAB_MISSING, "matcher flag: " + cloningChanges);
|
||||
}
|
||||
if (cloningChanges) {
|
||||
mMatcher = ofWorkProfileUser(userManager);
|
||||
} else {
|
||||
mMatcher = mAllApps.mPersonalMatcher.negate();
|
||||
|
||||
@@ -95,7 +95,7 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
mPackages = packages;
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.WORK_TAB_MISSING, "PackageUpdatedTask mOp: " + mOp +
|
||||
" packageCount: " + mPackages.length);
|
||||
" packageCount: " + mPackages.length + " user: " + user);
|
||||
DEBUG = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ package com.android.launcher3.util;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -25,6 +26,7 @@ import com.android.launcher3.LauncherSettings.Favorites;
|
||||
import com.android.launcher3.model.data.FolderInfo;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.shortcuts.ShortcutKey;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashSet;
|
||||
@@ -42,7 +44,14 @@ public abstract class ItemInfoMatcher {
|
||||
private static final ComponentName EMPTY_COMPONENT = new ComponentName("", "");
|
||||
|
||||
public static Predicate<ItemInfo> ofUser(UserHandle user) {
|
||||
return info -> info != null && info.user.equals(user);
|
||||
return info -> {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.WORK_TAB_MISSING, "userHandle: " + user
|
||||
+ ", itemUserHandle: " + info.user
|
||||
+ " package: " + info.getTargetPackage());
|
||||
}
|
||||
return info != null && info.user.equals(user);
|
||||
};
|
||||
}
|
||||
|
||||
public static Predicate<ItemInfo> ofComponents(
|
||||
|
||||
Reference in New Issue
Block a user