Commit Graph

7753 Commits

Author SHA1 Message Date
Selim Cinek
c5ae11b044 Merge "Changed the appearance of phone call notifications" into pi-dev am: e0a25acf08
am: aab697426c

Change-Id: I0ca3ceadf4480b3d1524802d7c1ad0c60e1df2ec
2018-04-12 17:14:20 -07:00
TreeHugger Robot
e0a25acf08 Merge "Changed the appearance of phone call notifications" into pi-dev 2018-04-12 21:01:16 +00:00
Selim Cinek
396cacaaa8 Changed the appearance of phone call notifications
The old design didn't work at all because of various
paddings. The new design adds more paddings and a
new button style

Fixes: 72814598
Test: runtest systemui
Change-Id: I4b4ac0790afe45db97f912740446c6da09620be3
2018-04-12 11:09:23 -07:00
Jeff Sharkey
266ee2b1f1 Merge "Fix broken target SDK checks." into pi-dev am: aab3304a22
am: 87caa7b9ad

Change-Id: I2d0d813284e483b05bf73d5d91fcfa13bce967d8
2018-04-11 21:58:49 -07:00
TreeHugger Robot
aab3304a22 Merge "Fix broken target SDK checks." into pi-dev 2018-04-12 04:40:06 +00: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
Mihai Popa
7cc01055f7 Merge "[Magnifier-39] Hide both handles on overlap" into pi-dev am: aeed443b5b
am: 2bcd41461e

Change-Id: I43c0ad4f2de9dc51ab783051e7cee0f69751f63c
2018-04-11 15:47:57 -07:00
Chet Haase
f24335ec85 Merge "Add targetSdk check around new LinearLayout weighted measure behavior" into pi-dev 2018-04-11 22:17:44 +00:00
Mihai Popa
aeed443b5b Merge "[Magnifier-39] Hide both handles on overlap" into pi-dev 2018-04-11 22:15:35 +00:00
Chet Haase
cb8488822c Add targetSdk check around new LinearLayout weighted measure behavior
Bug: 73827180
Test: Existing CTS tests in LinearLayoutTest
Change-Id: I88dfde3743d0f954cd275be6a0032fe30ef55c03
(cherry picked from commit 28230e5efa)
2018-04-11 16:22:47 +00: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
Jeff Sharkey
aa1a911d9a Fix broken target SDK checks.
Consider an app targeting the final API 28, but running on an older
build where "P" is still API 10000.  Those apps need to be treated as
legacy apps.

In general, the logical pattern that should be used when enforcing
target SDK behaviors is below.

