Loading src/com/android/launcher3/allapps/WorkModeSwitch.java +4 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.launcher3.allapps; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TURN_OFF_WORK_APPS_TAP; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import android.content.Context; Loading @@ -31,6 +32,7 @@ import android.widget.Button; import androidx.annotation.RequiresApi; import com.android.launcher3.Insettable; import com.android.launcher3.Launcher; import com.android.launcher3.Utilities; import com.android.launcher3.pm.UserCache; Loading Loading @@ -92,6 +94,8 @@ public class WorkModeSwitch extends Button implements Insettable, View.OnClickLi public void onClick(View view) { if (Utilities.ATLEAST_P) { setEnabled(false); Launcher.fromContext(getContext()).getStatsLogManager().logger().log( LAUNCHER_TURN_OFF_WORK_APPS_TAP); UI_HELPER_EXECUTOR.post(() -> setWorkProfileEnabled(getContext(), false)); } } Loading src/com/android/launcher3/allapps/WorkPausedCard.java +2 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ 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; Loading Loading @@ -61,6 +62,7 @@ public class WorkPausedCard extends LinearLayout implements View.OnClickListener public void onClick(View view) { if (Utilities.ATLEAST_P) { setEnabled(false); mLauncher.getStatsLogManager().logger().log(LAUNCHER_TURN_ON_WORK_APPS_TAP); UI_HELPER_EXECUTOR.post(() -> WorkModeSwitch.setWorkProfileEnabled(getContext(), true)); } } Loading src/com/android/launcher3/logging/StatsLogManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -479,7 +479,13 @@ public class StatsLogManager implements ResourceBasedOverride { LAUNCHER_THEMED_ICON_ENABLED(836), @UiEvent(doc = "User disabled themed icons option in wallpaper & style settings.") LAUNCHER_THEMED_ICON_DISABLED(837) LAUNCHER_THEMED_ICON_DISABLED(837), @UiEvent(doc = "User tapped on 'Turn on work apps' button in all apps window.") LAUNCHER_TURN_ON_WORK_APPS_TAP(838), @UiEvent(doc = "User tapped on 'Turn off work apps' button in all apps window.") LAUNCHER_TURN_OFF_WORK_APPS_TAP(839) ; // ADD MORE Loading Loading
src/com/android/launcher3/allapps/WorkModeSwitch.java +4 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ package com.android.launcher3.allapps; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_TURN_OFF_WORK_APPS_TAP; import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR; import android.content.Context; Loading @@ -31,6 +32,7 @@ import android.widget.Button; import androidx.annotation.RequiresApi; import com.android.launcher3.Insettable; import com.android.launcher3.Launcher; import com.android.launcher3.Utilities; import com.android.launcher3.pm.UserCache; Loading Loading @@ -92,6 +94,8 @@ public class WorkModeSwitch extends Button implements Insettable, View.OnClickLi public void onClick(View view) { if (Utilities.ATLEAST_P) { setEnabled(false); Launcher.fromContext(getContext()).getStatsLogManager().logger().log( LAUNCHER_TURN_OFF_WORK_APPS_TAP); UI_HELPER_EXECUTOR.post(() -> setWorkProfileEnabled(getContext(), false)); } } Loading
src/com/android/launcher3/allapps/WorkPausedCard.java +2 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ */ 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; Loading Loading @@ -61,6 +62,7 @@ public class WorkPausedCard extends LinearLayout implements View.OnClickListener public void onClick(View view) { if (Utilities.ATLEAST_P) { setEnabled(false); mLauncher.getStatsLogManager().logger().log(LAUNCHER_TURN_ON_WORK_APPS_TAP); UI_HELPER_EXECUTOR.post(() -> WorkModeSwitch.setWorkProfileEnabled(getContext(), true)); } } Loading
src/com/android/launcher3/logging/StatsLogManager.java +7 −1 Original line number Diff line number Diff line Loading @@ -479,7 +479,13 @@ public class StatsLogManager implements ResourceBasedOverride { LAUNCHER_THEMED_ICON_ENABLED(836), @UiEvent(doc = "User disabled themed icons option in wallpaper & style settings.") LAUNCHER_THEMED_ICON_DISABLED(837) LAUNCHER_THEMED_ICON_DISABLED(837), @UiEvent(doc = "User tapped on 'Turn on work apps' button in all apps window.") LAUNCHER_TURN_ON_WORK_APPS_TAP(838), @UiEvent(doc = "User tapped on 'Turn off work apps' button in all apps window.") LAUNCHER_TURN_OFF_WORK_APPS_TAP(839) ; // ADD MORE Loading