Loading core/java/android/view/IDisplayWindowListener.aidl 0 → 100644 +40 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view; /** * Interface to listen for changes to display window-containers. * * This differs from DisplayManager's DisplayListener: * - onDisplayAdded is always called after the display is actually added to the WM hierarchy. * This corresponds to the DisplayContent and not the raw Dislay from DisplayManager. * * @hide */ oneway interface IDisplayWindowListener { /** * Called when a display is added to the WM hierarchy. */ void onDisplayAdded(int displayId); /** * Called when a display is removed from the hierarchy. */ void onDisplayRemoved(int displayId); } core/java/android/view/IDisplayWindowRotationCallback.aidl 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package android.view; import android.view.WindowContainerTransaction; /** * Interface to be invoked by the controller when it has finished preparing for a display rotation. * * @see IDisplayWindowRotationController * @hide */ interface IDisplayWindowRotationCallback { void continueRotateDisplay(int targetRotation, in WindowContainerTransaction t); } core/java/android/view/IDisplayWindowRotationController.aidl 0 → 100644 +52 −0 Original line number Diff line number Diff line /** * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view; import android.view.IDisplayWindowRotationCallback; /** * Singular controller of a "remote" display rotation. When a display rotation is started, WM * freezes the screen. It will then call into this controller and wait for a response via the * callback. * * This needs to provide configuration changes because those changes need to be applied in sync * with the actual display rotation to prevent relayouts with mismatched information. * * The flow is like this: * 1. DisplayContent/Rotation freezes the screen * 2. This controller is notified of a rotation and provided a callback. * 3. This controller is responsible for collecting a set of configuration changes to go along with * the rotation. * 4. The callback is fired which tells DisplayContent/Rotation to apply the provided configuration * changes and continue the rotation. * * @hide */ oneway interface IDisplayWindowRotationController { /** * Called when WM needs to know how to update tasks in response to a display rotation. * If this isn't called, a timeout will continue the rotation in WM. * * @param displayId the display that is rotating. * @param fromRotation the rotation the display is rotating from. * @param toRotation the rotation the display is rotating to. * @param callback A callback to be called when this has calculated updated configs. */ void onRotateDisplay(int displayId, int fromRotation, int toRotation, in IDisplayWindowRotationCallback callback); } core/java/android/view/IWindowManager.aidl +19 −0 Original line number Diff line number Diff line Loading @@ -35,7 +35,9 @@ import android.os.ParcelFileDescriptor; import android.view.IApplicationToken; import android.view.IAppTransitionAnimationSpecsFuture; import android.view.IDockedStackListener; import android.view.IDisplayWindowListener; import android.view.IDisplayFoldListener; import android.view.IDisplayWindowRotationController; import android.view.IOnKeyguardExitResult; import android.view.IPinnedStackListener; import android.view.RemoteAnimationAdapter; Loading Loading @@ -96,6 +98,13 @@ interface IWindowManager void removeWindowToken(IBinder token, int displayId); void prepareAppTransition(int transit, boolean alwaysKeepCurrent); /** * Sets a singular remote controller of display rotations. There can only be one. The * controller is called after the display has "frozen" for a rotation and display rotation will * only continue once the controller has finished calculating associated configurations. */ void setDisplayWindowRotationController(IDisplayWindowRotationController controller); /** * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of Loading Loading @@ -475,6 +484,16 @@ interface IWindowManager */ void unregisterDisplayFoldListener(IDisplayFoldListener listener); /** * Registers an IDisplayContainerListener */ void registerDisplayWindowListener(IDisplayWindowListener listener); /** * Unregisters an IDisplayContainerListener. */ void unregisterDisplayWindowListener(IDisplayWindowListener listener); /** * Starts a window trace. */ Loading packages/SystemUI/src/com/android/systemui/Dependency.java +3 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ import com.android.systemui.util.leak.GarbageMonitor; import com.android.systemui.util.leak.LeakDetector; import com.android.systemui.util.leak.LeakReporter; import com.android.systemui.util.sensors.AsyncSensorManager; import com.android.systemui.wm.DisplayWindowController; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -332,6 +333,7 @@ public class Dependency { @Inject Lazy<CommandQueue> mCommandQueue; @Inject Lazy<Recents> mRecents; @Inject Lazy<StatusBar> mStatusBar; @Inject Lazy<DisplayWindowController> mDisplayWindowController; @Inject public Dependency() { Loading Loading @@ -523,6 +525,7 @@ public class Dependency { mProviders.put(CommandQueue.class, mCommandQueue::get); mProviders.put(Recents.class, mRecents::get); mProviders.put(StatusBar.class, mStatusBar::get); mProviders.put(DisplayWindowController.class, mDisplayWindowController::get); // TODO(b/118592525): to support multi-display , we start to add something which is // per-display, while others may be global. I think it's time to add Loading Loading
core/java/android/view/IDisplayWindowListener.aidl 0 → 100644 +40 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view; /** * Interface to listen for changes to display window-containers. * * This differs from DisplayManager's DisplayListener: * - onDisplayAdded is always called after the display is actually added to the WM hierarchy. * This corresponds to the DisplayContent and not the raw Dislay from DisplayManager. * * @hide */ oneway interface IDisplayWindowListener { /** * Called when a display is added to the WM hierarchy. */ void onDisplayAdded(int displayId); /** * Called when a display is removed from the hierarchy. */ void onDisplayRemoved(int displayId); }
core/java/android/view/IDisplayWindowRotationCallback.aidl 0 → 100644 +29 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License */ package android.view; import android.view.WindowContainerTransaction; /** * Interface to be invoked by the controller when it has finished preparing for a display rotation. * * @see IDisplayWindowRotationController * @hide */ interface IDisplayWindowRotationCallback { void continueRotateDisplay(int targetRotation, in WindowContainerTransaction t); }
core/java/android/view/IDisplayWindowRotationController.aidl 0 → 100644 +52 −0 Original line number Diff line number Diff line /** * Copyright (C) 2019 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package android.view; import android.view.IDisplayWindowRotationCallback; /** * Singular controller of a "remote" display rotation. When a display rotation is started, WM * freezes the screen. It will then call into this controller and wait for a response via the * callback. * * This needs to provide configuration changes because those changes need to be applied in sync * with the actual display rotation to prevent relayouts with mismatched information. * * The flow is like this: * 1. DisplayContent/Rotation freezes the screen * 2. This controller is notified of a rotation and provided a callback. * 3. This controller is responsible for collecting a set of configuration changes to go along with * the rotation. * 4. The callback is fired which tells DisplayContent/Rotation to apply the provided configuration * changes and continue the rotation. * * @hide */ oneway interface IDisplayWindowRotationController { /** * Called when WM needs to know how to update tasks in response to a display rotation. * If this isn't called, a timeout will continue the rotation in WM. * * @param displayId the display that is rotating. * @param fromRotation the rotation the display is rotating from. * @param toRotation the rotation the display is rotating to. * @param callback A callback to be called when this has calculated updated configs. */ void onRotateDisplay(int displayId, int fromRotation, int toRotation, in IDisplayWindowRotationCallback callback); }
core/java/android/view/IWindowManager.aidl +19 −0 Original line number Diff line number Diff line Loading @@ -35,7 +35,9 @@ import android.os.ParcelFileDescriptor; import android.view.IApplicationToken; import android.view.IAppTransitionAnimationSpecsFuture; import android.view.IDockedStackListener; import android.view.IDisplayWindowListener; import android.view.IDisplayFoldListener; import android.view.IDisplayWindowRotationController; import android.view.IOnKeyguardExitResult; import android.view.IPinnedStackListener; import android.view.RemoteAnimationAdapter; Loading Loading @@ -96,6 +98,13 @@ interface IWindowManager void removeWindowToken(IBinder token, int displayId); void prepareAppTransition(int transit, boolean alwaysKeepCurrent); /** * Sets a singular remote controller of display rotations. There can only be one. The * controller is called after the display has "frozen" for a rotation and display rotation will * only continue once the controller has finished calculating associated configurations. */ void setDisplayWindowRotationController(IDisplayWindowRotationController controller); /** * Like overridePendingAppTransitionMultiThumb, but uses a future to supply the specs. This is * used for recents, where generating the thumbnails of the specs takes a non-trivial amount of Loading Loading @@ -475,6 +484,16 @@ interface IWindowManager */ void unregisterDisplayFoldListener(IDisplayFoldListener listener); /** * Registers an IDisplayContainerListener */ void registerDisplayWindowListener(IDisplayWindowListener listener); /** * Unregisters an IDisplayContainerListener. */ void unregisterDisplayWindowListener(IDisplayWindowListener listener); /** * Starts a window trace. */ Loading
packages/SystemUI/src/com/android/systemui/Dependency.java +3 −0 Original line number Diff line number Diff line Loading @@ -125,6 +125,7 @@ import com.android.systemui.util.leak.GarbageMonitor; import com.android.systemui.util.leak.LeakDetector; import com.android.systemui.util.leak.LeakReporter; import com.android.systemui.util.sensors.AsyncSensorManager; import com.android.systemui.wm.DisplayWindowController; import java.io.FileDescriptor; import java.io.PrintWriter; Loading Loading @@ -332,6 +333,7 @@ public class Dependency { @Inject Lazy<CommandQueue> mCommandQueue; @Inject Lazy<Recents> mRecents; @Inject Lazy<StatusBar> mStatusBar; @Inject Lazy<DisplayWindowController> mDisplayWindowController; @Inject public Dependency() { Loading Loading @@ -523,6 +525,7 @@ public class Dependency { mProviders.put(CommandQueue.class, mCommandQueue::get); mProviders.put(Recents.class, mRecents::get); mProviders.put(StatusBar.class, mStatusBar::get); mProviders.put(DisplayWindowController.class, mDisplayWindowController::get); // TODO(b/118592525): to support multi-display , we start to add something which is // per-display, while others may be global. I think it's time to add Loading