Merge "Dont relaunch activity in fullscreen stack when entering split screen mode" into nyc-dev
am: 53482cb6c0
* commit '53482cb6c0a4d51de8aab15f22c9490c9169b05c':
Don’t relaunch activity in fullscreen stack when entering split screen mode
Change-Id: I139c1bab1f1719ca98c8272147d84fb0ed71808e
This commit is contained in:
@@ -794,7 +794,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
|
||||
if (hasBounds) {
|
||||
bounds = Rect.CREATOR.createFromParcel(data);
|
||||
}
|
||||
boolean res = moveTaskToDockedStack(taskId, createMode, toTop, animate, bounds);
|
||||
final boolean moveHomeStackFront = data.readInt() != 0;
|
||||
final boolean res = moveTaskToDockedStack(
|
||||
taskId, createMode, toTop, animate, bounds, moveHomeStackFront);
|
||||
reply.writeNoException();
|
||||
reply.writeInt(res ? 1 : 0);
|
||||
return true;
|
||||
@@ -3865,7 +3867,7 @@ class ActivityManagerProxy implements IActivityManager
|
||||
}
|
||||
@Override
|
||||
public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
|
||||
Rect initialBounds) throws RemoteException
|
||||
Rect initialBounds, boolean moveHomeStackFront) throws RemoteException
|
||||
{
|
||||
Parcel data = Parcel.obtain();
|
||||
Parcel reply = Parcel.obtain();
|
||||
@@ -3880,6 +3882,7 @@ class ActivityManagerProxy implements IActivityManager
|
||||
} else {
|
||||
data.writeInt(0);
|
||||
}
|
||||
data.writeInt(moveHomeStackFront ? 1 : 0);
|
||||
mRemote.transact(MOVE_TASK_TO_DOCKED_STACK_TRANSACTION, data, reply, 0);
|
||||
reply.readException();
|
||||
boolean res = reply.readInt() > 0;
|
||||
|
||||
@@ -147,7 +147,7 @@ public interface IActivityManager extends IInterface {
|
||||
public void moveTaskBackwards(int task) throws RemoteException;
|
||||
public void moveTaskToStack(int taskId, int stackId, boolean toTop) throws RemoteException;
|
||||
public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
|
||||
Rect initialBounds) throws RemoteException;
|
||||
Rect initialBounds, boolean moveHomeStackFront) throws RemoteException;
|
||||
public boolean moveTopActivityToPinnedStack(int stackId, Rect bounds) throws RemoteException;
|
||||
|
||||
/**
|
||||
|
||||
@@ -414,8 +414,8 @@ public class SystemServicesProxy {
|
||||
}
|
||||
|
||||
try {
|
||||
return mIam.moveTaskToDockedStack(
|
||||
taskId, createMode, true /* onTop */, false /* animate */, initialBounds);
|
||||
return mIam.moveTaskToDockedStack(taskId, createMode, true /* onTop */,
|
||||
false /* animate */, initialBounds, true /* moveHomeStackFront */ );
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -9700,7 +9700,7 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
*/
|
||||
@Override
|
||||
public boolean moveTaskToDockedStack(int taskId, int createMode, boolean toTop, boolean animate,
|
||||
Rect initialBounds) {
|
||||
Rect initialBounds, boolean moveHomeStackFront) {
|
||||
enforceCallingPermission(MANAGE_ACTIVITY_STACKS, "moveTaskToDockedStack()");
|
||||
synchronized (this) {
|
||||
long ident = Binder.clearCallingIdentity();
|
||||
@@ -9708,9 +9708,16 @@ public final class ActivityManagerService extends ActivityManagerNative
|
||||
if (DEBUG_STACK) Slog.d(TAG_STACK, "moveTaskToDockedStack: moving task=" + taskId
|
||||
+ " to createMode=" + createMode + " toTop=" + toTop);
|
||||
mWindowManager.setDockedStackCreateState(createMode, initialBounds);
|
||||
return mStackSupervisor.moveTaskToStackLocked(
|
||||
taskId, DOCKED_STACK_ID, toTop, !FORCE_FOCUS,
|
||||
"moveTaskToDockedStack", animate);
|
||||
final boolean moved = mStackSupervisor.moveTaskToStackLocked(
|
||||
taskId, DOCKED_STACK_ID, toTop, !FORCE_FOCUS, "moveTaskToDockedStack",
|
||||
animate, DEFER_RESUME);
|
||||
if (moved) {
|
||||
if (moveHomeStackFront) {
|
||||
mStackSupervisor.moveHomeStackToFront("moveTaskToDockedStack");
|
||||
}
|
||||
mStackSupervisor.ensureActivitiesVisibleLocked(null, 0, !PRESERVE_WINDOWS);
|
||||
}
|
||||
return moved;
|
||||
} finally {
|
||||
Binder.restoreCallingIdentity(ident);
|
||||
}
|
||||
|
||||
@@ -204,7 +204,7 @@ class TaskPositioner implements DimLayer.DimLayerUser {
|
||||
: DOCKED_STACK_CREATE_MODE_BOTTOM_OR_RIGHT;
|
||||
mService.mActivityManager.moveTaskToDockedStack(
|
||||
mTask.mTaskId, createMode, true /*toTop*/, true /* animate */,
|
||||
null /* initialBounds */);
|
||||
null /* initialBounds */, false /* moveHomeStackFront */);
|
||||
}
|
||||
} catch(RemoteException e) {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user