Merge "Hooks for interracting with stage split components using legacy recentsanimation" into sc-v2-dev
This commit is contained in:
@@ -90,4 +90,11 @@ interface ISplitScreen {
|
||||
oneway void startTasksWithLegacyTransition(int mainTaskId, in Bundle mainOptions,
|
||||
int sideTaskId, in Bundle sideOptions, int sidePosition,
|
||||
in RemoteAnimationAdapter adapter) = 11;
|
||||
|
||||
/**
|
||||
* Blocking call that notifies and gets additional split-screen targets when entering
|
||||
* recents (for example: the dividerBar).
|
||||
* @param cancel is true if leaving recents back to split (eg. the gesture was cancelled).
|
||||
*/
|
||||
RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel) = 12;
|
||||
}
|
||||
|
||||
@@ -40,6 +40,7 @@ import android.os.RemoteException;
|
||||
import android.os.UserHandle;
|
||||
import android.util.Slog;
|
||||
import android.view.RemoteAnimationAdapter;
|
||||
import android.view.RemoteAnimationTarget;
|
||||
import android.window.IRemoteTransition;
|
||||
|
||||
import androidx.annotation.BinderThread;
|
||||
@@ -267,6 +268,11 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
|
||||
return options;
|
||||
}
|
||||
|
||||
RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel) {
|
||||
if (!isSplitScreenVisible()) return null;
|
||||
return new RemoteAnimationTarget[]{mStageCoordinator.getDividerBarLegacyTarget()};
|
||||
}
|
||||
|
||||
public void dump(@NonNull PrintWriter pw, String prefix) {
|
||||
pw.println(prefix + TAG);
|
||||
if (mStageCoordinator != null) {
|
||||
@@ -466,5 +472,14 @@ public class SplitScreenController implements DragAndDropPolicy.Starter,
|
||||
controller.startIntent(intent, fillInIntent, stage, position, options);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public RemoteAnimationTarget[] onGoingToRecentsLegacy(boolean cancel) {
|
||||
final RemoteAnimationTarget[][] out = new RemoteAnimationTarget[][]{null};
|
||||
executeRemoteCallWithTaskPermission(mController, "onGoingToRecentsLegacy",
|
||||
(controller) -> out[0] = controller.onGoingToRecentsLegacy(cancel),
|
||||
true /* blocking */);
|
||||
return out[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -970,7 +970,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
}
|
||||
}
|
||||
|
||||
private RemoteAnimationTarget getDividerBarLegacyTarget() {
|
||||
RemoteAnimationTarget getDividerBarLegacyTarget() {
|
||||
final Rect bounds = mSplitLayout.getDividerBounds();
|
||||
return new RemoteAnimationTarget(-1 /* taskId */, -1 /* mode */,
|
||||
mSplitLayout.getDividerLeash(), false /* isTranslucent */, null /* clipRect */,
|
||||
|
||||
Reference in New Issue
Block a user