Snap for 11260009 from ff03dd19c7 to 24Q2-release
Change-Id: I73b072df5ba10b3411cd7550eb6e1d013ce064b9
This commit is contained in:
@@ -114,7 +114,7 @@
|
||||
<string name="taskbar_edu_close" msgid="887022990168191073">"关闭"</string>
|
||||
<string name="taskbar_edu_done" msgid="6880178093977704569">"完成"</string>
|
||||
<string name="taskbar_button_home" msgid="2151398979630664652">"主屏幕"</string>
|
||||
<string name="taskbar_button_a11y" msgid="5241161324875094465">"无障碍"</string>
|
||||
<string name="taskbar_button_a11y" msgid="5241161324875094465">"无障碍功能"</string>
|
||||
<string name="taskbar_button_back" msgid="8558862226461164514">"返回"</string>
|
||||
<string name="taskbar_button_ime_switcher" msgid="1730244360907588541">"IME 切换器"</string>
|
||||
<string name="taskbar_button_recents" msgid="7273376136216613134">"最近用过"</string>
|
||||
|
||||
@@ -25,6 +25,9 @@ import static com.android.launcher3.BaseActivity.EVENT_DESTROYED;
|
||||
import static com.android.launcher3.LauncherState.OVERVIEW;
|
||||
import static com.android.launcher3.config.FeatureFlags.ENABLE_TASKBAR_NAVBAR_UNIFICATION;
|
||||
import static com.android.launcher3.config.FeatureFlags.enableTaskbarNoRecreate;
|
||||
import static com.android.launcher3.util.DisplayController.CHANGE_DENSITY;
|
||||
import static com.android.launcher3.util.DisplayController.CHANGE_NAVIGATION_MODE;
|
||||
import static com.android.launcher3.util.DisplayController.CHANGE_TASKBAR_PINNING;
|
||||
import static com.android.launcher3.util.DisplayController.TASKBAR_NOT_DESTROYED_TAG;
|
||||
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
|
||||
import static com.android.launcher3.util.FlagDebugUtils.formatFlagChange;
|
||||
@@ -55,7 +58,6 @@ import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.InvariantDeviceProfile.OnIDPChangeListener;
|
||||
import com.android.launcher3.LauncherAppState;
|
||||
import com.android.launcher3.anim.AnimatorPlaybackController;
|
||||
import com.android.launcher3.statemanager.StatefulActivity;
|
||||
@@ -134,7 +136,17 @@ public class TaskbarManager {
|
||||
* We use WindowManager's ComponentCallbacks() for internal UI changes (similar to an Activity)
|
||||
* which comes via a different channel
|
||||
*/
|
||||
private final OnIDPChangeListener mIdpChangeListener = c -> recreateTaskbar();
|
||||
private final RecreationListener mRecreationListener = new RecreationListener();
|
||||
|
||||
private class RecreationListener implements DisplayController.DisplayInfoChangeListener {
|
||||
@Override
|
||||
public void onDisplayInfoChanged(Context context, DisplayController.Info info, int flags) {
|
||||
if ((flags & (CHANGE_DENSITY | CHANGE_NAVIGATION_MODE
|
||||
| CHANGE_TASKBAR_PINNING)) != 0) {
|
||||
recreateTaskbar();
|
||||
}
|
||||
}
|
||||
}
|
||||
private final SettingsCache.OnChangeListener mOnSettingsChangeListener = c -> recreateTaskbar();
|
||||
|
||||
private boolean mUserUnlocked = false;
|
||||
@@ -355,7 +367,7 @@ public class TaskbarManager {
|
||||
*/
|
||||
public void onUserUnlocked() {
|
||||
mUserUnlocked = true;
|
||||
LauncherAppState.getIDP(mContext).addOnChangeListener(mIdpChangeListener);
|
||||
DisplayController.INSTANCE.get(mContext).addChangeListener(mRecreationListener);
|
||||
recreateTaskbar();
|
||||
addTaskbarRootViewToWindow();
|
||||
}
|
||||
@@ -553,7 +565,7 @@ public class TaskbarManager {
|
||||
() -> mTaskbarBroadcastReceiver.unregisterReceiverSafely(mContext));
|
||||
destroyExistingTaskbar();
|
||||
if (mUserUnlocked) {
|
||||
LauncherAppState.getIDP(mContext).removeOnChangeListener(mIdpChangeListener);
|
||||
DisplayController.INSTANCE.get(mContext).removeChangeListener(mRecreationListener);
|
||||
}
|
||||
SettingsCache.INSTANCE.get(mContext)
|
||||
.unregister(USER_SETUP_COMPLETE_URI, mOnSettingsChangeListener);
|
||||
|
||||
@@ -16,8 +16,6 @@
|
||||
|
||||
package com.android.launcher3.tapl;
|
||||
|
||||
import static android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
|
||||
|
||||
import static com.android.launcher3.testing.shared.TestProtocol.SPRING_LOADED_STATE_ORDINAL;
|
||||
|
||||
import android.graphics.Point;
|
||||
@@ -64,13 +62,7 @@ public abstract class Launchable {
|
||||
+ mObject.getVisibleCenter() + " in "
|
||||
+ mLauncher.getVisibleBounds(mObject));
|
||||
|
||||
if (launcherStopsAfterLaunch()) {
|
||||
mLauncher.executeAndWaitForLauncherStop(
|
||||
() -> mLauncher.clickLauncherObject(mObject),
|
||||
"clicking the launchable");
|
||||
} else {
|
||||
mLauncher.clickLauncherObject(mObject);
|
||||
}
|
||||
performClick();
|
||||
|
||||
try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("clicked")) {
|
||||
expectActivityStartEvents();
|
||||
@@ -80,6 +72,16 @@ public abstract class Launchable {
|
||||
}
|
||||
}
|
||||
|
||||
private void performClick() {
|
||||
if (launcherStopsAfterLaunch()) {
|
||||
mLauncher.executeAndWaitForLauncherStop(
|
||||
() -> mLauncher.clickLauncherObject(mObject),
|
||||
"clicking the launchable");
|
||||
} else {
|
||||
mLauncher.clickLauncherObject(mObject);
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void expectActivityStartEvents();
|
||||
|
||||
protected abstract String launchableType();
|
||||
@@ -97,12 +99,8 @@ public abstract class Launchable {
|
||||
LauncherInstrumentation.log("Launchable.launch before click "
|
||||
+ mObject.getVisibleCenter() + " in " + mLauncher.getVisibleBounds(
|
||||
mObject));
|
||||
mLauncher.executeAndWaitForLauncherEvent(
|
||||
() -> mLauncher.clickLauncherObject(mObject),
|
||||
accessibilityEvent ->
|
||||
accessibilityEvent.getEventType() == TYPE_WINDOW_STATE_CHANGED,
|
||||
() -> "Unable to click object to launch split",
|
||||
"Click launcher object to launch split");
|
||||
|
||||
performClick();
|
||||
|
||||
try (LauncherInstrumentation.Closable c2 = mLauncher.addContextLayer("clicked")) {
|
||||
mLauncher.expectEvent(TestProtocol.SEQUENCE_MAIN, OverviewTask.SPLIT_START_EVENT);
|
||||
|
||||
Reference in New Issue
Block a user