Snap for 7878308 from 07fd21b8c3 to tm-release
Change-Id: I943113f9576587fc07dc782ca3389777594ba946
This commit is contained in:
@@ -234,6 +234,14 @@ public class NavbarButtonsViewController {
|
||||
mPropertyHolders.forEach(StatePropertyHolder::endAnimation);
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
mPropertyHolders.clear();
|
||||
mControllers.rotationButtonController.unregisterListeners();
|
||||
if (mFloatingRotationButton != null) {
|
||||
mFloatingRotationButton.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private void initButtons(ViewGroup navContainer, ViewGroup endContainer,
|
||||
TaskbarNavButtonController navButtonController) {
|
||||
|
||||
@@ -430,14 +438,6 @@ public class NavbarButtonsViewController {
|
||||
return mFloatingRotationButtonBounds.contains((int) ev.getX(), (int) ev.getY());
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
mPropertyHolders.clear();
|
||||
mControllers.rotationButtonController.unregisterListeners();
|
||||
if (mFloatingRotationButton != null) {
|
||||
mFloatingRotationButton.hide();
|
||||
}
|
||||
}
|
||||
|
||||
private class RotationButtonListener implements RotationButton.RotationButtonUpdatesCallback {
|
||||
@Override
|
||||
public void onVisibilityChanged(boolean isVisible) {
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
package com.android.quickstep;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -33,8 +32,6 @@ import com.android.systemui.shared.system.RemoteAnimationTargetCompat;
|
||||
* {@link TaskViewSimulator}
|
||||
*/
|
||||
public class RemoteTargetGluer {
|
||||
private static final String TAG = "RemoteTargetGluer";
|
||||
|
||||
private RemoteTargetHandle[] mRemoteTargetHandles;
|
||||
private SplitConfigurationOptions.StagedSplitBounds mStagedSplitBounds;
|
||||
|
||||
@@ -94,25 +91,18 @@ public class RemoteTargetGluer {
|
||||
public RemoteTargetHandle[] assignTargetsForSplitScreen(RemoteAnimationTargets targets) {
|
||||
int[] splitIds = LauncherSplitScreenListener.INSTANCE.getNoCreate()
|
||||
.getRunningSplitTaskIds();
|
||||
Log.d(TAG, "splitIds length: " + splitIds.length
|
||||
+ " targetAppsLength: " + targets.apps.length
|
||||
+ " remoteHandlesLength: " + mRemoteTargetHandles.length);
|
||||
if (splitIds.length == 0 && mRemoteTargetHandles.length > 1) {
|
||||
// There's a chance that between the creation of this class and assigning targets,
|
||||
// LauncherSplitScreenListener may have received callback that removes split
|
||||
mRemoteTargetHandles = new RemoteTargetHandle[]{mRemoteTargetHandles[0]};
|
||||
Log.w(TAG, "splitTaskIds changed between creation and assignment");
|
||||
}
|
||||
|
||||
RemoteAnimationTargetCompat primaryTaskTarget;
|
||||
RemoteAnimationTargetCompat secondaryTaskTarget;
|
||||
if (mRemoteTargetHandles.length == 1) {
|
||||
// If we're not in split screen, the splitIds count doesn't really matter since we
|
||||
// should always hit this case. Right now there's no use case for multiple app targets
|
||||
// without being in split screen
|
||||
primaryTaskTarget = targets.apps[0];
|
||||
// should always hit this case.
|
||||
mRemoteTargetHandles[0].mTransformParams.setTargetSet(targets);
|
||||
mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(primaryTaskTarget, null);
|
||||
if (targets.apps.length > 0) {
|
||||
// Unclear why/when target.apps length == 0, but it sure does happen :(
|
||||
primaryTaskTarget = targets.apps[0];
|
||||
mRemoteTargetHandles[0].mTaskViewSimulator.setPreview(primaryTaskTarget, null);
|
||||
}
|
||||
} else {
|
||||
// split screen
|
||||
primaryTaskTarget = targets.findTask(splitIds[0]);
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package com.android.quickstep.views;
|
||||
|
||||
import static com.android.quickstep.SysUINavigationMode.Mode.THREE_BUTTONS;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.Configuration;
|
||||
import android.graphics.Rect;
|
||||
@@ -30,6 +32,7 @@ import androidx.annotation.Nullable;
|
||||
import com.android.launcher3.DeviceProfile;
|
||||
import com.android.launcher3.Insettable;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.uioverrides.ApiWrapper;
|
||||
import com.android.launcher3.util.MultiValueAlpha;
|
||||
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
|
||||
import com.android.quickstep.SysUINavigationMode;
|
||||
@@ -146,7 +149,7 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
|
||||
public void setInsets(Rect insets) {
|
||||
mInsets.set(insets);
|
||||
updateVerticalMargin(SysUINavigationMode.getMode(getContext()));
|
||||
updateHorizontalPadding();
|
||||
updatePaddingAndTranslations();
|
||||
}
|
||||
|
||||
public void updateHiddenFlags(@ActionsHiddenFlags int visibilityFlags, boolean enable) {
|
||||
@@ -189,8 +192,37 @@ public class OverviewActionsView<T extends OverlayUICallbacks> extends FrameLayo
|
||||
return mMultiValueAlpha.getProperty(INDEX_FULLSCREEN_ALPHA);
|
||||
}
|
||||
|
||||
private void updateHorizontalPadding() {
|
||||
setPadding(mInsets.left, 0, mInsets.right, 0);
|
||||
/**
|
||||
* Aligns OverviewActionsView vertically with and offsets horizontal position based on
|
||||
* 3 button nav container in taskbar.
|
||||
*/
|
||||
private void updatePaddingAndTranslations() {
|
||||
boolean alignFor3ButtonTaskbar = mDp.isTaskbarPresent &&
|
||||
SysUINavigationMode.getMode(getContext()) == THREE_BUTTONS;
|
||||
if (alignFor3ButtonTaskbar) {
|
||||
// Add extra horizontal spacing
|
||||
int additionalPadding = ApiWrapper.getHotseatEndOffset(getContext());
|
||||
if (isLayoutRtl()) {
|
||||
setPadding(mInsets.left + additionalPadding, 0, mInsets.right, 0);
|
||||
} else {
|
||||
setPadding(mInsets.left, 0, mInsets.right + additionalPadding, 0);
|
||||
}
|
||||
|
||||
// Align vertically, using taskbar height + mDp.taskbarOffsetY() to guestimate
|
||||
// where the button nav top is
|
||||
View startActionView = findViewById(R.id.action_buttons);
|
||||
int marginBottom = getOverviewActionsBottomMarginPx(
|
||||
SysUINavigationMode.getMode(getContext()), mDp);
|
||||
int actionsTop = (mDp.heightPx - marginBottom - mInsets.bottom);
|
||||
int navTop = mDp.heightPx - (mDp.taskbarSize + mDp.getTaskbarOffsetY());
|
||||
int transY = navTop - actionsTop
|
||||
+ ((mDp.taskbarSize - startActionView.getHeight()) / 2);
|
||||
setTranslationY(transY);
|
||||
} else {
|
||||
setPadding(mInsets.left, 0, mInsets.right, 0);
|
||||
setTranslationX(0);
|
||||
setTranslationY(0);
|
||||
}
|
||||
}
|
||||
|
||||
/** Updates vertical margins for different navigation mode or configuration changes. */
|
||||
|
||||
@@ -1094,7 +1094,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
for (int i = 0; i < taskCount; i++) {
|
||||
View v = getTaskViewAt(i);
|
||||
if (!(v instanceof GroupedTaskView)) {
|
||||
return;
|
||||
continue;
|
||||
}
|
||||
GroupedTaskView gtv = (GroupedTaskView) v;
|
||||
gtv.onTaskListVisibilityChanged(false);
|
||||
|
||||
@@ -373,7 +373,7 @@ public class ItemInfo {
|
||||
|
||||
protected LauncherAtom.ItemInfo.Builder getDefaultItemInfoBuilder() {
|
||||
LauncherAtom.ItemInfo.Builder itemBuilder = LauncherAtom.ItemInfo.newBuilder();
|
||||
itemBuilder.setIsWork(user != Process.myUserHandle());
|
||||
itemBuilder.setIsWork(!Process.myUserHandle().equals(user));
|
||||
return itemBuilder;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package com.android.launcher3.widget;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.appwidget.AppWidgetProviderInfo;
|
||||
import android.content.Context;
|
||||
import android.graphics.Canvas;
|
||||
@@ -30,6 +31,9 @@ import android.widget.RemoteViews;
|
||||
|
||||
import com.android.launcher3.R;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
/**
|
||||
* A widget host views created while the host has not bind to the system service.
|
||||
*/
|
||||
@@ -75,8 +79,22 @@ public class DeferredAppWidgetHostView extends LauncherAppWidgetHostView {
|
||||
&& mSetupTextLayout.getWidth() == availableWidth) {
|
||||
return;
|
||||
}
|
||||
mSetupTextLayout = new StaticLayout(info.label, mPaint, availableWidth,
|
||||
Layout.Alignment.ALIGN_CENTER, 1, 0, true);
|
||||
try {
|
||||
mSetupTextLayout = new StaticLayout(info.label, mPaint, availableWidth,
|
||||
Layout.Alignment.ALIGN_CENTER, 1, 0, true);
|
||||
} catch (IllegalArgumentException e) {
|
||||
@SuppressLint("DrawAllocation") StringWriter stringWriter = new StringWriter();
|
||||
@SuppressLint("DrawAllocation") PrintWriter printWriter = new PrintWriter(stringWriter);
|
||||
mActivity.getDeviceProfile().dump(/*prefix=*/"", printWriter);
|
||||
printWriter.flush();
|
||||
String message = "b/203530620 "
|
||||
+ "- availableWidth: " + availableWidth
|
||||
+ ", getMeasuredWidth: " + getMeasuredWidth()
|
||||
+ ", getPaddingLeft: " + getPaddingLeft()
|
||||
+ ", getPaddingRight: " + getPaddingRight()
|
||||
+ ", deviceProfile: " + stringWriter.toString();
|
||||
throw new IllegalArgumentException(message, e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -32,6 +32,7 @@ import com.android.launcher3.allapps.WorkAdapterProvider;
|
||||
import com.android.launcher3.allapps.WorkEduCard;
|
||||
import com.android.launcher3.allapps.WorkProfileManager;
|
||||
import com.android.launcher3.tapl.LauncherInstrumentation;
|
||||
import com.android.launcher3.util.rule.ScreenRecordRule.ScreenRecord;
|
||||
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
@@ -86,6 +87,7 @@ public class WorkProfileTest extends AbstractLauncherUiTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@ScreenRecord // b/202735477
|
||||
public void workTabExists() {
|
||||
mDevice.pressHome();
|
||||
waitForLauncherCondition("Launcher didn't start", Objects::nonNull);
|
||||
|
||||
Reference in New Issue
Block a user