mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Launch split task with correct UserHandle
PendingIntent#getActivity gets the owner UserHandle from the app context. That makes the activity launch fail since the app only exists in the work profile environment(secondary user). This CL gets the correct Userhandle from Launcher and use PendingIntent#getActivityAsUser to launch split task. Bug: 242039471 Test: Launch Google chat by shortcut to enter split (work-profile) Change-Id: Ie1db8a858bf9cee700cb3ff3a9e607a5d1dbad30
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user