Snap for 7026150 from 06ade42dd7 to sc-release
Change-Id: I63f32bf3c0b57a1ee642a1d4cb5097e3eaddb3d6
This commit is contained in:
commit
45775076ac
5 files changed
+29
-14
No files matched your search
@@ -40,6 +40,8 @@
|
||||
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES" />
|
||||
<uses-permission android:name="android.permission.READ_DEVICE_CONFIG" />
|
||||
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
|
||||
<!-- for rotating surface by arbitrary degree -->
|
||||
<uses-permission android:name="android.permission.ROTATE_SURFACE_FLINGER" />
|
||||
|
||||
<!--
|
||||
Permissions required for read/write access to the workspace data. These permission name
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
package com.android.quickstep;
|
||||
|
||||
import static com.android.launcher3.util.Executors.MAIN_EXECUTOR;
|
||||
import static com.android.launcher3.util.Executors.THREAD_POOL_EXECUTOR;
|
||||
import static com.android.launcher3.util.Executors.UI_HELPER_EXECUTOR;
|
||||
|
||||
import android.graphics.Rect;
|
||||
@@ -96,8 +97,8 @@ public class RecentsAnimationController {
|
||||
* {@link RecentsAnimationCallbacks#onTaskAppeared(RemoteAnimationTargetCompat)}}.
|
||||
*/
|
||||
@UiThread
|
||||
public boolean removeTaskTarget(@NonNull RemoteAnimationTargetCompat target) {
|
||||
return mController.removeTask(target.taskId);
|
||||
public void removeTaskTarget(@NonNull RemoteAnimationTargetCompat target) {
|
||||
THREAD_POOL_EXECUTOR.execute(() -> mController.removeTask(target.taskId));
|
||||
}
|
||||
|
||||
@UiThread
|
||||
|
||||
@@ -88,9 +88,15 @@ public class ThumbnailSearchResultView extends androidx.appcompat.widget.AppComp
|
||||
bitmap = ((BitmapDrawable) target.getRemoteAction().getIcon()
|
||||
.loadDrawable(getContext())).getBitmap();
|
||||
// crop
|
||||
bitmap = Bitmap.createBitmap(bitmap, 0,
|
||||
bitmap.getHeight() / 2 - bitmap.getWidth() / 2,
|
||||
bitmap.getWidth(), bitmap.getWidth());
|
||||
if (bitmap.getWidth() < bitmap.getHeight()) {
|
||||
bitmap = Bitmap.createBitmap(bitmap, 0,
|
||||
bitmap.getHeight() / 2 - bitmap.getWidth() / 2,
|
||||
bitmap.getWidth(), bitmap.getWidth());
|
||||
} else {
|
||||
bitmap = Bitmap.createBitmap(bitmap, bitmap.getWidth() / 2 - bitmap.getHeight() / 2,
|
||||
0,
|
||||
bitmap.getHeight(), bitmap.getHeight());
|
||||
}
|
||||
setTag(itemInfo);
|
||||
} else {
|
||||
bitmap = (Bitmap) target.getExtras().getParcelable("bitmap");
|
||||
|
||||
@@ -60,7 +60,6 @@ public class WorkEduView extends AbstractSlideInView
|
||||
private View mViewWrapper;
|
||||
private Button mProceedButton;
|
||||
private TextView mContentText;
|
||||
private AllAppsPagedView mAllAppsPagedView;
|
||||
|
||||
private int mNextWorkEduStep = WORK_EDU_PERSONAL_APPS;
|
||||
|
||||
@@ -101,13 +100,10 @@ public class WorkEduView extends AbstractSlideInView
|
||||
|
||||
// make sure layout does not shrink when we change the text
|
||||
mContentText.post(() -> mContentText.setMinLines(mContentText.getLineCount()));
|
||||
if (mLauncher.getAppsView().getContentView() instanceof AllAppsPagedView) {
|
||||
mAllAppsPagedView = (AllAppsPagedView) mLauncher.getAppsView().getContentView();
|
||||
}
|
||||
|
||||
mProceedButton.setOnClickListener(view -> {
|
||||
if (mAllAppsPagedView != null) {
|
||||
mAllAppsPagedView.snapToPage(AllAppsContainerView.AdapterHolder.WORK);
|
||||
if (getAllAppsPagedView() != null) {
|
||||
getAllAppsPagedView().snapToPage(AllAppsContainerView.AdapterHolder.WORK);
|
||||
}
|
||||
goToWorkTab(true);
|
||||
});
|
||||
@@ -155,8 +151,8 @@ public class WorkEduView extends AbstractSlideInView
|
||||
}
|
||||
|
||||
private void goToFirstPage() {
|
||||
if (mAllAppsPagedView != null) {
|
||||
mAllAppsPagedView.snapToPageImmediately(AllAppsContainerView.AdapterHolder.MAIN);
|
||||
if (getAllAppsPagedView() != null) {
|
||||
getAllAppsPagedView().snapToPageImmediately(AllAppsContainerView.AdapterHolder.MAIN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -171,6 +167,11 @@ public class WorkEduView extends AbstractSlideInView
|
||||
mOpenCloseAnimator.start();
|
||||
}
|
||||
|
||||
private AllAppsPagedView getAllAppsPagedView() {
|
||||
View v = mLauncher.getAppsView().getContentView();
|
||||
return (v instanceof AllAppsPagedView) ? (AllAppsPagedView) v : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if user has not seen onboarding UI yet and shows it when user navigates to all apps
|
||||
*/
|
||||
|
||||
@@ -82,6 +82,7 @@ public class WorkTabTest extends AbstractLauncherUiTest {
|
||||
mDevice.pressHome();
|
||||
waitForLauncherCondition("Launcher didn't start", Objects::nonNull);
|
||||
executeOnLauncher(launcher -> launcher.getStateManager().goToState(ALL_APPS));
|
||||
waitForState("Launcher internal state didn't switch to All Apps", () -> ALL_APPS);
|
||||
waitForLauncherCondition("Personal tab is missing",
|
||||
launcher -> launcher.getAppsView().isPersonalTabVisible(), 60000);
|
||||
waitForLauncherCondition("Work tab is missing",
|
||||
@@ -180,6 +181,10 @@ public class WorkTabTest extends AbstractLauncherUiTest {
|
||||
// open work tab
|
||||
executeOnLauncher(launcher -> launcher.getStateManager().goToState(ALL_APPS));
|
||||
waitForState("Launcher did not switch to all apps", () -> ALL_APPS);
|
||||
waitForLauncherCondition("Work tab not setup",
|
||||
launcher -> launcher.getAppsView().getContentView() instanceof AllAppsPagedView,
|
||||
60000);
|
||||
|
||||
executeOnLauncher(launcher -> {
|
||||
AllAppsPagedView pagedView = (AllAppsPagedView) launcher.getAppsView().getContentView();
|
||||
pagedView.setCurrentPage(WORK_PAGE);
|
||||
@@ -199,7 +204,7 @@ public class WorkTabTest extends AbstractLauncherUiTest {
|
||||
DragLayer dragLayer = l.getDragLayer();
|
||||
return dragLayer.getChildCount() > 0 && dragLayer.getChildAt(
|
||||
dragLayer.getChildCount() - 1) instanceof WorkEduView;
|
||||
});
|
||||
}, 6000);
|
||||
return getFromLauncher(launcher -> (WorkEduView) launcher.getDragLayer().getChildAt(
|
||||
launcher.getDragLayer().getChildCount() - 1));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user