Commit Graph

11231 Commits

Author SHA1 Message Date
Chavi Weingarten
98364be07e Merge "Revert "ViewRoot: Ensure we release surface from setWindowStopped."" into pi-dev am: 2754777d30
am: 7d710b90ca

Change-Id: Iaaf71070e73603f58bc467a913655948de37e4fb
2018-04-16 10:25:52 -07:00
TreeHugger Robot
2754777d30 Merge "Revert "ViewRoot: Ensure we release surface from setWindowStopped."" into pi-dev 2018-04-16 16:50:48 +00:00
Adrian Roos
c394641b39 Merge changes I478047cc,Ibe16ffd7 into pi-dev am: 892ee93977
am: 21c2c55336

Change-Id: I125d3b4725c299f90531d3a42c8c00a837508b72
2018-04-16 09:25:13 -07:00
Chavi Weingarten
630108fc5f Revert "ViewRoot: Ensure we release surface from setWindowStopped."
This reverts commit 35274cb0ce.

Reason for revert: b/78110749
Fixes: 78110749

Change-Id: Ib1b15e4f7325cb265574090b658514fc0b3c4021
2018-04-16 15:34:45 +00:00
Adrian Roos
535c420139 Cutout: Use stable density for inflating simulated cutouts
Change-Id: Ibe16ffd792040e753d54d7085ba74e8880de111e
Fixes: 77961334
Test: Set density to Very large, enable simulated cutout, verify it still looks reasonable.
2018-04-16 16:21:52 +02:00
Robert Carr
e066da3075 Merge "ViewRoot: Ensure we release surface from setWindowStopped." into pi-dev am: 75bb177d95
am: 576b4e9c02

Change-Id: Ie73218e9555e2182879b7665cb0fafb5820a5bea
2018-04-13 13:00:17 -07:00
TreeHugger Robot
75bb177d95 Merge "ViewRoot: Ensure we release surface from setWindowStopped." into pi-dev 2018-04-13 19:31:52 +00:00
Robert Carr
35274cb0ce ViewRoot: Ensure we release surface from setWindowStopped.
Otherwise, we may attempt to reinitialize the ThreadedRenderer with
a Surface which is not actually valid, e.g. from handleWindowFocusChanged.
Entering a code path where the threaded renderer does not heed the
stopped signal. This change ensures isValid returns false when the Surface
is not valid preventing us from calling initialize/initializeIfNeeded, or
udpateSurface.

Bug: 62536731
Test: For the monkeys.
Change-Id: I65939a29db4db70c6eb6bc4b258a9ed09a86e0ce
2018-04-12 16:08:42 -07:00
Phil Weaver
85be2cdda9 Merge "Move accessibilityHeader from TextView to View" into pi-dev am: 99a238adf1
am: d3adf76761

Change-Id: I7c3045b0a4da4aa9e8d9060d02ec0dafd67f6f33
2018-04-11 20:23:53 -07:00
Phil Weaver
99a238adf1 Merge "Move accessibilityHeader from TextView to View" into pi-dev 2018-04-12 03:07:57 +00:00
Chavi Weingarten
2042446a96 Merge "Synchronize stack position and size update for split screen" into pi-dev am: 9553a11557
am: 5826a2a7ad

Change-Id: Ie8a24f3b8ae0c1fa1d9576118b1404e96dfe184c
2018-04-11 11:13:43 -07:00
Adrian Roos
456eda2b4a Merge "DisplayCutout: Draw anti-aliased bounds in soft overlay" into pi-dev am: 2370f368d4
am: 0c4b2b7f63

Change-Id: I57baa3022ea2228aae19b88bd9524b59690463e9
2018-04-11 10:28:59 -07:00
Phil Weaver
7baf250e50 Merge "Fix AccessibilityEvent#getContentChangeTypes doc" into pi-dev am: 441ef0b94b
am: ca312e6c9f

Change-Id: Ic779890b6d645bf70ed72b25c9d185e0ed602b99
2018-04-11 10:23:46 -07:00
Chavi Weingarten
9553a11557 Merge "Synchronize stack position and size update for split screen" into pi-dev 2018-04-11 16:53:42 +00:00
TreeHugger Robot
2370f368d4 Merge "DisplayCutout: Draw anti-aliased bounds in soft overlay" into pi-dev 2018-04-11 16:44:32 +00:00
Phil Weaver
441ef0b94b Merge "Fix AccessibilityEvent#getContentChangeTypes doc" into pi-dev 2018-04-11 16:38:28 +00:00
Adrian Roos
51072a8b6f DisplayCutout: Draw anti-aliased bounds in soft overlay
To do so, we cannot use the Region from DisplayCutout, because it is conceptionally
a binary Bitmap. Instead, we need the exact curve as a Path.

