[11/n] Letterbox Education: set LAUNCHER_TASKBAR_EDUCATION_SHOWING.

The setting is set to 1 if the taskbar education should be shown as soon as the animation for opening an app starts and is set back to 0 when the taskbar education window is detached from the window.

Bug: 214590804
Test: N/A
Change-Id: Id26e3051a6e0ef1f9c2dcbeef98710efbb4df54f
This commit is contained in:
tomnatan
2022-01-25 10:09:44 +00:00
committed by Tom Natan
parent adfdfd8868
commit 9f12373bdd
3 changed files with 33 additions and 3 deletions

View File

@@ -16,6 +16,7 @@
package com.android.launcher3;
import static android.provider.Settings.Secure.LAUNCHER_TASKBAR_EDUCATION_SHOWING;
import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_NONE;
import static android.window.StartingWindowInfo.STARTING_WINDOW_TYPE_SPLASH_SCREEN;
@@ -75,6 +76,7 @@ import android.os.IBinder;
import android.os.Looper;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.provider.Settings;
import android.util.Pair;
import android.util.Size;
import android.view.SurfaceControl;
@@ -682,6 +684,18 @@ public class QuickstepTransitionManager implements OnDeviceProfileChangeListener
appAnimator.setInterpolator(LINEAR);
appAnimator.addListener(floatingView);
appAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
LauncherTaskbarUIController taskbarController = mLauncher.getTaskbarUIController();
if (taskbarController != null && taskbarController.shouldShowEdu()) {
// LAUNCHER_TASKBAR_EDUCATION_SHOWING is set to true here, when the education
// flow is about to start, to avoid a race condition with other components
// that would show something else to the user as soon as the app is opened.
Settings.Secure.putInt(mLauncher.getContentResolver(),
LAUNCHER_TASKBAR_EDUCATION_SHOWING, 1);
}
}
@Override
public void onAnimationEnd(Animator animation) {
if (v instanceof BubbleTextView) {