For applying behavior to legacy apps:
    // BROKEN
    if (targetSdkVersion <= Build.VERSION_CODES.N_MR1) {
    // CORRECT
    if (targetSdkVersion < Build.VERSION_CODES.O) {

For applying behavior to new apps:
    // BROKEN
    if (targetSdkVersion > Build.VERSION_CODES.N_MR1) {
    // CORRECT
    if (targetSdkVersion >= Build.VERSION_CODES.O) {

Bug: 77865751
Test: builds, boots
Change-Id: Ia83bd446a940751d51a6542c7a5b9cca174c5296
2018-04-10 15:18:15 -06: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
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
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
Lucas Dupin
39c839978a Merge "Trigger new frame after display is ready to turn on" into pi-dev am: 426095f665
am: e5e6800e8d

Change-Id: I71319efebd3dbf0e96754f47f9eb25e7e39c214e
2018-04-06 08:53:48 -07: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
Mihai Popa
63ee7f1610 [Magnifier-39] Hide both handles on overlap
In general, since text insertion/selection handles are implemented as
PopupWindows, if they get to overlap the magnifier they are going to be
rendered above it. Therefore, we are trying to avoid this case.

Before this CL, we were only hiding the grabbed handle, when this would
overlap the magnifier. Since the magnifier would usually be displayed a
certain offset above the grabbed handle, this could only possibly happen
when there was not enough space for the magnifier above in the current
surface.

However, this is not enough, as in the case of selection, the other
handle could as well overlap the magnifier in certain cases. This CL
intersects the magnifier rectangle with the rectangles of both handles
and detects whether these should hidden or not.

Bug: 76459199
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest
Test: atest FrameworksCoreTests:android.widget.TextViewTest
Change-Id: I22519979eead276dbcf273f7c1a54d654fa251bc
2018-04-06 10:47:38 +01:00
Lucas Dupin
f9583c41dc Trigger new frame after display is ready to turn on
Making sure that a frame will be pushed after the display is ready to
turn on by invaliding the clock after a delay.

Also removed unecessary binder call.

Test: cover prox sensor and wait 1 minute. repeat ~10 times
Change-Id: Ic1b8006781e5486822a5ab65b71b3c44980f2f16
Fixes: 71913808
2018-04-05 22:20:44 -07:00
Nader Jawad
2ac86880d6 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
2018-04-05 16:47:21 -07:00
Mihai Popa
925ea56724 Merge "[Magnifier-38] Avoid deadlock causing ANR" into pi-dev am: 285797a45a
am: da02fac9fe

Change-Id: I8ae04d1f8b6bebc8b1a1a2c01fe9d327b54839ae
2018-04-02 22:45:57 -07:00
Abodunrinwa Toki
dd5bc6f127 Merge "Merge "TextClassifier API updates." into pi-dev am: bf9dfb16be" into pi-dev-plus-aosp
am: 008a5d01af

Change-Id: I4efb43ab74ac98244c6f4145855a75480e2c85b0
2018-04-02 22:20:45 +00:00
Mihai Popa
beaaa3f082 Merge "[Magnifier-36] Fix content clamping inside view" into pi-dev am: 4ab18af48a
am: e5e39b534b

Change-Id: I47394c618e10eb42ae6508f1593f8dc1c4078d90
2018-04-02 20:33:44 +00:00
Mihai Popa
5d983d2ba9 [Magnifier-38] Avoid deadlock causing ANR
A deadlock between the UI and render threads caused by magnifier is
currently making the running app to become not responding. The deadlock
could happen in the following scenario:
1. The UI thread sets a frame callback and asks mRenderer to sync and
draw the current frame. A draw task is enqueued by RenderProxy in the
C++ code
2. The UI thread starts an InternalPopupWindow#destroy() on the UI
thread and acquires mLock
3. mRenderer#destroy() is called on the UI thread, which enqueues a
destroy task in the C++ code. However, this is implemented
synchronously, so the UI thread will wait until the destroy task is
dequeued and executed
4. Since the draw task was enqueued before the destroy task, this will
be executed and the frame callback will be called on the render thread
5. The frame callback tries to acquire mLock. However, this is held by
the UI thread, so the render thread has to wait for it. At the same
time, the UI thread cannot progress either as it is waiting for its
destroy task to execute.

The CL adds a new lock which is used by the UI thread to mark its
intention to #destroy(), such that the render thread will know about
this before trying to acquire mLock and starving.

Bug: 75276625
Test: manual testing
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: Iedf2948350fcf8dd9c819c085b31b7ccaf2db7c5
2018-04-02 18:18:55 +00:00
TreeHugger Robot
bf9dfb16be Merge "TextClassifier API updates." into pi-dev 2018-04-02 09:08:52 +00:00
Abodunrinwa Toki
080c8542b6 TextClassifier API updates.
1. Wraps TC queries in Request objects
2. Adds create/destroyTextClassificationSession system APIs
3. Adds the session Ids to system API calls
4. Change setSignature() to setId() on result objects
5. Plumbing to make the API updates work as things currently work
6. Hide Linkify.addLinksAsync APIs

Bug: 74461129

Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextSelectionTest
Test: bit FrameworksCoreTests:android.view.textclassifier.TextLinksTest

Change-Id: I933ada8b37ef9893331a265e3b4fc08e043f1029
2018-04-01 20:04:47 +01:00
Mihai Popa
6e44808890 [Magnifier-36] Fix content clamping inside view
We try to never display in the magnifier content that does not belong to
the magnified view. If the magnified view has one or more scrollable
containers, these have to be considered in order to find out the visible
portion of the view which is not masked by scrollable containers.

The previous logic for computing the visible region was wrong when one
of the containers was a ViewPager, whose getScrollX() returns the scroll
relative to all pages, rather than the currently visible one as the
logic was expecting. This CL replaces the old logic with a
View#getGlobalVisibleRect().

Bug: 74359490
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: Ib6b63a35436aa691f29c13a0789688f23bfca9f1
2018-04-01 18:59:37 +00:00
Mihai Popa
1f481277cd Merge "[Magnifier-37] Hide handle when overlaps magnifier" into pi-dev am: 3708933872
am: af5d27b174

Change-Id: Ief1ed9510710baec0991174f8c7f0051626b6778
2018-03-30 00:12:17 +00:00
Mihai Popa
b1b423a46f [Magnifier-37] Hide handle when overlaps magnifier
In most cases, the magnifier will be displayed above the current line,
so it will not overlap with the handle being dragged. However, when
there is not enough space in the current surface for the magnifier to be
displayed above the current line, the handle can overlap with the
magnifier. Since the handle is implemented as a different window, we
cannot really control the z ordering between them, and we noticed that
the handle will be rendered over the magnifier, which looks bad. This CL
better handles this situation, by hiding the handle when it would
overlap with the magnifier.

Bug: 76459199
Test: manual testing
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest
Test: atest FrameworksCoreTests:android.widget.TextViewTest
Change-Id: Id5a17fd964360df6094f9e2680e5bcca886c4d2d
2018-03-29 20:04:49 +00:00
Chet Haase
f9767031df Merge "Fix bug and docs assuming progressBar min is 0 instead of getMin()" 2018-03-29 16:43:16 +00:00
Chet Haase
25886a160b Fix bug and docs assuming progressBar min is 0 instead of getMin()
This code and docs predates the existence of get/setMin() on ProgressBar,
should have been updated when we introduced the new min property.

Test: Ran TalkBack
Bug: 74357845
Change-Id: I318f26bb8ecacc5ecdbf7d026d8568f871cf2369
2018-03-28 18:26:53 -07:00
Chet Haase
92b7bc5fbe Merge "Add targetSdk check around new LinearLayout weighted measure behavior" 2018-03-29 01:24:17 +00:00
Abodunrinwa Toki
5e4879c4c2 Merge "Implement Stateful TextClassifier APIs." into pi-dev am: 119d10deb9
am: 12dea84530

Change-Id: I248b3ffff26747f3cb95b6caf44bfcbe8dae10a3
2018-03-29 00:10:10 +00:00
Abodunrinwa Toki
119d10deb9 Merge "Implement Stateful TextClassifier APIs." into pi-dev 2018-03-28 20:58:47 +00:00
Jan Althaus
bd626aa9cb Merge "Change TextClassification to use RemoteActions" into pi-dev am: 08a75e0ee7
am: 39441a9d85

Change-Id: Ib9f44a89c0943eeff54f60f68e1aeb5d83ef3994
2018-03-28 17:35:32 +00:00
Jan Althaus
08a75e0ee7 Merge "Change TextClassification to use RemoteActions" into pi-dev 2018-03-28 17:04:58 +00:00
Jan Althaus
20d346eafe Change TextClassification to use RemoteActions
Behavioural changes:
- Every action now as an icon, and instead hints via RemoteAction whether
  the icon should be shown or not.
- Icons are now taken from the app default, not the activity.
  (That way, we can construct a lightweight resource backed Icon)
- Legacy intents are no longer parceled for security reasons.
  (TextClassificatio wasn't parcelable in O)
- TextClassifications built with the new API will always return null for
  getIntent, but provide a getOnClickListener.
- Accessibility descriptions are now provided for action mode items.

Testing changes:
- Removed URI checks from TCM test because PendingIntent hides this info.

Bug: 73950205
Test: atest FrameworksCoreTests:TextClassificationManagerTest
Test: atest FrameworksCoreTests:TextClassificationTest
Test: atest CtsViewTestCases:TextClassificationManagerTest
Test: atest CtsViewTestCases:TextClassifierValueObjectsTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest CtsWidgetTestCases:EditTextTest
Change-Id: I6706d2c342a8bbb9de0146a48c8b8aac9d9c7d83
2018-03-28 11:41:39 +02:00
Phil Weaver
5dfbbc8249 Merge "Use on-screen text in a11y text changed event" into pi-dev am: ebd87bf395
am: add7cd040e

Change-Id: Ieb7e2306ee4462e900480b2d3d0314f40d5cd4c4
2018-03-28 04:06:16 +00:00
TreeHugger Robot
ebd87bf395 Merge "Use on-screen text in a11y text changed event" into pi-dev 2018-03-28 02:06:27 +00:00
Abodunrinwa Toki
88be5a6cee Implement Stateful TextClassifier APIs.
Outstanding work tbd in other CLs
- Introduce request objects with session Ids
- Implement character based indexing for Selection events.

This CL hides the old Logger API but still keeps running so that we can
check that the modifications to the new API does not break anything.
We will remove the old Logger once we're convinced this is stable.

Please refer to I3c9ceea0863099fc4f0a5ce5e823c648ee9c4521 for previous
reviews related to this CL.

Bug: 74461129
Test: bit FrameworksCoreTests:android.view.textclassifier.TextClassificationManagerTest
Test: bit CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Change-Id: Iea744f1fa5964b4399290c31863ebeffa99af8d3
2018-03-28 02:54:36 +01:00
Phil Weaver
092f754397 Use on-screen text in a11y text changed event
The beforeText in a text changed event was coming from
the underlying CharSequence, not what was on the screen.
As a result, it was not sent for password fields. Now
we just provide whatever is on the screen, which is
obfuscated to the same degree it is for a user looking
at the screen.

Bug: 75324441
Test: Verified with password field in TalkBack sample app.
Also atest CtsAccessibilityServiceTestCases

Change-Id: Ib7a10313d2f9d0e44d2052e81e47f19967a67bc4
2018-03-27 17:07:24 -07:00
Mihai Popa
bfc291acba Merge "[Magnifier-35] Do not show when text is large" into pi-dev am: f45b3a1136
am: c5a25dd6b4

Change-Id: Ic38e08ea0e975bf36d87acea56e2e026ad171ec7
2018-03-27 18:31:08 +00:00
Mihai Popa
894469ce0e [Magnifier-35] Do not show when text is large
There is no point in displaying the magnifier when the text is large
enough. In this CL we are using the font metrics of the TextView to
decide whether the magnifier should be displayed or not.

Bug: 70608551
Test: manual testing
Change-Id: Icb2fb4412b6b930dfb3322e51fd0139152cf9d39
2018-03-27 15:24:11 +00:00
Seigo Nonaka
e0d616424f Merge "Stop using DynamicLayout in case of non selectable PrecomputedText" into pi-dev am: a1ff74c68d
am: b2d133a858

Change-Id: I5669d0b2b4eea79e782e980cd7993d06d5183c49
2018-03-27 01:36:16 +00:00
Abodunrinwa Toki
b1b18064eb Merge "Fix random SmartLinkify-related TextView bugs." into pi-dev am: d982f561cc
am: 62c135418d

Change-Id: Ibf482b7f40eb99ea53d9ed7187beeed0e7ff8195
2018-03-27 00:18:34 +00:00