Also fixes a theoretical bug where the DisplayCutout
was cached even though the display height changed.

Change-Id: I9356f4589186fedc5dc95010c7bd1a1fa20edf5e
Fixes: 77868940
Test: Enable display cutout in developer options, verify the edges look smoth and not jagged.
Test: atest DisplayCutoutTest
2018-04-11 16:12:29 +00:00
Jan Althaus
5d543cc3ba Merge "Minor TextClassifier fixes" into pi-dev am: b6bba33399
am: 796df0800b

Change-Id: I891b94b7bb0862068eab649e9a2f9987e9d58e63
2018-04-11 05:44:20 -07:00
Jan Althaus
b6bba33399 Merge "Minor TextClassifier fixes" into pi-dev 2018-04-11 12:19:43 +00:00
Jan Althaus
13a89c9403 Minor TextClassifier fixes
- Fix incorrect nullable annotation (usage/APIs already correct)
- Fix outdated doc reference
- Fixed visibility of TextClassification fields

Bug: 74461129
Test: N/A
Change-Id: I107cc978c9385ac2ad706fa8e0a8a3ecb215cf36
2018-04-11 13:03:43 +02:00
Phil Weaver
cf18c86c88 Merge "Notify a11y when view attached to parent" into pi-dev am: 7a65c44d03
am: 1c2e91165c

Change-Id: I3978e1bfb6a0e62370651003ba8a3f41d5a1fc65
2018-04-10 19:33:23 -07:00
TreeHugger Robot
7a65c44d03 Merge "Notify a11y when view attached to parent" into pi-dev 2018-04-11 01:49:57 +00:00
chaviw
be43ac8686 Synchronize stack position and size update for split screen
When entering split screen, the secondary window changes position so
it's below the primary split screen when minimized. The WSA at the same
time is also changing size to fit the area. However, the size doesn't
change until the client requests a new size and a frame with the correct
size comes in. This causes the stack to update position before the
resize which causes content to get cut off and then a jump when the resize
completes.

This change updates the WSA position as soon as it recognizes that the
stack changed position due to entering split screen secondary. The WSA
sets its position as the negative of the stack position, making the
calculated window position at (0,0). When a relayout is requested, the
WSA's position is requested back to (0,0), deferring until the new frame.
This will put the WSA position at (0,0) when a frame with the correct size
is drawn. This places the window position at the stack's new position in
the same transaction that a WSA frame with the new size is drawn.

Change-Id: I8c88d7784f827d66926fb5c382af2346028dc48f
Fixes: 74354855
Test: Entering split screen with quick step is smooth
Test: Entering split screen with old launcher still works
2018-04-10 18:11:19 -07:00
Phil Weaver
11fa71845b Move accessibilityHeader from TextView to View
I put it on TextView to try to scope it as narrowly
as possible, but an ImageView could be a heading, as
could a LinearLayout that holds a TextView (like a
preference).

Bug: 77726494
Test: atest CtsAccessibilityServiceTestCases
Change-Id: I9313ce6de25b5893db450f23499b151a4f08afda
2018-04-10 17:59:03 -07:00
Eugene Susla
fd34bcc397 Merge "[DO NOT MERGE] Avoid sending content changed a11y events from wrong views" into pi-dev 2018-04-10 20:18:09 +00:00
TreeHugger Robot
413a3c3812 Merge "Remove dead code" 2018-04-10 01:16:30 +00:00
Phil Weaver
21c6043542 Fix AccessibilityEvent#getContentChangeTypes doc
Bug: 77649040
Test: make
Change-Id: I8716bd37972a5c8c0777640a3264effbaae66667
2018-04-09 17:06:39 -07:00
TreeHugger Robot
1a19481e27 Merge "Deprecate InputMethodUtils#isSystemIme() part 1" 2018-04-09 22:02:46 +00:00
John Reck
617673f83f Remove dead code
Remove an old protobuf serialization experiement, skp capture
does this better

Test: builds

Change-Id: Icd875eabee6b517729f901841e48e579d0e8de4d
2018-04-09 14:50:40 -07:00
Jan Althaus
5c181fb2ec Merge "Fixing broken logging of OTHER events" into pi-dev am: 706edbd776
am: 1a1ff74bb6

