mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 10:48:19 +00:00
Merge "Launch split task with correct UserHandle" into tm-qpr-dev am: 831f5ee748 am: ede6d7b35c
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/19668512 Change-Id: I64778a8e2f7930a5a132c897e3dee6dbd2532e36 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -19,6 +19,7 @@ import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
@@ -71,7 +72,7 @@ public interface QuickstepSystemShortcut {
|
||||
RecentsView recentsView = mTarget.getOverviewPanel();
|
||||
recentsView.initiateSplitSelect(
|
||||
new SplitSelectSource(mOriginalView, new BitmapDrawable(bitmap), intent,
|
||||
mPosition));
|
||||
mPosition, mItemInfo.user));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,13 +82,15 @@ public interface QuickstepSystemShortcut {
|
||||
public final Drawable drawable;
|
||||
public final Intent intent;
|
||||
public final SplitPositionOption position;
|
||||
public final UserHandle user;
|
||||
|
||||
public SplitSelectSource(View view, Drawable drawable, Intent intent,
|
||||
SplitPositionOption position) {
|
||||
SplitPositionOption position, UserHandle user) {
|
||||
this.view = view;
|
||||
this.drawable = drawable;
|
||||
this.intent = intent;
|
||||
this.position = position;
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.UserHandle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.RemoteAnimationAdapter;
|
||||
import android.view.SurfaceControl;
|
||||
@@ -77,6 +78,8 @@ public class SplitSelectStateController {
|
||||
private int mSecondTaskId = INVALID_TASK_ID;
|
||||
private String mSecondTaskPackageName;
|
||||
private boolean mRecentsAnimationRunning;
|
||||
@Nullable
|
||||
private UserHandle mUser;
|
||||
/** If not null, this is the TaskView we want to launch from */
|
||||
@Nullable
|
||||
private GroupedTaskView mLaunchingTaskView;
|
||||
@@ -97,12 +100,15 @@ public class SplitSelectStateController {
|
||||
mInitialTaskId = taskId;
|
||||
mStagePosition = stagePosition;
|
||||
mInitialTaskIntent = null;
|
||||
mUser = null;
|
||||
}
|
||||
|
||||
public void setInitialTaskSelect(Intent intent, @StagePosition int stagePosition) {
|
||||
public void setInitialTaskSelect(Intent intent, @StagePosition int stagePosition,
|
||||
@Nullable UserHandle user) {
|
||||
mInitialTaskIntent = intent;
|
||||
mStagePosition = stagePosition;
|
||||
mInitialTaskId = INVALID_TASK_ID;
|
||||
mUser = user;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,9 +126,12 @@ public class SplitSelectStateController {
|
||||
} else {
|
||||
fillInIntent = null;
|
||||
}
|
||||
final PendingIntent pendingIntent =
|
||||
mInitialTaskIntent == null ? null : PendingIntent.getActivity(mContext, 0,
|
||||
mInitialTaskIntent, FLAG_MUTABLE);
|
||||
|
||||
final PendingIntent pendingIntent = mInitialTaskIntent == null ? null : (mUser != null
|
||||
? PendingIntent.getActivityAsUser(mContext, 0, mInitialTaskIntent,
|
||||
FLAG_MUTABLE, null /* options */, mUser)
|
||||
: PendingIntent.getActivity(mContext, 0, mInitialTaskIntent, FLAG_MUTABLE));
|
||||
|
||||
launchTasks(mInitialTaskId, pendingIntent, fillInIntent, mSecondTaskId, mStagePosition,
|
||||
callback, false /* freezeTaskList */, DEFAULT_SPLIT_RATIO);
|
||||
}
|
||||
|
||||
@@ -4105,7 +4105,7 @@ public abstract class RecentsView<ACTIVITY_TYPE extends StatefulActivity<STATE_T
|
||||
public void initiateSplitSelect(QuickstepSystemShortcut.SplitSelectSource splitSelectSource) {
|
||||
mSplitSelectSource = splitSelectSource;
|
||||
mSplitSelectStateController.setInitialTaskSelect(splitSelectSource.intent,
|
||||
splitSelectSource.position.stagePosition);
|
||||
splitSelectSource.position.stagePosition, splitSelectSource.user);
|
||||
}
|
||||
|
||||
public PendingAnimation createSplitSelectInitAnimation(int duration) {
|
||||
|
||||
Reference in New Issue
Block a user