[Refactor] Extract work profile related logic from AllAppsContainerView to WorkProfileManager

Bug: 195623679
Test: presubmit
Change-Id: I9954fb40034d1804aaf19f0778f95477e48ccc8f
This commit is contained in:
y
2021-08-31 20:24:33 -07:00
committed by sfufa@google.com
parent 7f693253c8
commit eb52419282
7 changed files with 313 additions and 147 deletions

View File

@@ -16,7 +16,6 @@
package com.android.launcher3.allapps;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TURN_ON_WORK_APPS_TAP;
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
import android.content.Context;
import android.content.res.Configuration;
@@ -62,8 +61,8 @@ public class WorkPausedCard extends LinearLayout implements View.OnClickListener
public void onClick(View view) {
if (Utilities.ATLEAST_P) {
setEnabled(false);
mLauncher.getAppsView().getWorkManager().setWorkProfileEnabled(true);
mLauncher.getStatsLogManager().logger().log(LAUNCHER_TURN_ON_WORK_APPS_TAP);
UI_HELPER_EXECUTOR.post(() -> WorkModeSwitch.setWorkProfileEnabled(getContext(), true));
}
}