Snap for 9463735 from 2f4a1b9980 to tm-qpr2-release

Change-Id: I32fcee8829d0fe318ba737c2b0cda203682ffc97
This commit is contained in:
Android Build Coastguard Worker committed 2023-01-07 02:25:18 +00:00
commit df7830bb52
9 files changed
+75 -30

No files matched your search

+1 -1
View File
@@ -78,7 +78,7 @@
<string name="allset_title" msgid="5021126669778966707">"Fertig!"</string>
<string name="allset_hint" msgid="2384632994739392447">"Nach oben wischen, um den Startbildschirm aufzurufen"</string>
<string name="allset_button_hint" msgid="2395219947744706291">"Startbildschirmtaste drücken, um zum Startbildschirm zu gehen"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"Du kannst dein Gerät (<xliff:g id="DEVICE">%1$s</xliff:g>) jetzt verwenden"</string>
<string name="allset_description_generic" msgid="5385500062202019855">"Du kannst dein <xliff:g id="DEVICE">%1$s</xliff:g> jetzt verwenden"</string>
<string name="default_device_name" msgid="6660656727127422487">"Gerät"</string>
<string name="allset_navigation_settings" msgid="4713404605961476027"><annotation id="link">"Einstellungen der Systemsteuerung"</annotation></string>
<string name="action_share" msgid="2648470652637092375">"Teilen"</string>
@@ -324,6 +324,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
// May be set to false when mIsTransientTaskbar is true.
private boolean mCanSlowSwipeGoHome = true;
@Nullable
private RemoteAnimationTargets.ReleaseCheck mSwipePipToHomeReleaseCheck = null;
public AbsSwipeUpHandler(Context context, RecentsAnimationDeviceState deviceState,
TaskAnimationManager taskAnimationManager, GestureState gestureState,
long touchTimeMs, boolean continuingLastGesture,
@@ -869,6 +872,9 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
mRemoteTargetHandles = mTargetGluer.assignTargetsForSplitScreen(mContext, targets);
mRecentsAnimationController = controller;
mRecentsAnimationTargets = targets;
mSwipePipToHomeReleaseCheck = new RemoteAnimationTargets.ReleaseCheck();
mSwipePipToHomeReleaseCheck.setCanRelease(true);
mRecentsAnimationTargets.addReleaseCheck(mSwipePipToHomeReleaseCheck);
// Only initialize the device profile, if it has not been initialized before, as in some
// configurations targets.homeContentInsets may not be correct.
@@ -1430,9 +1436,16 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
mSwipePipToHomeAnimator = createWindowAnimationToPip(
homeAnimFactory, runningTaskTarget, start);
mSwipePipToHomeAnimators[0] = mSwipePipToHomeAnimator;
if (mSwipePipToHomeReleaseCheck != null) {
mSwipePipToHomeReleaseCheck.setCanRelease(false);
}
windowAnim = mSwipePipToHomeAnimators;
} else {
mSwipePipToHomeAnimator = null;
if (mSwipePipToHomeReleaseCheck != null) {
mSwipePipToHomeReleaseCheck.setCanRelease(true);
mSwipePipToHomeReleaseCheck = null;
}
windowAnim = createWindowAnimationToHome(start, homeAnimFactory);
windowAnim[0].addAnimatorListener(new AnimationSuccessListener() {
@@ -1954,6 +1967,10 @@ public abstract class AbsSwipeUpHandler<T extends StatefulActivity<S>,
finishRecentsControllerToHome(
() -> mStateCallback.setStateOnUiThread(STATE_CURRENT_TASK_FINISHED));
}
if (mSwipePipToHomeReleaseCheck != null) {
mSwipePipToHomeReleaseCheck.setCanRelease(true);
mSwipePipToHomeReleaseCheck = null;
}
doLogGesture(HOME, mRecentsView == null ? null : mRecentsView.getCurrentPageTaskView());
}
@@ -262,6 +262,19 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
return launchedAppState;
}
private void quickSwitchToPreviousAppAndAssert(boolean toRight) {
final LaunchedAppState launchedAppState = getAndAssertLaunchedApp();
if (toRight) {
launchedAppState.quickSwitchToPreviousApp();
} else {
launchedAppState.quickSwitchToPreviousAppSwipeLeft();
}
// While enable shell transition, Launcher can be resumed due to transient launch.
waitForLauncherCondition("Launcher shouldn't stay in resume forever",
this::isInLaunchedApp, 3000 /* timeout */);
}
@Test
@PortraitLandscape
public void testAllAppsFromHome() throws Exception {
@@ -288,13 +301,11 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
startTestActivity(3);
startTestActivity(4);
LaunchedAppState launchedAppState = getAndAssertLaunchedApp();
launchedAppState.quickSwitchToPreviousApp();
quickSwitchToPreviousAppAndAssert(true /* toRight */);
assertTrue("The first app we should have quick switched to is not running",
isTestActivityRunning(3));
launchedAppState = getAndAssertLaunchedApp();
launchedAppState.quickSwitchToPreviousApp();
quickSwitchToPreviousAppAndAssert(true /* toRight */);
if (mLauncher.getNavigationModel() == NavigationModel.THREE_BUTTON) {
// 3-button mode toggles between 2 apps, rather than going back further.
assertTrue("Second quick switch should have returned to the first app.",
@@ -303,12 +314,12 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
assertTrue("The second app we should have quick switched to is not running",
isTestActivityRunning(2));
}
launchedAppState = getAndAssertLaunchedApp();
launchedAppState.quickSwitchToPreviousAppSwipeLeft();
quickSwitchToPreviousAppAndAssert(false /* toRight */);
assertTrue("The 2nd app we should have quick switched to is not running",
isTestActivityRunning(3));
launchedAppState = getAndAssertLaunchedApp();
final LaunchedAppState launchedAppState = getAndAssertLaunchedApp();
launchedAppState.switchToOverview();
}
@@ -327,8 +338,10 @@ public class TaplTestsQuickstep extends AbstractQuickStepTest {
launchedAppState.assertTaskbarHidden();
// Quick-switch to the test app with swiping to right.
launchedAppState.quickSwitchToPreviousApp();
quickSwitchToPreviousAppAndAssert(true /* toRight */);
assertTrue("The first app we should have quick switched to is not running",
isTestActivityRunning(2));
// Expect task bar visible when the launched app was the test activity.
launchedAppState = getAndAssertLaunchedApp();
launchedAppState.assertTaskbarVisible();
@@ -239,23 +239,24 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
mAdapterItems.addAll(mSearchResults);
} else {
int position = 0;
boolean addApps = true;
if (mWorkProviderManager != null) {
position += mWorkProviderManager.addWorkItems(mAdapterItems);
if (!mWorkProviderManager.shouldShowWorkApps()) {
return;
}
addApps = mWorkProviderManager.shouldShowWorkApps();
}
String lastSectionName = null;
for (AppInfo info : mApps) {
mAdapterItems.add(AdapterItem.asApp(info));
if (addApps) {
String lastSectionName = null;
for (AppInfo info : mApps) {
mAdapterItems.add(AdapterItem.asApp(info));
String sectionName = info.sectionName;
// Create a new section if the section names do not match
if (!sectionName.equals(lastSectionName)) {
lastSectionName = sectionName;
mFastScrollerSections.add(new FastScrollSectionInfo(sectionName, position));
String sectionName = info.sectionName;
// Create a new section if the section names do not match
if (!sectionName.equals(lastSectionName)) {
lastSectionName = sectionName;
mFastScrollerSections.add(new FastScrollSectionInfo(sectionName, position));
}
position++;
}
position++;
}
}
mAccessibilityResultsCount = (int) mAdapterItems.stream()
@@ -163,7 +163,8 @@ public abstract class BaseAllAppsContainerView<T extends Context & ActivityConte
mWorkManager = new WorkProfileManager(
mActivityContext.getSystemService(UserManager.class),
this, LauncherPrefs.getPrefs(mActivityContext));
this, LauncherPrefs.getPrefs(mActivityContext),
mActivityContext.getStatsLogManager());
mAH = Arrays.asList(null, null, null);
mNavBarScrimPaint = new Paint();
mNavBarScrimPaint.setColor(Themes.getAttrColor(context, R.attr.allAppsNavBarScrimColor));
@@ -15,6 +15,8 @@
*/
package com.android.launcher3.allapps;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORK_FAB_BUTTON_COLLAPSE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_WORK_FAB_BUTTON_EXTEND;
import static com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip.getTabWidth;
import android.animation.LayoutTransition;
@@ -37,6 +39,7 @@ import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.KeyboardInsetAnimationCallback;
import com.android.launcher3.config.FeatureFlags;
import com.android.launcher3.logging.StatsLogManager;
import com.android.launcher3.model.StringCache;
import com.android.launcher3.views.ActivityContext;
/**
@@ -59,6 +62,8 @@ public class WorkModeSwitch extends LinearLayout implements Insettable,
private final int mScrollThreshold;
private ImageView mIcon;
private TextView mTextView;
private final StatsLogManager mStatsLogManager;
public WorkModeSwitch(@NonNull Context context) {
this(context, null, 0);
@@ -72,6 +77,7 @@ public class WorkModeSwitch extends LinearLayout implements Insettable,
super(context, attrs, defStyleAttr);
mScrollThreshold = Utilities.dpToPx(SCROLL_THRESHOLD_DP);
mActivityContext = ActivityContext.lookupContext(getContext());
mStatsLogManager = mActivityContext.getStatsLogManager();
}
@Override
@@ -197,10 +203,12 @@ public class WorkModeSwitch extends LinearLayout implements Insettable,
public void extend() {
mTextView.setVisibility(VISIBLE);
mStatsLogManager.logger().log(LAUNCHER_WORK_FAB_BUTTON_EXTEND);
}
public void shrink(){
mTextView.setVisibility(GONE);
mStatsLogManager.logger().log(LAUNCHER_WORK_FAB_BUTTON_COLLAPSE);
}
public int getScrollThreshold() {
@@ -43,8 +43,8 @@ import androidx.recyclerview.widget.RecyclerView;
import com.android.launcher3.R;
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.views.ActivityContext;
import com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip;
import java.lang.annotation.Retention;
@@ -80,6 +80,7 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP
private final UserManager mUserManager;
private final BaseAllAppsContainerView<?> mAllApps;
private final Predicate<ItemInfo> mMatcher;
private final StatsLogManager mStatsLogManager;
private WorkModeSwitch mWorkModeSwitch;
@@ -88,11 +89,13 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP
private SharedPreferences mPreferences;
public WorkProfileManager(
UserManager userManager, BaseAllAppsContainerView<?> allApps, SharedPreferences prefs) {
UserManager userManager, BaseAllAppsContainerView<?> allApps, SharedPreferences prefs,
StatsLogManager statsLogManager) {
mUserManager = userManager;
mAllApps = allApps;
mPreferences = prefs;
mMatcher = mAllApps.mPersonalMatcher.negate();
mStatsLogManager = statsLogManager;
}
/**
@@ -227,9 +230,7 @@ public class WorkProfileManager implements PersonalWorkSlidingTabStrip.OnActiveP
private void onWorkFabClicked(View view) {
if (Utilities.ATLEAST_P && mCurrentState == STATE_ENABLED && mWorkModeSwitch.isEnabled()) {
ActivityContext activityContext = ActivityContext.lookupContext(
mWorkModeSwitch.getContext());
activityContext.getStatsLogManager().logger().log(LAUNCHER_TURN_OFF_WORK_APPS_TAP);
mStatsLogManager.logger().log(LAUNCHER_TURN_OFF_WORK_APPS_TAP);
setWorkProfileEnabled(false);
}
}
@@ -624,7 +624,13 @@ public class StatsLogManager implements ResourceBasedOverride {
LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_RIGHT_BOTTOM(1232),
@UiEvent(doc = "User has invoked split to left half with a keyboard shortcut.")
LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_LEFT_TOP(1233)
LAUNCHER_KEYBOARD_SHORTCUT_SPLIT_LEFT_TOP(1233),
@UiEvent(doc = "User has collapsed the work FAB button by swiping down")
LAUNCHER_WORK_FAB_BUTTON_COLLAPSE(1276),
@UiEvent(doc = "User has collapsed the work FAB button by swiping up")
LAUNCHER_WORK_FAB_BUTTON_EXTEND(1277),
;
// ADD MORE
@@ -37,7 +37,6 @@ import com.android.launcher3.util.rule.ShellCommandRule;
import com.android.launcher3.widget.LauncherAppWidgetProviderInfo;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -65,7 +64,6 @@ public class AddConfigWidgetTest extends AbstractLauncherUiTest {
mAppWidgetManager = AppWidgetManager.getInstance(mTargetContext);
}
@Ignore
@Test
@PortraitLandscape
public void testWidgetConfig() throws Throwable {