diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-12-10 18:29:24 -0800 |
---|---|---|
committer | Svetoslav Ganov <svetoslavganov@google.com> | 2012-12-14 16:27:27 -0800 |
commit | 545252f4fde6fbb70b07e97a120c7d1405758017 (patch) | |
tree | e3238e5262e77cd91751c2302c30d828c539c55c /core/java/android/view | |
parent | 224333c03f1a9e14fce09207dc15d06365bf917b (diff) | |
download | frameworks_base-545252f4fde6fbb70b07e97a120c7d1405758017.zip frameworks_base-545252f4fde6fbb70b07e97a120c7d1405758017.tar.gz frameworks_base-545252f4fde6fbb70b07e97a120c7d1405758017.tar.bz2 |
Refactoring of the screen magnification feature.
1. This patch takes care of the case where a magnified window is covering an unmagnigied
one. One example is a dialog that covers the IME window.
bug:7634430
2. Ensuring that the UI automator tool can connect and correctly dump the screen.
bug:7694696
3. Removed the partial implementation for multi display magnification. It adds
unnecessary complexity since it cannot be implemented without support for
input from multiple screens. We will revisit when necessary.
4. Moved the magnified border window as a surface in the window manager.
5. Moved the mediator APIs on the window manager and the policy methods on the
WindowManagerPolicy.
6. Implemented batch event processing for the accessibility input filter.
Change-Id: I4ebf68b94fb07201e124794f69611ece388ec116
Diffstat (limited to 'core/java/android/view')
-rw-r--r-- | core/java/android/view/IDisplayMagnificationMediator.aidl | 31 | ||||
-rw-r--r-- | core/java/android/view/IMagnificationCallbacks.aidl (renamed from core/java/android/view/IDisplayMagnificationController.aidl) | 6 | ||||
-rw-r--r-- | core/java/android/view/IWindowManager.aidl | 33 | ||||
-rw-r--r-- | core/java/android/view/MagnificationSpec.java | 3 | ||||
-rw-r--r-- | core/java/android/view/Surface.java | 2 | ||||
-rw-r--r-- | core/java/android/view/WindowManagerPolicy.java | 19 |
6 files changed, 55 insertions, 39 deletions
diff --git a/core/java/android/view/IDisplayMagnificationMediator.aidl b/core/java/android/view/IDisplayMagnificationMediator.aidl deleted file mode 100644 index aa25dac..0000000 --- a/core/java/android/view/IDisplayMagnificationMediator.aidl +++ /dev/null @@ -1,31 +0,0 @@ -/* -** Copyright 2012, 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.IDisplayMagnificationController; -import android.view.MagnificationSpec; - -/** - * {@hide} - */ -interface IDisplayMagnificationMediator { - void addController(int displayId, in IDisplayMagnificationController controller); - void removeController(in IDisplayMagnificationController controller); - void setMagnificationSpec(in IDisplayMagnificationController controller, - in MagnificationSpec spec); - MagnificationSpec getCompatibleMagnificationSpec(in IBinder windowToken); -} diff --git a/core/java/android/view/IDisplayMagnificationController.aidl b/core/java/android/view/IMagnificationCallbacks.aidl index efe2775..032d073 100644 --- a/core/java/android/view/IDisplayMagnificationController.aidl +++ b/core/java/android/view/IMagnificationCallbacks.aidl @@ -16,11 +16,13 @@ package android.view; +import android.graphics.Region; + /** * {@hide} */ -oneway interface IDisplayMagnificationController { - void onMagnifedFrameChanged(int left, int top, int right, int bottom); +oneway interface IMagnificationCallbacks { + void onMagnifedBoundsChanged(in Region bounds); void onRectangleOnScreenRequested(int left, int top, int right, int bottom); void onRotationChanged(int rotation); void onUserContextChanged(); diff --git a/core/java/android/view/IWindowManager.aidl b/core/java/android/view/IWindowManager.aidl index 17f04e9..1ee2bb3 100644 --- a/core/java/android/view/IWindowManager.aidl +++ b/core/java/android/view/IWindowManager.aidl @@ -27,7 +27,7 @@ import android.graphics.Rect; import android.os.Bundle; import android.os.IRemoteCallback; import android.view.IApplicationToken; -import android.view.IDisplayMagnificationMediator; +import android.view.IMagnificationCallbacks; import android.view.IOnKeyguardExitResult; import android.view.IRotationWatcher; import android.view.IWindowSession; @@ -226,11 +226,6 @@ interface IWindowManager void setInputFilter(in IInputFilter filter); /** - * Gets the display magnification mediator. - */ - IDisplayMagnificationMediator getDisplayMagnificationMediator(); - - /** * Gets the frame of a window given its token. */ void getWindowFrame(IBinder token, out Rect outFrame); @@ -245,4 +240,30 @@ interface IWindowManager * credentials. */ void showAssistant(); + + /** + * Sets the display magnification callbacks. These callbacks notify + * the client for contextual changes related to display magnification. + * + * @param callbacks The magnification callbacks. + */ + void setMagnificationCallbacks(IMagnificationCallbacks callbacks); + + /** + * Sets the magnification spec to be applied to all windows that can be + * magnified. + * + * @param spec The current magnification spec. + */ + void setMagnificationSpec(in MagnificationSpec spec); + + /** + * Gets the magnification spec for a window given its token. If the + * window has a compatibility scale it is also folded in the returned + * magnification spec. + * + * @param windowToken The unique window token. + * @return The magnification spec if such or null. + */ + MagnificationSpec getCompatibleMagnificationSpecForWindow(in IBinder windowToken); } diff --git a/core/java/android/view/MagnificationSpec.java b/core/java/android/view/MagnificationSpec.java index 7fb5615..0ee6714 100644 --- a/core/java/android/view/MagnificationSpec.java +++ b/core/java/android/view/MagnificationSpec.java @@ -39,6 +39,9 @@ public class MagnificationSpec implements Parcelable { } public void initialize(float scale, float offsetX, float offsetY) { + if (scale < 1) { + throw new IllegalArgumentException("Scale must be greater than or equal to one!"); + } this.scale = scale; this.offsetX = offsetX; this.offsetY = offsetY; diff --git a/core/java/android/view/Surface.java b/core/java/android/view/Surface.java index f2c5eac..a972b75 100644 --- a/core/java/android/view/Surface.java +++ b/core/java/android/view/Surface.java @@ -812,6 +812,8 @@ public class Surface implements Parcelable { * * @param rotation The rotation. * @return The rotation symbolic name. + * + * @hide */ public static String rotationToString(int rotation) { switch (rotation) { diff --git a/core/java/android/view/WindowManagerPolicy.java b/core/java/android/view/WindowManagerPolicy.java index 7bdb44c..47ef638 100644 --- a/core/java/android/view/WindowManagerPolicy.java +++ b/core/java/android/view/WindowManagerPolicy.java @@ -1134,4 +1134,23 @@ public interface WindowManagerPolicy { * {@link android.content.Intent#ACTION_ASSIST} */ public void showAssistant(); + + /** + * Returns whether a given window type can be magnified. + * + * @param windowType The window type. + * @return True if the window can be magnified. + */ + public boolean canMagnifyWindow(int windowType); + + /** + * Returns whether a given window type is considered a top level one. + * A top level window does not have a container, i.e. attached window, + * or if it has a container it is laid out as a top-level window, not + * as a child of its container. + * + * @param windowType The window type. + * @return True if the window is a top level one. + */ + public boolean isTopLevelWindow(int windowType); } |