Merge "Cleanup WorkProfileTest logs" into udc-qpr-dev
This commit is contained in:
@@ -20,9 +20,7 @@ import static android.app.admin.DevicePolicyManager.ACTION_DEVICE_POLICY_RESOURC
|
||||
|
||||
import static com.android.launcher3.LauncherAppState.ACTION_FORCE_ROLOAD;
|
||||
import static com.android.launcher3.config.FeatureFlags.IS_STUDIO_BUILD;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.sDebugTracing;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
|
||||
|
||||
@@ -69,7 +67,6 @@ import com.android.launcher3.pm.InstallSessionTracker;
|
||||
import com.android.launcher3.pm.PackageInstallInfo;
|
||||
import com.android.launcher3.pm.UserCache;
|
||||
import com.android.launcher3.shortcuts.ShortcutRequest;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.launcher3.util.IntSet;
|
||||
import com.android.launcher3.util.ItemInfoMatcher;
|
||||
import com.android.launcher3.util.PackageUserKey;
|
||||
@@ -310,11 +307,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi
|
||||
* @see UserCache#addUserEventListener
|
||||
*/
|
||||
public void onUserEvent(UserHandle user, String action) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.WORK_TAB_MISSING, "onBroadcastIntent intentAction: "
|
||||
+ action + " user: " + user);
|
||||
}
|
||||
|
||||
if (Intent.ACTION_MANAGED_PROFILE_AVAILABLE.equals(action)
|
||||
|| Intent.ACTION_MANAGED_PROFILE_UNAVAILABLE.equals(action)) {
|
||||
enqueueModelUpdateTask(new PackageUpdatedTask(
|
||||
@@ -562,7 +554,6 @@ public class LauncherModel extends LauncherApps.Callback implements InstallSessi
|
||||
synchronized (mLock) {
|
||||
// Everything loaded bind the data.
|
||||
mModelLoaded = true;
|
||||
testLogD(WORK_TAB_MISSING, "launcher model loaded");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_RV_PREIN
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_COUNT;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_TAP_ON_PERSONAL_TAB;
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_TAP_ON_WORK_TAB;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
|
||||
import static com.android.launcher3.util.ScrollableLayoutManager.PREDICTIVE_BACK_MIN_SCALE;
|
||||
|
||||
import android.animation.Animator;
|
||||
@@ -79,7 +78,6 @@ import com.android.launcher3.config.FeatureFlags;
|
||||
import com.android.launcher3.keyboard.FocusedItemDecorator;
|
||||
import com.android.launcher3.model.StringCache;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.launcher3.util.ItemInfoMatcher;
|
||||
import com.android.launcher3.util.Themes;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
@@ -209,10 +207,6 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
mNavBarScrimPaint.setColor(Themes.getNavBarScrimColor(mActivityContext));
|
||||
|
||||
AllAppsStore.OnUpdateListener onAppsUpdated = this::onAppsUpdated;
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(WORK_TAB_MISSING, "ActivityAllAppsContainer#init registeringListener: " +
|
||||
onAppsUpdated);
|
||||
}
|
||||
mAllAppsStore.addUpdateListener(onAppsUpdated);
|
||||
|
||||
// This is a focus listener that proxies focus from a view into the list view. This is to
|
||||
@@ -950,10 +944,6 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
|
||||
|
||||
private void onAppsUpdated() {
|
||||
mHasWorkApps = Stream.of(mAllAppsStore.getApps()).anyMatch(mWorkManager.getMatcher());
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(WORK_TAB_MISSING, "ActivityAllAppsContainerView#onAppsUpdated hasWorkApps: " +
|
||||
mHasWorkApps + " allApps: " + mAllAppsStore.getApps().length);
|
||||
}
|
||||
if (!isSearching()) {
|
||||
rebindAdapters();
|
||||
if (mHasWorkApps) {
|
||||
|
||||
@@ -19,11 +19,9 @@ import static com.android.launcher3.config.FeatureFlags.ENABLE_ALL_APPS_RV_PREIN
|
||||
import static com.android.launcher3.model.data.AppInfo.COMPONENT_KEY_COMPARATOR;
|
||||
import static com.android.launcher3.model.data.AppInfo.EMPTY_ARRAY;
|
||||
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_SHOW_DOWNLOAD_PROGRESS_MASK;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
@@ -35,7 +33,6 @@ import com.android.launcher3.BubbleTextView;
|
||||
import com.android.launcher3.model.data.AppInfo;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.recyclerview.AllAppsRecyclerViewPool;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.launcher3.util.ComponentKey;
|
||||
import com.android.launcher3.util.PackageUserKey;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
@@ -158,9 +155,6 @@ public class AllAppsStore<T extends Context & ActivityContext> {
|
||||
return;
|
||||
}
|
||||
for (OnUpdateListener listener : mUpdateListeners) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(WORK_TAB_MISSING, "AllAppsStore#notifyUpdate listener: " + listener);
|
||||
}
|
||||
listener.onAppsUpdated();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,6 @@ import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCH
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_HAS_SHORTCUT_PERMISSION;
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_QUIET_MODE_CHANGE_PERMISSION;
|
||||
import static com.android.launcher3.model.BgDataModel.Callbacks.FLAG_QUIET_MODE_ENABLED;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
|
||||
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
|
||||
|
||||
import android.os.Build;
|
||||
@@ -47,7 +46,6 @@ import com.android.launcher3.Utilities;
|
||||
import com.android.launcher3.allapps.BaseAllAppsAdapter.AdapterItem;
|
||||
import com.android.launcher3.logging.StatsLogManager;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
@@ -144,10 +142,6 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP
|
||||
}
|
||||
|
||||
private void updateCurrentState(@WorkProfileState int currentState) {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(WORK_TAB_MISSING, "WorkProfileManager#updateCurrentState: " +
|
||||
currentState, new Throwable());
|
||||
}
|
||||
mCurrentState = currentState;
|
||||
if (getAH() != null) {
|
||||
getAH().mAppsList.updateAdapterItems();
|
||||
@@ -166,10 +160,6 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP
|
||||
* Creates and attaches for profile toggle button to {@link ActivityAllAppsContainerView}
|
||||
*/
|
||||
public boolean attachWorkModeSwitch() {
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(WORK_TAB_MISSING, "ActivityAllAppsContainerView#attachWorkModeSwitch "
|
||||
+ "mWorkModeSwitch: " + mWorkModeSwitch);
|
||||
}
|
||||
if (!mAllApps.getAppsStore().hasModelFlag(
|
||||
FLAG_HAS_SHORTCUT_PERMISSION | FLAG_QUIET_MODE_CHANGE_PERMISSION)) {
|
||||
Log.e(TAG, "unable to attach work mode switch; Missing required permissions");
|
||||
|
||||
@@ -15,9 +15,6 @@
|
||||
*/
|
||||
package com.android.launcher3.model;
|
||||
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -33,7 +30,6 @@ import com.android.launcher3.model.BgDataModel.FixedContainerItems;
|
||||
import com.android.launcher3.model.data.AppInfo;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.launcher3.util.ComponentKey;
|
||||
import com.android.launcher3.util.PackageUserKey;
|
||||
import com.android.launcher3.widget.model.WidgetsListBaseEntry;
|
||||
@@ -77,7 +73,6 @@ public abstract class BaseModelUpdateTask implements ModelUpdateTask {
|
||||
@Override
|
||||
public final void run() {
|
||||
boolean isModelLoaded = Objects.requireNonNull(mModel).isModelLoaded();
|
||||
testLogD(WORK_TAB_MISSING, "modelLoaded: " + isModelLoaded + " forTask: " + this);
|
||||
if (!isModelLoaded) {
|
||||
if (DEBUG_TASKS) {
|
||||
Log.d(TAG, "Ignoring model task since loader is pending=" + this);
|
||||
@@ -115,10 +110,6 @@ public abstract class BaseModelUpdateTask implements ModelUpdateTask {
|
||||
List<WorkspaceItemInfo> workspaceUpdates = allUpdates.stream()
|
||||
.filter(info -> info.id != ItemInfo.NO_ID)
|
||||
.collect(Collectors.toList());
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(WORK_TAB_MISSING, "allUpdates: " + allUpdates.size() + ", workspaceUpdates "
|
||||
+ workspaceUpdates.size());
|
||||
}
|
||||
if (!workspaceUpdates.isEmpty()) {
|
||||
scheduleCallbackTask(c -> c.bindWorkspaceItemsChanged(workspaceUpdates));
|
||||
}
|
||||
@@ -157,12 +148,7 @@ public abstract class BaseModelUpdateTask implements ModelUpdateTask {
|
||||
}
|
||||
|
||||
public void bindApplicationsIfNeeded() {
|
||||
boolean changeFlag = mAllAppsList.getAndResetChangeFlag();
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(WORK_TAB_MISSING, "bindApplicationsIfNeeded changeFlag? " +
|
||||
changeFlag);
|
||||
}
|
||||
if (changeFlag) {
|
||||
if (mAllAppsList.getAndResetChangeFlag()) {
|
||||
AppInfo[] apps = mAllAppsList.copyData();
|
||||
int flags = mAllAppsList.getFlags();
|
||||
Map<PackageUserKey, Integer> packageUserKeytoUidMap = Arrays.stream(apps).collect(
|
||||
|
||||
@@ -24,8 +24,6 @@ import static com.android.launcher3.model.ModelUtils.filterCurrentWorkspaceItems
|
||||
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_DISABLED_LOCKED_USER;
|
||||
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_DISABLED_SAFEMODE;
|
||||
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_DISABLED_SUSPENDED;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
|
||||
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
|
||||
import static com.android.launcher3.util.PackageManagerHelper.hasShortcutsPermission;
|
||||
import static com.android.launcher3.util.PackageManagerHelper.isSystemApp;
|
||||
@@ -932,7 +930,6 @@ public class LoaderTask implements Runnable {
|
||||
}
|
||||
|
||||
private List<LauncherActivityInfo> loadAllApps() {
|
||||
testLogD(WORK_TAB_MISSING, "loadingAllApps");
|
||||
final List<UserHandle> profiles = mUserCache.getUserProfiles();
|
||||
List<LauncherActivityInfo> allActivityList = new ArrayList<>();
|
||||
// Clear the list of apps
|
||||
|
||||
@@ -93,11 +93,6 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
mOp = op;
|
||||
mUser = user;
|
||||
mPackages = packages;
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.WORK_TAB_MISSING, "PackageUpdatedTask mOp: " + mOp +
|
||||
" packageCount: " + mPackages.length + " user: " + user);
|
||||
DEBUG = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -142,9 +137,6 @@ public class PackageUpdatedTask extends BaseModelUpdateTask {
|
||||
// The update may have changed which shortcuts/widgets are available.
|
||||
// Refresh the widgets for the package if we have an activity running.
|
||||
Launcher launcher = Launcher.ACTIVITY_TRACKER.getCreatedActivity();
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(TestProtocol.WORK_TAB_MISSING, "launcher: " + launcher);
|
||||
}
|
||||
if (launcher != null) {
|
||||
launcher.refreshAndBindWidgetsForPackageUser(
|
||||
new PackageUserKey(packages[i], mUser));
|
||||
|
||||
@@ -16,12 +16,10 @@
|
||||
package com.android.launcher3.model;
|
||||
|
||||
import static com.android.launcher3.model.data.ItemInfoWithIcon.FLAG_DISABLED_LOCKED_USER;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.pm.ShortcutInfo;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
@@ -31,7 +29,6 @@ import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.shortcuts.ShortcutKey;
|
||||
import com.android.launcher3.shortcuts.ShortcutRequest;
|
||||
import com.android.launcher3.shortcuts.ShortcutRequest.QueryResult;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.launcher3.util.ComponentKey;
|
||||
import com.android.launcher3.util.ItemInfoMatcher;
|
||||
|
||||
@@ -63,10 +60,6 @@ public class UserLockStateChangedTask extends BaseModelUpdateTask {
|
||||
if (mIsUserUnlocked) {
|
||||
QueryResult shortcuts = new ShortcutRequest(context, mUser)
|
||||
.query(ShortcutRequest.PINNED);
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(WORK_TAB_MISSING, "shortcutQuery success? "
|
||||
+ shortcuts.wasSuccess());
|
||||
}
|
||||
if (shortcuts.wasSuccess()) {
|
||||
for (ShortcutInfo shortcut : shortcuts) {
|
||||
pinnedShortcuts.put(ShortcutKey.fromInfo(shortcut), shortcut);
|
||||
@@ -89,9 +82,6 @@ public class UserLockStateChangedTask extends BaseModelUpdateTask {
|
||||
if (mIsUserUnlocked) {
|
||||
ShortcutKey key = ShortcutKey.fromItemInfo(si);
|
||||
ShortcutInfo shortcut = pinnedShortcuts.get(key);
|
||||
if (TestProtocol.sDebugTracing) {
|
||||
Log.d(WORK_TAB_MISSING, "shortcutInfo: " + shortcut);
|
||||
}
|
||||
// We couldn't verify the shortcut during loader. If its no longer available
|
||||
// (probably due to clear data), delete the workspace item as well
|
||||
if (shortcut == null) {
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package com.android.launcher3.pm;
|
||||
|
||||
import static com.android.launcher3.Utilities.ATLEAST_U;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.testLogD;
|
||||
import static com.android.launcher3.util.Executors.MODEL_EXECUTOR;
|
||||
|
||||
import android.content.Context;
|
||||
@@ -94,8 +92,6 @@ public class UserCache implements SafeCloseable {
|
||||
|
||||
@AnyThread
|
||||
private void onUsersChanged(Intent intent) {
|
||||
testLogD(WORK_TAB_MISSING, "onUsersChanged intent: " + intent);
|
||||
|
||||
MODEL_EXECUTOR.execute(this::updateCache);
|
||||
UserHandle user = intent.getParcelableExtra(Intent.EXTRA_USER);
|
||||
if (user == null) {
|
||||
|
||||
@@ -154,7 +154,6 @@ public final class TestProtocol {
|
||||
public static final String REQUEST_MOCK_SENSOR_ROTATION = "mock-sensor-rotation";
|
||||
|
||||
public static final String PERMANENT_DIAG_TAG = "TaplTarget";
|
||||
public static final String WORK_TAB_MISSING = "b/243688989";
|
||||
public static final String TWO_TASKBAR_LONG_CLICKS = "b/262282528";
|
||||
public static final String FLAKY_ACTIVITY_COUNT = "b/260260325";
|
||||
public static final String ICON_MISSING = "b/282963545";
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.launcher3.ui;
|
||||
import static com.android.launcher3.LauncherState.ALL_APPS;
|
||||
import static com.android.launcher3.LauncherState.NORMAL;
|
||||
import static com.android.launcher3.allapps.AllAppsStore.DEFER_UPDATES_TEST;
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.WORK_TAB_MISSING;
|
||||
import static com.android.launcher3.util.TestUtil.installDummyAppForUser;
|
||||
import static com.android.launcher3.util.rule.TestStabilityRule.LOCAL;
|
||||
import static com.android.launcher3.util.rule.TestStabilityRule.PLATFORM_POSTSUBMIT;
|
||||
@@ -39,7 +38,6 @@ import com.android.launcher3.allapps.WorkEduCard;
|
||||
import com.android.launcher3.allapps.WorkPausedCard;
|
||||
import com.android.launcher3.allapps.WorkProfileManager;
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation;
|
||||
import com.android.launcher3.testing.shared.TestProtocol;
|
||||
import com.android.launcher3.util.TestUtil;
|
||||
import com.android.launcher3.util.rule.TestStabilityRule.Stability;
|
||||
|
||||
@@ -78,8 +76,6 @@ public class WorkProfileTest extends AbstractLauncherUiTest {
|
||||
installDummyAppForUser(mProfileUserId);
|
||||
updateWorkProfileSetupSuccessful("am start-user", output);
|
||||
|
||||
Log.d(WORK_TAB_MISSING, "workProfileSuccessful? " + mWorkProfileSetupSuccessful +
|
||||
" shellCmd: " + logStr);
|
||||
if (!mWorkProfileSetupSuccessful) {
|
||||
return; // no need to setup launcher since all tests will skip.
|
||||
}
|
||||
@@ -96,7 +92,6 @@ public class WorkProfileTest extends AbstractLauncherUiTest {
|
||||
|
||||
@After
|
||||
public void removeWorkProfile() throws Exception {
|
||||
Log.d(TestProtocol.WORK_TAB_MISSING, "WorkProfileTest teardown");
|
||||
executeOnLauncher(launcher -> {
|
||||
if (launcher == null || launcher.getAppsView() == null) {
|
||||
return;
|
||||
@@ -112,7 +107,6 @@ public class WorkProfileTest extends AbstractLauncherUiTest {
|
||||
mLauncher.getAllApps();
|
||||
waitForLauncherCondition("Work tab not setup", launcher -> {
|
||||
if (launcher.getAppsView().getContentView() instanceof AllAppsPagedView) {
|
||||
Log.d(WORK_TAB_MISSING, "Deferring AppsStore updates");
|
||||
launcher.getAppsView().getAppsStore().enableDeferUpdates(DEFER_UPDATES_TEST);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user