Change-Id: Id275954847b2ed6d2389f1aad7b5c210971410b4
2018-04-09 06:29:19 -07:00
Jan Althaus
706edbd776 Merge "Fixing broken logging of OTHER events" into pi-dev 2018-04-09 13:09:55 +00:00
TreeHugger Robot
ef5bb6fd70 Merge "Add haptic constants" into pi-dev 2018-04-09 11:26:20 +00:00
Clara Bayarri
536720ab31 Merge "Fix crash when modifying Selection" into pi-dev am: 1f2c6dea41
am: 82b8682922

Change-Id: I092f67aa3422b9a09ab969c3a2a794e62222dcc8
2018-04-09 02:48:41 -07:00
TreeHugger Robot
1f2c6dea41 Merge "Fix crash when modifying Selection" into pi-dev 2018-04-09 09:26:42 +00:00
Yohei Yukawa
fd70fe8fe1 Deprecate InputMethodUtils#isSystemIme() part 1
There are not a small number of files that import InputMethodUtils
just to use InputMethodUtils#isSystemIme() is necessary.

In order to make InputMethodUtils purely an internal utility library,
it would make much more sense if the logic is implemented as a private
API of InputMethodInfo, like methods like
InputMethodInfo#isAuxiliaryIme(), rather than in a static method of
InputMethodUtils.

This is a purely mechanical refactoring.  There should be no behavior
change.

Bug: 77730201
Test: atest FrameworksCoreTests:com.android.internal.inputmethod.InputMethodUtilsTest
Change-Id: I9c8518988787b748ebb35fc86fe6beee1d6c633d
2018-04-08 12:19:56 -07:00
Jan Althaus
042228d588 Merge "Remove legacy logger" into pi-dev am: 4f9d750e91
am: 47e3eb3090

Change-Id: Ie67b636931fbf718d35e013631884546e7069960
2018-04-07 05:34:00 -07:00
Jan Althaus
4f9d750e91 Merge "Remove legacy logger" into pi-dev 2018-04-07 12:06:12 +00:00
Jan Althaus
5a03094ebc Remove legacy logger
Migrate DefaultLogger implementation to SelectionSessionLogger.
This cleans up after the API refactor and fixes two bugs:
- All events are currently logged twice.
- Interfaces accept a null signature, but it currently crashes the legacy logger.

Bug: 73392698
Bug: 77659305
Test: atest FrameworksCoreTests:TextClassificationManagerTest
Test: atest FrameworksCoreTests:TextClassificationTest
Test: atest CtsViewTestCases:TextClassificationManagerTest
Test: atest CtsViewTestCases:TextClassifierValueObjectsTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest CtsWidgetTestCases:EditTextTest
Test: Manually examined logs
Change-Id: I0d2b925abf5cab12d71fc2cc0fa527530c86ab10
2018-04-07 12:04:49 +00:00
Jan Althaus
35b3057627 Fixing broken logging of OTHER events
This bug means we never received logs for events like 'Web Search'

Bug: 77659305
Test: atest FrameworksCoreTests:SelectionEventTest
Change-Id: I6f79897f548d0d19710578e309e0b645bb78e1e3
2018-04-07 09:43:41 +02:00
Felipe Leme
79b73e6954 Merge "Autofill should clear the UI filter when a value is updated to null." into pi-dev am: 298fabe6b5
am: b015590d03

Change-Id: Ie41450eae5ebd7f2bca5d63799edd04a83a28b21
2018-04-06 21:18:25 -07:00
TreeHugger Robot
298fabe6b5 Merge "Autofill should clear the UI filter when a value is updated to null." into pi-dev 2018-04-07 03:59:34 +00:00
Felipe Leme
156a7ebf17 Autofill should clear the UI filter when a value is updated to null.
Test: VirtualContainerActivityCompatModeTest:testDatasetFiltering
Fixes: 77652152

Change-Id: Ifc7b8f759684fe35d1aa9218dd39b8dcf7ac4e4f
2018-04-06 18:05:24 -07:00
Jorim Jaggi
0d36292e4e Merge "Early wake-up for transitions (2/2)" into pi-dev am: 4c1453ac45
am: 2e1d841633

Change-Id: Ic0b06664869f6957871f9725c3fe6c90c16e16b9
2018-04-06 15:20:23 -07:00
Jorim Jaggi
4c1453ac45 Merge "Early wake-up for transitions (2/2)" into pi-dev 2018-04-06 21:44:28 +00:00
Eugene Susla
9af1378c82 [DO NOT MERGE] Avoid sending content changed a11y events from wrong views
The root cause of both attached bugs was the tree-merging algorithm in
ViewRootImpl.SendWindowContentChangedAccessibilityEvent converging on a
common predecessor that is marked not View#isImportantForAccessibility.

