Loading core/java/android/view/IWindowManager.aidl +21 −0 Original line number Diff line number Diff line Loading @@ -780,4 +780,25 @@ interface IWindowManager * verified. */ boolean verifyImpressionToken(in ImpressionToken impressionToken); /** * Registers a listener for a {@link android.app.WindowContext} to handle configuration changes * from the server side. * * @param clientToken the window context's token * @param type Window type of the window context * @param displayId The display associated with the window context * @param options A bundle used to pass window-related options and choose the right DisplayArea * * @return {@code true} if the listener was registered successfully. */ boolean registerWindowContextListener(IBinder clientToken, int type, int displayId, in Bundle options); /** * Unregisters a listener which registered with {@link #registerWindowContextListener()}. * * @param clientToken the window context's token */ void unregisterWindowContextListener(IBinder clientToken); } data/etc/services.core.protolog.json +36 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,12 @@ "group": "WM_DEBUG_REMOTE_ANIMATIONS", "at": "com\/android\/server\/wm\/RemoteAnimationController.java" }, "-2014162875": { "message": "Could not register window container listener token=%s, container=%s", "level": "ERROR", "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowContextListenerController.java" }, "-2012562539": { "message": "startAnimation(): Notify animation start:", "level": "DEBUG", Loading Loading @@ -811,6 +817,12 @@ "group": "WM_DEBUG_FOCUS", "at": "com\/android\/server\/wm\/DisplayContent.java" }, "-1136467585": { "message": "The listener does not exist.", "level": "INFO", "group": "WM_DEBUG_ADD_REMOVE", "at": "com\/android\/server\/wm\/WindowContextListenerController.java" }, "-1136139407": { "message": "no-history finish of %s", "level": "DEBUG", Loading Loading @@ -1819,6 +1831,18 @@ "group": "WM_DEBUG_TASKS", "at": "com\/android\/server\/wm\/ActivityTaskManagerService.java" }, "90764070": { "message": "Could not report token removal to the window token client.", "level": "WARN", "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowContextListenerController.java" }, "91350919": { "message": "Attempted to set IME flag to a display that does not exist: %d", "level": "WARN", "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "94402792": { "message": "Moving to RESUMED: %s (in existing)", "level": "VERBOSE", Loading Loading @@ -1963,6 +1987,12 @@ "group": "WM_DEBUG_WINDOW_ORGANIZER", "at": "com\/android\/server\/wm\/TaskOrganizerController.java" }, "236210101": { "message": "registerWindowContextListener: trying to add listener to a non-existing display:%d", "level": "WARN", "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "241961619": { "message": "Adding %s to %s", "level": "VERBOSE", Loading Loading @@ -3403,6 +3433,12 @@ "group": "WM_DEBUG_TASKS", "at": "com\/android\/server\/wm\/RootWindowContainer.java" }, "1948483534": { "message": "Could not report config changes to the window token client.", "level": "WARN", "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowContextListenerController.java" }, "1964565370": { "message": "Starting remote animation", "level": "INFO", Loading services/core/java/com/android/server/wm/ConfigurationContainerListener.java +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.content.res.Configuration; */ public interface ConfigurationContainerListener { /** {@see ConfigurationContainer#onRequestedOverrideConfigurationChanged} */ /** @see ConfigurationContainer#onRequestedOverrideConfigurationChanged */ default void onRequestedOverrideConfigurationChanged(Configuration overrideConfiguration) {} /** Called when new merged override configuration is reported. */ Loading services/core/java/com/android/server/wm/DisplayAreaPolicy.java +5 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import static com.android.server.wm.DisplayAreaPolicyBuilder.Feature; import static com.android.server.wm.DisplayAreaPolicyBuilder.HierarchyBuilder; import android.content.res.Resources; import android.os.Bundle; import android.text.TextUtils; import java.util.ArrayList; Loading Loading @@ -71,6 +72,10 @@ public abstract class DisplayAreaPolicy { */ public abstract void addWindow(WindowToken token); /** Gets the {@link DisplayArea} which a {@link WindowToken} is about to be attached to. */ public abstract DisplayArea.Tokens getDisplayAreaForWindowToken(int type, Bundle options, boolean ownerCanManageAppTokens, boolean roundedCornerOverlay); /** * Gets the set of {@link DisplayArea} that are created for the given feature to apply to. */ Loading services/core/java/com/android/server/wm/DisplayAreaPolicyBuilder.java +17 −9 Original line number Diff line number Diff line Loading @@ -137,12 +137,12 @@ class DisplayAreaPolicyBuilder { private ArrayList<HierarchyBuilder> mDisplayAreaGroupHierarchyBuilders = new ArrayList<>(); /** * When a window is created, the policy will use this function to select the * {@link RootDisplayArea} to place that window in. The selected root can be either the one of * the {@link #mRootHierarchyBuilder} or the one of any of the * When a window is created, the policy will use this function, which takes window type and * options, to select the {@link RootDisplayArea} to place that window in. The selected root * can be either the one of the {@link #mRootHierarchyBuilder} or the one of any of the * {@link #mDisplayAreaGroupHierarchyBuilders}. **/ @Nullable private BiFunction<WindowToken, Bundle, RootDisplayArea> mSelectRootForWindowFunc; @Nullable private BiFunction<Integer, Bundle, RootDisplayArea> mSelectRootForWindowFunc; /** Defines the root hierarchy for the whole logical display. */ DisplayAreaPolicyBuilder setRootHierarchy(HierarchyBuilder rootHierarchyBuilder) { Loading @@ -162,7 +162,7 @@ class DisplayAreaPolicyBuilder { /** The policy will use this function to find the root to place windows in. */ DisplayAreaPolicyBuilder setSelectRootForWindowFunc( BiFunction<WindowToken, Bundle, RootDisplayArea> selectRootForWindowFunc) { BiFunction<Integer, Bundle, RootDisplayArea> selectRootForWindowFunc) { mSelectRootForWindowFunc = selectRootForWindowFunc; return this; } Loading Loading @@ -655,19 +655,19 @@ class DisplayAreaPolicyBuilder { static class Result extends DisplayAreaPolicy { final List<RootDisplayArea> mDisplayAreaGroupRoots; final BiFunction<WindowToken, Bundle, RootDisplayArea> mSelectRootForWindowFunc; final BiFunction<Integer, Bundle, RootDisplayArea> mSelectRootForWindowFunc; private final TaskDisplayArea mDefaultTaskDisplayArea; Result(WindowManagerService wmService, RootDisplayArea root, List<RootDisplayArea> displayAreaGroupRoots, @Nullable BiFunction<WindowToken, Bundle, RootDisplayArea> @Nullable BiFunction<Integer, Bundle, RootDisplayArea> selectRootForWindowFunc) { super(wmService, root); mDisplayAreaGroupRoots = Collections.unmodifiableList(displayAreaGroupRoots); mSelectRootForWindowFunc = selectRootForWindowFunc == null // Always return the highest level root of the logical display when the func is // not specified. ? (window, options) -> mRoot ? (type, options) -> mRoot : selectRootForWindowFunc; // Cache the default TaskDisplayArea for quick access. Loading @@ -689,7 +689,8 @@ class DisplayAreaPolicyBuilder { @VisibleForTesting DisplayArea.Tokens findAreaForToken(WindowToken token) { return mSelectRootForWindowFunc.apply(token, token.mOptions).findAreaForToken(token); return mSelectRootForWindowFunc.apply(token.windowType, token.mOptions) .findAreaForToken(token); } @VisibleForTesting Loading Loading @@ -727,6 +728,13 @@ class DisplayAreaPolicyBuilder { public TaskDisplayArea getDefaultTaskDisplayArea() { return mDefaultTaskDisplayArea; } @Override public DisplayArea.Tokens getDisplayAreaForWindowToken(int type, Bundle options, boolean ownerCanManageAppTokens, boolean roundedCornerOverlay) { return mSelectRootForWindowFunc.apply(type, options).findAreaForToken(type, ownerCanManageAppTokens, roundedCornerOverlay); } } static class PendingArea { Loading Loading
core/java/android/view/IWindowManager.aidl +21 −0 Original line number Diff line number Diff line Loading @@ -780,4 +780,25 @@ interface IWindowManager * verified. */ boolean verifyImpressionToken(in ImpressionToken impressionToken); /** * Registers a listener for a {@link android.app.WindowContext} to handle configuration changes * from the server side. * * @param clientToken the window context's token * @param type Window type of the window context * @param displayId The display associated with the window context * @param options A bundle used to pass window-related options and choose the right DisplayArea * * @return {@code true} if the listener was registered successfully. */ boolean registerWindowContextListener(IBinder clientToken, int type, int displayId, in Bundle options); /** * Unregisters a listener which registered with {@link #registerWindowContextListener()}. * * @param clientToken the window context's token */ void unregisterWindowContextListener(IBinder clientToken); }
data/etc/services.core.protolog.json +36 −0 Original line number Diff line number Diff line Loading @@ -85,6 +85,12 @@ "group": "WM_DEBUG_REMOTE_ANIMATIONS", "at": "com\/android\/server\/wm\/RemoteAnimationController.java" }, "-2014162875": { "message": "Could not register window container listener token=%s, container=%s", "level": "ERROR", "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowContextListenerController.java" }, "-2012562539": { "message": "startAnimation(): Notify animation start:", "level": "DEBUG", Loading Loading @@ -811,6 +817,12 @@ "group": "WM_DEBUG_FOCUS", "at": "com\/android\/server\/wm\/DisplayContent.java" }, "-1136467585": { "message": "The listener does not exist.", "level": "INFO", "group": "WM_DEBUG_ADD_REMOVE", "at": "com\/android\/server\/wm\/WindowContextListenerController.java" }, "-1136139407": { "message": "no-history finish of %s", "level": "DEBUG", Loading Loading @@ -1819,6 +1831,18 @@ "group": "WM_DEBUG_TASKS", "at": "com\/android\/server\/wm\/ActivityTaskManagerService.java" }, "90764070": { "message": "Could not report token removal to the window token client.", "level": "WARN", "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowContextListenerController.java" }, "91350919": { "message": "Attempted to set IME flag to a display that does not exist: %d", "level": "WARN", "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "94402792": { "message": "Moving to RESUMED: %s (in existing)", "level": "VERBOSE", Loading Loading @@ -1963,6 +1987,12 @@ "group": "WM_DEBUG_WINDOW_ORGANIZER", "at": "com\/android\/server\/wm\/TaskOrganizerController.java" }, "236210101": { "message": "registerWindowContextListener: trying to add listener to a non-existing display:%d", "level": "WARN", "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowManagerService.java" }, "241961619": { "message": "Adding %s to %s", "level": "VERBOSE", Loading Loading @@ -3403,6 +3433,12 @@ "group": "WM_DEBUG_TASKS", "at": "com\/android\/server\/wm\/RootWindowContainer.java" }, "1948483534": { "message": "Could not report config changes to the window token client.", "level": "WARN", "group": "WM_ERROR", "at": "com\/android\/server\/wm\/WindowContextListenerController.java" }, "1964565370": { "message": "Starting remote animation", "level": "INFO", Loading
services/core/java/com/android/server/wm/ConfigurationContainerListener.java +1 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,7 @@ import android.content.res.Configuration; */ public interface ConfigurationContainerListener { /** {@see ConfigurationContainer#onRequestedOverrideConfigurationChanged} */ /** @see ConfigurationContainer#onRequestedOverrideConfigurationChanged */ default void onRequestedOverrideConfigurationChanged(Configuration overrideConfiguration) {} /** Called when new merged override configuration is reported. */ Loading
services/core/java/com/android/server/wm/DisplayAreaPolicy.java +5 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ import static com.android.server.wm.DisplayAreaPolicyBuilder.Feature; import static com.android.server.wm.DisplayAreaPolicyBuilder.HierarchyBuilder; import android.content.res.Resources; import android.os.Bundle; import android.text.TextUtils; import java.util.ArrayList; Loading Loading @@ -71,6 +72,10 @@ public abstract class DisplayAreaPolicy { */ public abstract void addWindow(WindowToken token); /** Gets the {@link DisplayArea} which a {@link WindowToken} is about to be attached to. */ public abstract DisplayArea.Tokens getDisplayAreaForWindowToken(int type, Bundle options, boolean ownerCanManageAppTokens, boolean roundedCornerOverlay); /** * Gets the set of {@link DisplayArea} that are created for the given feature to apply to. */ Loading
services/core/java/com/android/server/wm/DisplayAreaPolicyBuilder.java +17 −9 Original line number Diff line number Diff line Loading @@ -137,12 +137,12 @@ class DisplayAreaPolicyBuilder { private ArrayList<HierarchyBuilder> mDisplayAreaGroupHierarchyBuilders = new ArrayList<>(); /** * When a window is created, the policy will use this function to select the * {@link RootDisplayArea} to place that window in. The selected root can be either the one of * the {@link #mRootHierarchyBuilder} or the one of any of the * When a window is created, the policy will use this function, which takes window type and * options, to select the {@link RootDisplayArea} to place that window in. The selected root * can be either the one of the {@link #mRootHierarchyBuilder} or the one of any of the * {@link #mDisplayAreaGroupHierarchyBuilders}. **/ @Nullable private BiFunction<WindowToken, Bundle, RootDisplayArea> mSelectRootForWindowFunc; @Nullable private BiFunction<Integer, Bundle, RootDisplayArea> mSelectRootForWindowFunc; /** Defines the root hierarchy for the whole logical display. */ DisplayAreaPolicyBuilder setRootHierarchy(HierarchyBuilder rootHierarchyBuilder) { Loading @@ -162,7 +162,7 @@ class DisplayAreaPolicyBuilder { /** The policy will use this function to find the root to place windows in. */ DisplayAreaPolicyBuilder setSelectRootForWindowFunc( BiFunction<WindowToken, Bundle, RootDisplayArea> selectRootForWindowFunc) { BiFunction<Integer, Bundle, RootDisplayArea> selectRootForWindowFunc) { mSelectRootForWindowFunc = selectRootForWindowFunc; return this; } Loading Loading @@ -655,19 +655,19 @@ class DisplayAreaPolicyBuilder { static class Result extends DisplayAreaPolicy { final List<RootDisplayArea> mDisplayAreaGroupRoots; final BiFunction<WindowToken, Bundle, RootDisplayArea> mSelectRootForWindowFunc; final BiFunction<Integer, Bundle, RootDisplayArea> mSelectRootForWindowFunc; private final TaskDisplayArea mDefaultTaskDisplayArea; Result(WindowManagerService wmService, RootDisplayArea root, List<RootDisplayArea> displayAreaGroupRoots, @Nullable BiFunction<WindowToken, Bundle, RootDisplayArea> @Nullable BiFunction<Integer, Bundle, RootDisplayArea> selectRootForWindowFunc) { super(wmService, root); mDisplayAreaGroupRoots = Collections.unmodifiableList(displayAreaGroupRoots); mSelectRootForWindowFunc = selectRootForWindowFunc == null // Always return the highest level root of the logical display when the func is // not specified. ? (window, options) -> mRoot ? (type, options) -> mRoot : selectRootForWindowFunc; // Cache the default TaskDisplayArea for quick access. Loading @@ -689,7 +689,8 @@ class DisplayAreaPolicyBuilder { @VisibleForTesting DisplayArea.Tokens findAreaForToken(WindowToken token) { return mSelectRootForWindowFunc.apply(token, token.mOptions).findAreaForToken(token); return mSelectRootForWindowFunc.apply(token.windowType, token.mOptions) .findAreaForToken(token); } @VisibleForTesting Loading Loading @@ -727,6 +728,13 @@ class DisplayAreaPolicyBuilder { public TaskDisplayArea getDefaultTaskDisplayArea() { return mDefaultTaskDisplayArea; } @Override public DisplayArea.Tokens getDisplayAreaForWindowToken(int type, Bundle options, boolean ownerCanManageAppTokens, boolean roundedCornerOverlay) { return mSelectRootForWindowFunc.apply(type, options).findAreaForToken(type, ownerCanManageAppTokens, roundedCornerOverlay); } } static class PendingArea { Loading