summaryrefslogtreecommitdiff
path: root/packages/SystemUI/src/com/android/systemui/accessibility/WindowMagnification.java
Commit message (Collapse)AuthorAgeFilesLines
* [DO NOT MERGE] Add centralized DisplayTracker for SystemUIAlex Stetson2023-01-261-3/+7
| | | | | | | | | | | | In multi-user multi-display systems where there could be multiple SystemUI instances running, the concept of what displays are relevant for a particular SystemUI may change. By adding a DisplayTracker class to abstract away display retrieval and callbacks, these instances can return the information that is most accurate for them. Bug: 256236871 Test: atest SystemUITests Change-Id: I51c1a380a344fb45d5e0de2c5c6ba5610733a3a2
* Make CoreStartable an Interface.Dave Mankoff2022-10-131-2/+3
| | | | | | | | | Context is no longer passed in as a constructor arg. Bug: 229228871 Test: manual Change-Id: I3dd5e593f209d120eb36faf33ba629a2066ad3f5 Merged-In: I3dd5e593f209d120eb36faf33ba629a2066ad3f5
* Remove FileDescriptor from systemui.Dumpable.Dave Mankoff2022-04-051-2/+1
| | | | | | | | | | This is the first step in moving over to the new public android.util.Dumpable api. Bug: 217567642 Test: m SystemUI Merged-In: Ibaebcfb2c6c5326d0c45b8c72d868c76655d89a0 Change-Id: Ibaebcfb2c6c5326d0c45b8c72d868c76655d89a0
* Disables tracking focus on move a11y actions.Daniel Hsieh2022-03-011-2/+2
| | | | | | | | | | | | | | After a user perform a11y action, namely moving up/down/left/right, we have to disable tracking focus functionality. We refactor #onDrag to a more general term #onMove to cover any move action which has to disable tracking focus functionality. Bug: 218935435 Test: atest WindowMagnificationTest atest WindowMagnificationControllerTest atest WindowMagnificationManagerTest Change-Id: I578b301645a08c71e874fe2f4fcf2557202abefd
* Adds moveWindowMagnifierToPosition methodDaniel Hsieh2022-03-011-0/+11
| | | | | | | | | | | | | | | | | | | | | | For following typing focus feature, we add a moveWindowMagnifierToPosition method for a window magnifier to move it to the center of onRectangleOnScreenRequested. Apart from calling this method to fulfill movement functionality, we can separate the movement from calling enableWindowMagnification which is a temporary replacement for movement functionality. Therefore, we can distinguish whether the it is enabled by the first time or the further movement behavior. It would help us differentiate the condition whether we should reset the following typing focus to on/off state. (b/216394179) Bug: 219654280 Test: atest IWindowMagnificationConnectionTest atest WindowMagnificationTest atest WindowMagnificationAnimationControllerTest atest WindowMagnificationControllerTest atest WindowMagnificationConnectionWrapperTest atest WindowMagnificationManagerTest Change-Id: Iaac3ca6868d948571c1aee54a5f122c9697059d8
* Fix incorrect magnification window size when the dvice is foldedryanlwlin2022-01-201-15/+0
| | | | | | | | | | | | | | | | | | | When the foldable is folded /unfolded, we will refetch the display size to compute the appropriate the window size. The signal of display size changed is from onConfigurationChanged which is invoked by Application context. However, we get the display size from the WindowContxt. To fix it, we register the callback with the WindowContext based on the view visiblty, and update the configuration related values before showing the window. Test: manual test atest com.android.systemui.accessibility Bug: 213958569 Bug: 214318642 Change-Id: Ic98f782f98b9c29f58d08e064985da731e13aa93
* Support following typing foucs in window mode [2/n].Daniel Hsieh2022-01-051-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are 3 milestones in this feature. 1. Refactor the callbacks for Accessibility in WindowManagerInternal. 2. Implement this feature in such new architecture. 3. Implement the setting choice in preference page. This CL is for the 2nd milestone. We move the window magnification to the typing focus' center position based on the condition of whether a user takes control or not. We only make a movement when the control is not taken by a user or we don't preform the movement for the window magnification. There are 2 methods for a user to take the control. 1. A user use 1 finger to drag the window magnification. 2. A user use 2 finger to drag the window magnification. There is 1 method for a user to release the control. 1. When IME is shown, the control would be released. So, we can decide whether we should make a movement to typing focus given the condition of who take the control. Bug: 194668976 Test: atest MagnificationControllerTest atest WindowMagnificationTest atest WindowMagnificationControllerTest atest WindowMagnificationManagerTest Change-Id: I145f893d412b74c20afe1685449370d1dba99961
* Support triple-tap and hold for window magnification.Daniel Hsieh2021-11-261-2/+3
| | | | | | | | | | | | | | | | | | | 1. Detect triple-tap and hold gesture. 2. Magnify the content at a user's tap location. 3. Offset the frame to the top-left position about a half of frame size 4. The definition and the implementation of WindowMagnificationController's getCenterX and getCenterY are different due to these patches. We need to correct them. (ref: b/207812394) Bug: 202465806 Test: atest IWindowMagnificationConnectionTest atest MagnificationControllerTest atest WindowMagnificationAnimationControllerTest (@Ignore) atest WindowMagnificationConnectionWrapperTest atest WindowMagnificationControllerTest atest WindowMagnificationGestureHandlerTest atest WindowMagnificationManagerTest Change-Id: I59bf8a3e35e42c963de1698bec915a4a590e5c5f
* Refactoring that make WindowMagnificationController has ↵mincheli2021-11-171-32/+33
| | | | | | | | | | | | | | | | | | | | | | | WindowMagnificationAnimationController It reverses the relationship between WindowMagnificationAnimationController and WindowMagnificationController to simplify the further changes. 1. WindowMagnificationController has WindowMagnificationAnimationController instance. WindowMagnificationController is able to know if window magnifier is animating or not. If it is animating, the setScale() action or moveMagnifier() will be interrupted. 2. ControllerSupplier supplies WindowMagnificationController in WindowMagnification.class. Bug: 206734640 Test: atest IWindowMagnificationConnectionTest, atest WindowMagnificationAnimationControllerTest, atest WindowMagnificationControllerTest, atest WindowMagnificationTest, Change-Id: Ibe3471dc99d1aed506b3fd04d12131321d82a07a
* Merge "Rename SystemUI class to CoreStartable"Dave Mankoff2021-11-101-2/+2
|\
| * Rename SystemUI class to CoreStartableDave Mankoff2021-11-091-2/+2
| | | | | | | | | | | | Bug: 205725937 Test: manual Change-Id: I045a8b4b21cae0f4a6e61502384e2b1a607bc1c6
* | Support individual magnification mode for each displayryanlwlin2021-11-101-0/+3
|/ | | | | | | | | | | | | Currently we only have a globale magnification mode which is stored in settings. It ends up the mode is shared between multi-displays. To provide better experience, we store the mode for each none-default display until the device reboot, and the default mode is full-screen. Test: atest com.android.server.accessibility atest com.android.systemui.accessibility Bug: 194667380 Change-Id: I099e1ee945938aac07cc079f68bccbc745d40b08
* WindowMagnificationController uses window context by display to support ↵mincheli2021-07-091-1/+1
| | | | | | | | multi-display feature Bug: 144080869 Test: atest WindowMagnificationController Change-Id: Ia1b81e9ad54dbdf08ab360aa0fb2ae7915709663
* Fix hard dragging the window magnification from the bottom of the screenryanlwlin2021-05-111-19/+47
| | | | | | | | | | | | | | | | | | | | The window magnifier is hard to drag when it is at the bottom of the screen. This is due to that launcher is detecting swipe-up system gesture. To fix it, we set the system ui state flag to true when the window is overlapped with the gesture detection area. We also update the gesture dection area via OnApplyWindowInsetsListener Once the area is changed, we will update the flag again if necessary. In the testing part, we use real WindowManager to verify the functionality. Bug: 179648683 Test: atest com.android.systemui.accessibility manually test and use the following command to check the flag adb shell dumpsys activity service TouchInteractionService Change-Id: Ia09bd26b3eb164790614c173594d997d45f4ecdc
* Updates magnification button after an accessibility action is performedmincheli2021-04-071-0/+7
| | | | | | | | | | | | | | | | | | To switch magnification mode, a user has to click the magnifcation button UI. However magnification button UI is visible only when there is an user touch interaction or the magnification shortcut triggered event. However some a11y services like switch-access or voice-access can only interact with magnification UI by performing accessibility actions. To make magnification button showing and able to interact with a user, we also trigger updating magnification button UI when an accessibility action is performed. Bug: 179442890 Test: atest WindowMagnificationControllerTest; atest WindowMagnificationTest;atest MagnificationControllerTest;atest WindowMagnificationManagerTest Change-Id: I8d762096c9cb6a4421d024a7a1af99b3a48a3462
* Change context to WindowContext for non-activity windowryanlwlin2021-03-181-4/+5
| | | | | | | | | | | Currently the window bounds of an non-acitivty window depends on the display area bounds. We need to change to this windowContext to get the correct windowmetrics for the further display area feature support. Bug: 180054792 Test: atest com.android.systemui.accessibility Change-Id: I0f995f745e7f6cb4ac3616d04c1a65e2e69b8043
* Window magnification supports multi-display in systemUImincheli2020-11-101-20/+65
| | | | | | Bug: 144080869 Test: atest IWindowMagnificationConnectionTest Change-Id: I55e32ce5d15589ac2091f971587c7355fd9be475
* Moves WindowMagnificationConnectionImpl.class outside of WindowMagnificationmincheli2020-11-091-95/+0
| | | | | | Bug: 144080869 Test: none Change-Id: Id53cbdce4cec4a006978fbb93ea1b2635b8a56f0
* Merge "Handles magnification scale change when requesting Accessibility action"Minche Li2020-11-051-0/+17
|\
| * Handles magnification scale change when requesting Accessibility actionmincheli2020-10-221-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The magnification sale should be consistent between a11y framework and systemUi. So when a user requests to perfom scale a11y action by systemUi, We need to handle it in Framework to ensure consistency of the magnification scale. Bug: 170791657 Test: atest WindowMagnificationTest WindowMagnificationManagerTest WindowMagnificationControllerTest MagnificationControllerTest Change-Id: Iaa34e66f29b320be971d416ce38d770b2265915f Change-Id: I0598accefd62a8cefd93bda6163ac704fdd96cba
* | set accessibility window titleryanlwlin2020-10-301-1/+2
|/ | | | | | | | | | | | | We apply same accessibility window title to all magnification-related windows including magnification window and magnification mode switch. Bug: 170790760 Bug: 170790395 Test: enable Talkback to test manually and also change the language. atest MagnificationModeSwitchTest atest WindowMagnificationControllerTest Change-Id: I3fedc5c1ac7597005421f61c7159ddfc9a278772
* Applies Accessibility UI timeout for showing duration of magnification buttonmincheli2020-10-141-2/+1
| | | | | | | | | | | | Users can change Time to take action (Accessibility timeout) settings to make the magnification button showing duration aligned with recommended a11y UI timeout. Settings Page: Settings > Accessibility settings > Time to take action. Demo video: b/167977099#comment2 Bug: 167977099 Test: atest MagnificationModeSwitchTest Change-Id: I428b9d8221854edc476fcd455f3b9114b6b97ae9
* Magnification window should not block bottom navigation barmincheli2020-09-301-1/+6
| | | | | | | | | | | | | To prevent a dragging gesture from misdetecting as a swipe up gesture when moving the magnification window from the bottom navigation bar, the magnification window should not overlapped the gesture-detection region of the bottom navigation bar. So we have to constrain the position of the magnification window if the navigation bar mode is NAV_BAR_MODE_2BUTTON or NAV_BAR_MODE_GESTURAL. Bug: 151394480 Test: atest com.android.systemui.accessibility Change-Id: If0e3b8bcdcde8ce218e6f5087922783be6ab80c3
* Change magnification animation callback (2/2)ryanlwlin2020-09-151-10/+11
| | | | | | | | | | We send callback when the animation is canceled/reversed due to the new quest while animating. Bug: 161669184 Test: atest com.android.systemui.accessibility atest com.android.server.accessibility.magnification Change-Id: Iecd5e1bcf0ac097d4271ff0d277872b1dab0c63d
* Add callback for enabling/disabling window magnificationryanlwlin2020-08-261-8/+14
| | | | | | | | | | | | To support switching magnification mode, we add callback to know when the animation is finished. We only invoke the newest callback when the animation is end successfully or the spec didn't change Bug: 161669184 Test: atest com.android.systemui.accessibility atest com.android.server.accessibility.magnification Enable window magnification to see if it works normally Change-Id: I34ce39d133a000964d1089946b7bcf510a618b40
* 6/N Move everything into SysUIComponent.Dave Mankoff2020-08-161-2/+2
| | | | | | | | | | | | | | | It is far easier to move _everything_ into SysUIComponent, and then selectively promote things back to GlobalScope and/or WMScope than it is to try to do it one at a time. With this change, though lots of files are touched, very little actually changes structurally. After this change goes in, folks should stop using @Singleton quite so freely. Most things should live in @SysuiSingleton. @Singleton is due to quickly be replaced by @GlobalScope. Bug: 162923491 Test: atest SystemUITests && manual Change-Id: Idc31d3d83b030581fb1fa869f7fafc4f2d3a8828
* Add WindowMagnificationAnimationController for animationryanlwlin2020-08-071-23/+12
| | | | | | | | | | | | | | | | | WindowMagnificationAnimationController provides same functionality but it runs the animation while enabling/disabling. This new patch also fixs NPE excetion that happens when device is in rotation but mirrorWindow is invisible. Bug: 161669184 163026794 163035371 Test: atest com.android.systemui.accessibility atest WindowMagnificationGestureHandlerTest manual Test: enable window magnification to see it 2. close mirroe window and rotate the device Change-Id: I4531f5c96ea4b91b287cc8c5ffc4c98fc9611dd5
* Revert "Add WindowMagnificationBridge for animation"Greg Kaiser2020-08-061-12/+23
| | | | | | | | | | This reverts commit 1e14e16ac8953e58e03fb6f5648ddf5f20dcb125. Reason for revert: Breaks fullscreen YouTube playback on wembley Bug: 163035371 Test: Locally reverted, and now YouTube can play fullscreen on a wembley Change-Id: I649d651893862b270cb1df14633490748a54bda1
* Add WindowMagnificationBridge for animationryanlwlin2020-08-041-23/+12
| | | | | | | | | | | | WindowMagnificationBridge provides same functionality but it runs the animation while enabling/disabling. Bug: 161669184 Test: atest com.android.systemui.accessibility atest WindowMagnificationGestureHandlerTest manual Test: enable window magnification to see it Change-Id: Ifdedff335e856ba12209883924032aa545d04738
* Merge "Update magnification button UI when the device configuration is changed"Minche Li2020-07-311-0/+3
|\
| * Update magnification button UI when the device configuration is changedmincheli2020-07-281-0/+3
| | | | | | | | | | | | | | | | | | | | When device screen density is changed, the layout size of magnification button should be updated. Bug: 161199952 Test: atest WindowMagnificationTest Test: atset ModeSwitchesControllerTest Change-Id: I3454e2b0dc1d1bb1073ba02fa2d52fa88e7d65a5
* | Add source bounds change callbackryanlwlin2020-07-281-1/+19
|/ | | | | | | | | Add sourcebounds change callback so that A11yFramwork could know the center. It is also for magnification public API callback Bug: 161669184 Test: WindowMagnificationControllerTest Change-Id: I08c1f9c6f9f5eb540d960c89388b93437d79871a
* Makes dragging window magnification smoother on low-medium devicemincheli2020-06-241-1/+4
| | | | | | | | | | | | | It takes some time to update the geometry of the mirror window of window magnification. If the peformance of the device is not so good, the dragging of window magnification would looks sluggish. To improve this, we use Choreographer to update the mirror view geometry. It make the refresh rate sync with display frame rendering. Bug: 158264842 Test: atest WindowMagnificationControllerTest Change-Id: Ia2eaca85ccec90b735dab9114c58a94108cdbed1
* Implement magnification switch button (2/n)mincheli2020-05-111-7/+11
| | | | | | | | | | | | This change implements showMagnificationButton and removeMagnificationButton methods. In the later changes, these methods will be called when the magnification capability is ACCESSIBILITY_MAGNIFICATION_MODE_ALL and the magnification scale is changed. Bug: 145780606 Test: atest ModeSwitchesControllerTest IWindowMagnificationConnectionTest Change-Id: I4f6862881ff8a5ab4bbf8aa1346a72364db57321
* Adds interface to show magnification button for System UImincheli2020-04-161-0/+12
| | | | | | | | | | | | This change just add the interface and the method. We'll apply this change in the later change. So that magnification button UI will be updated by showMagnificationButton() when magnification mode or capability settings changed. Bug: 145780606 Test: atest WindowMagnificationConnectionWrapperTest WindowMagnificationManagerTest Change-Id: I544b03f62a0a67318585620db61caaa6dc213206
* Request connection for window magnificationryanlwlin2020-04-101-35/+0
| | | | | | | | | | request window magnification connection through IstatusBar only when magnification mode is window and magnification state is enabled. Bug: 152578960 Test: WindowMagnificationManagerTest Change-Id: I4e00448d9b64f9fd04fa5a5758bd41b2d2c8352f
* Replaces AsyncTask with main handler for WindowMagnificationmincheli2020-03-251-1/+2
| | | | | | | | | | | | | | AsyncTask is deprecated so we use main handler instead to return callback, onWindowMagnifierBoundsChanged. And this change also add a null protection and unregister OnLayoutChangeListener when window magnification is disabled. And it can prevent null pointer exception. Bug: 151394161 Bug: 151571627 Test: manual test, atest WindowMagnificationTest WindowMagnificationControllerTest Change-Id: I421424582d8bad9e58fe5aca11feb75a31bd5b35
* Add method to request window magnification connectionryanlwlin2020-03-111-6/+43
| | | | | | | | | | This method is used by Accessibility framwork to request window magnification connection. When it is called, the connection will be set by AccessibilityManager#setWindowMagnificationConnection. Bug: 136250281 Test: IWindowMagnificationConnectionTest, WindowMagnificationTest Change-Id: Ib4b3c6d7cf90a6c2c1d26029f990285466ff6419
* Implmented the aidl interface for window magnificationryanlwlin2020-03-041-6/+110
| | | | | | | | | | | Implemented WindowMagnificationConnectionImpl in WindowMagnification. All requestes should post to main thread to change the UI. This interface will be created when getting the request from Accessibility Framework. Bug: 146400227 Test: manual test Change-Id: I0b6033dca3d53e7d271b84a5a3008dccf7447d71
* Update mirror window location when orientation changedmincheli2020-02-241-1/+4
| | | | | | | | | | | | The postion of mirror window on the screen would be moved when the device is rotated because of the x and y of layout params are fixed. To keep mirror window visually unmoved, we have to update layoutparams of mirror window. Bug: 147707737 Bug: 146609741 Test: adb shell settings put secure window_magnification 1 Change-Id: I003d578d67c69792c25a580824e933393ef80949
* Extract Mirror windowcontrol to a single classryanlwlin2020-02-121-1/+1
| | | | | | | | | | To change control UI and make if more flexible, we extract to a single class to adapt new UI requirement. Bug: 143745827 Test: MirrorWindowControlTest Test: WindowMagnificationControllerTest Change-Id: I0dc141bed293d485357c5347d04d9abd46a010ff
* Update window magnifier UI when onConfigurationChanged. (1/n)mincheli2020-01-161-0/+17
| | | | | | | | | | | This change would update UI when the display size is changed. In the later changes, we will handle the case for device orientation changed or a physical display is updated. And we have to keep the mafnification area unchanged when the UI is updated. Bug: 144664540 Test: manual test Change-Id: I7cfac77e1d74c709013c9ed07600051ee9a34097
* Conslidate @MainHandler and similar to @Main (and similar).Dave Mankoff2019-12-201-2/+2
| | | | | | | | | | | | @MainHandler, @MainLooper, @MainResources -> @Main @BgHandler, @BgLooper -> @Background. Also, move the providers for Handlers and Loopers into the ConcurrencyModule. Bug: 146510722 Test: atest SystemUITests Change-Id: I991735e1fdca397784427409a2ae696a7374f584
* Added WindowMagnification for Accessibility in System UIchaviw2019-12-161-0/+83
Added support for window magnification as an accessibility feature. The UI can either be dragged to a new a location or arrow controls can move the window around. Test: adb shell settings put secure window_magnification 1 Bug: 136250281 Change-Id: If3098df098f2a1b88b2170e773dccc8f86946abf