As a result, such unlucky content changed events were discarded.

Fixes: 72378611, 72950579
Test: ensure attached bugs are fixed
Change-Id: I3c3c66151b6cd4773de4eadd417709e9a61a7cf2
(cherry picked from commit 3fb3c59040)
2018-04-06 20:44:50 +00:00
TreeHugger Robot
cad03a4089 Merge changes from topic "haptic-mapping"
* changes:
  Fallback added for HEAVY_CLICK effect
  Mapping of haptic constants updated
  Add haptic constants
2018-04-06 20:10:35 +00:00
Nader Jawad
236a183e8b Removed call to setWillNotCacheDrawing and deprecated it as well as
willNotCacheDrawing as intermediate caching layers are obsolete since
hardware accelerated rendering was introduced in API 11

ImageView's current implementation of setScaleType would manually
disable it's cache if the ScaleType provided was CENTER. This was end up
not drawing the ImageView if View.LAYER_TYPE_SOFTWARE was configured on
the ImageView as the cache no longer existed. Removed the logic to
conditionally disable the drawing cache and marked
setWillNotCacheDrawing/willNotCacheDrawing as hardware accelerated
rendering makes these facilities obsolete

Fixes: 77653694
Fixes: 72139649
Test: Created a test application with an ImageView and manually set a
ScaleType of CENTER and forced the ImageView to render in a software
layer to confirm that it would render properly with a drawable of the
test application's launcher icon

Change-Id: Ie73b1e0708a265e3cc2cc74ed13539f4219dbd7d
(cherry picked from commit 2ac86880d6)
2018-04-06 17:09:40 +00:00
Nader Jawad
e6df368392 Merge "Removed call to setWillNotCacheDrawing and deprecated it as well as willNotCacheDrawing as intermediate caching layers are obsolete since hardware accelerated rendering was introduced in API 11" 2018-04-06 17:08:07 +00:00
Clara Bayarri
4e51877f5c Fix crash when modifying Selection
The root of this bug was in the fact that Selection.removeSelection
removes two spans, the start index and end index of the selection.
Each span removal triggers Editor#onSpanRemoved, which in turn tries
to set a selection. This meant that if we started with selection
(100, 120), then removeSpan(start) was called, so we had (-1, 120),
then the onSpanRemoved code tried to set a selection so set it to
(120, 120), then removeSpan(end) was called, ending up in (120, -1).

There are two stages to this fix
1. A lot of our code assumes that when either start or end selection
are larger than -1, both are valid. Therefore when we have one of them
out of sync, we crash. Fixed this assumption in all the places I found

2. We didn't have a mechanism to use FLAG_INTERMEDIATE when removing
spans, only when adding them, so this CL adds a remove with flags. This
allows us to not trigger onSpanRemoved when only one of the selection
indexes is removed.
Because this is an added method to an interface, the default just
calls the existing method. The new method is implemented in
SpannableStringInternal and SpannableStringBuilder to read
FLAG_INTERMEDIATE and avoid sending a spans changed event.
Selection.removeSelection then uses FLAG_INTERMEDIATE when removing
the first of the two selection spans.

Note that 2. would be enough to fix the current bug, but we want to
avoid other implementations of Spannable from crashing in the wild.
In general, it seems like a good idea to verify both selection indexes
are valid whenever they are used.

Bug: 72101848
Test: atest FrameworksCoreTests:SpannableStringBuilderTest
Test: atest FrameworksCoreTests:SpannableStringTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest CtsWidgetTestCases:EditTextTest
Test: atest android.text.cts.SelectionTest (note new test as well)
Test: atest android.view.inputmethod.cts.BaseInputConnectionTest
Test: atest android.text.DynamicLayoutTest
Change-Id: I0d647fad152d0bef0f2115a46c3d17ebd8642281
2018-04-06 16:51:53 +01:00
Alexey Kuzmin
1ea7edd77e Add haptic constants
New hidden constants added to HapticFeedbackConstants.
Test: m update-api shows no changes
Bug: 74882420

Merged-in: I164a944b23e958e89b8d3064cb512cee739b27fd
Change-Id: I164a944b23e958e89b8d3064cb512cee739b27fd
2018-04-06 14:55:52 +00:00