Add SysUiProxy method to start transition on desktop task launch.

This forces the task to correctly start the TRANSIT_OPEN transiiton in
Desktop mode when launching an intent from the taskbar and prevent it
from opening in full screen.

Fixes: 361366053
Test: manual test
Flag: EXEMPT bugfix
Change-Id: I6d59705aa55745c3425266dacbb012dd4e2b1b03
This commit is contained in:
Vania Desmonda committed 2025-01-15 18:54:04 -08:00
1 parent f48e1d42e3
commit 5d50fbb6c9
3 files changed
+21 -8

No files matched your search

@@ -228,6 +228,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
private DeviceProfile mPersistentTaskbarDeviceProfile;
private final LauncherPrefs mLauncherPrefs;
private final SystemUiProxy mSysUiProxy;
private TaskbarFeatureEvaluator mTaskbarFeatureEvaluator;
@@ -237,10 +238,11 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
@Nullable Context navigationBarPanelContext, DeviceProfile launcherDp,
TaskbarNavButtonController buttonController,
ScopedUnfoldTransitionProgressProvider unfoldTransitionProgressProvider,
boolean isPrimaryDisplay) {
boolean isPrimaryDisplay, SystemUiProxy sysUiProxy) {
super(windowContext);
mIsPrimaryDisplay = isPrimaryDisplay;
mNavigationBarPanelContext = navigationBarPanelContext;
mSysUiProxy = sysUiProxy;
applyDeviceProfile(launcherDp);
final Resources resources = getResources();
mTaskbarFeatureEvaluator = TaskbarFeatureEvaluator.getInstance(this);
@@ -1630,12 +1632,12 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
intent.getComponent(), info.user, intent.getSourceBounds(), null);
return;
}
int displayId = getDisplay() == null ? DEFAULT_DISPLAY : getDisplay().getDisplayId();
// TODO(b/216683257): Use startActivityForResult for search results that require it.
if (taskInRecents != null) {
// Re launch instance from recents
ActivityOptionsWrapper opts = getActivityLaunchOptions(null, info);
opts.options.setLaunchDisplayId(
getDisplay() == null ? DEFAULT_DISPLAY : getDisplay().getDisplayId());
opts.options.setLaunchDisplayId(displayId);
if (ActivityManagerWrapper.getInstance()
.startActivityFromRecents(taskInRecents.key, opts.options)) {
mControllers.uiController.getRecentsView()
@@ -1643,12 +1645,13 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
return;
}
}
ActivityOptionsWrapper opts = null;
if (areDesktopTasksVisible()) {
opts = getActivityLaunchDesktopOptions(info);
ActivityOptionsWrapper opts = getActivityLaunchDesktopOptions(info);
Bundle optionsBundle = opts == null ? null : opts.options.toBundle();
mSysUiProxy.startLaunchIntentTransition(intent, optionsBundle, displayId);
} else {
startActivity(intent, null);
}
Bundle optionsBundle = opts == null ? null : opts.options.toBundle();
startActivity(intent, optionsBundle);
} catch (NullPointerException | ActivityNotFoundException | SecurityException e) {
Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT)
.show();