Commit Graph

11432 Commits

Author SHA1 Message Date
Rhed Jao
54e83cd025 Merge "Fix duplicate a11y focus node in AccessibilityCache." 2018-07-31 02:03:54 +00:00
TreeHugger Robot
afeca1dedf Merge "Add a frame commit callback test API" 2018-07-27 22:42:31 +00:00
TreeHugger Robot
e477cc4c94 Merge "Extract native methods into isolated classes" 2018-07-27 20:44:34 +00:00
Seigo Nonaka
6f11c6e7e2 Extract native methods into isolated classes
StaticLayout/MeasuredParagraph uses native methods which is a pain point
of porting TextView to JetPack.
To make minimize the dependency to the native methods, extract native
methods and put them into a thin wrapper class.

The performance impact is limited:

android.text.StaticLayoutPerfTest:
    PrecomputedText Balanced Hyphenation  :    602 ->    644: ( +42, +7.0%)
    PrecomputedText Balanced NoHyphenation:    457 ->    476: ( +19, +4.2%)
    PrecomputedText Greedy Hyphenation    :    397 ->    412: ( +15, +3.8%)
    PrecomputedText Greedy NoHyphenation  :    397 ->    411: ( +14, +3.5%)
    RandomText Balanced Hyphenation       : 17,594 -> 17,715: (+121, +0.7%)
    RandomText Balanced NoHyphenation     :  7,146 ->  7,236: ( +90, +1.3%)
    RandomText Greedy Hyphenation         :  7,125 ->  7,196: ( +71, +1.0%)
    RandomText Greedy NoHyphenation       :  7,099 ->  7,187: ( +88, +1.2%)
  draw
    PrecomputedText NoStyle               :    614 ->    628: ( +14, +2.3%)
    PrecomputedText Style                 :    778 ->    826: ( +48, +6.2%)
    RandomText NoStyle                    :    537 ->    540: (  +3, +0.6%)
    RandomText Style                      :    786 ->    759: ( -27, -3.4%)

Bug: N/A
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest

Change-Id: I976df4db63be241af395dd30dd94182f76bdae53
2018-07-27 11:08:43 -07:00
John Reck
9ab32f8740 Add a frame commit callback test API
Bug: 111719753
Test: CtsUiRenderingTestCases
Change-Id: Ie08d49b735f5a42a2f06e9049547a2287ecce575
2018-07-27 09:32:08 -07:00
Felipe Leme
2dbf5765de Merge "Created new Settings preferences for internal autofill state." 2018-07-27 16:02:34 +00:00
Rhed Jao
ca9b526022 Fix duplicate a11y focus node in AccessibilityCache.
Change-Id: I2755b6f43b01001a5f8e2e7c164b2e9666d95602
Fixes: 77980418
Test: atest AccessibilityCacheTest
2018-07-27 21:28:43 +08:00
Felipe Leme
68b2222546 Created new Settings preferences for internal autofill state.
Currently, these preferences can only be changed through 'cmd autofill', but
moving them to the Settings provider will let us manage them through the
Settings -> Developer Options screen:

- AUTOFILL_LOGGING_LEVEL
- AUTOFILL_MAX_PARTITIONS_SIZE
- AUTOFILL_MAX_VISIBLE_DATASETS

Test: manual verification
Test: atest CtsAutoFillServiceTestCases FrameworksCoreTests:SettingsBackupTest

Bug: 65700540

Change-Id: I6c864d032bc0b2c3b7c24f300af37883adbaf0d0
2018-07-26 09:18:47 -07:00
Qasid Sadiq
90affed38a Merge "Make comment more inclusive to all a11yServices" 2018-07-26 00:02:57 +00:00
youngmin0822.lee
d673f4f271 Merge "don't call setSize() when creating SurfaceControl" am: 57e98b19be am: e332fe4b3d am: 762b60ce74
am: 607244a1fb

Change-Id: I1b6ef96c0b9f15eda6296e5e9fbdb072f66d9b91
2018-07-24 22:39:05 -07:00
youngmin0822.lee
762b60ce74 Merge "don't call setSize() when creating SurfaceControl" am: 57e98b19be
am: e332fe4b3d

Change-Id: I384dd4a03db135c703e3672037212a970d222689
2018-07-24 22:14:56 -07:00
youngmin0822.lee
e332fe4b3d Merge "don't call setSize() when creating SurfaceControl"
am: 57e98b19be

Change-Id: Iec44550e5c18fa7d3005c8c79e607fc1bc656c13
2018-07-24 22:01:41 -07:00
Qasid Ahmad Sadiq
63eaa47990 Make comment more inclusive to all a11yServices
Test: it builds
Change-Id: I5775abb64a2c781bb60096da9adf72245b846df3
2018-07-24 20:14:18 -07:00
TreeHugger Robot
d618e1dbd9 Merge "Remove unused API on IWindowSession, prepare for multi-display." 2018-07-19 00:45:19 +00:00
Jorim Jaggi
edf3e1fa2e Merge "Move allocateBuffers to RT" into pi-dev am: 2f8a3a4bb8
am: c9756c9193

Change-Id: Ieed40312fe16a54c3e1974621b53e29b23ddcdbc
2018-07-18 15:19:39 -07:00
TreeHugger Robot
74821b569f Merge "Include textclassifier info in dumpsys" 2018-07-18 18:33:31 +00:00
Phil Weaver
0286e7c510 Merge "Fix a11y cache correctness bug" 2018-07-18 17:40:15 +00:00
wilsonshih
70f6ae7649 Remove unused API on IWindowSession, prepare for multi-display.
Scan on code base and found those API are not be used
anymore, and IWindowSession only be used in frameworks. Should be
able to remove them if needed.

Bug:111361793
Test: atest CtsWindowManagerDeviceTestCases
Test: atest CtsActivityManagerDeviceTestCases
Change-Id: Idbf680ae68d21e055d9ccfa33aea4a73891ddd14
2018-07-18 13:10:10 +00:00
Tony Mak
f93e9e5439 Include textclassifier info in dumpsys
Example output:
Text classifier constants=null
TextClassifierImpl:
  Model file(s):
    ModelFile { path=/data/misc/textclassifier/textclassifier.model name=textclassifier.model version=603 locales=en }
    ModelFile { path=/etc/textclassifier/textclassifier.universal.model name=textclassifier.universal.model version=6 locales=und }
    ModelFile { path=/etc/textclassifier/textclassifier.en.model name=textclassifier.en.model version=6 locales=en }
  mFallback=android.view.textclassifier.TextClassifier$1@8269b3
SystemTextClassifier:
  mFallback=android.view.textclassifier.TextClassifierImpl@72dbb70 mPackageName=android mSessionId=null isSystemTextClassifierEnabled=true
TextClassificationConstants:
  isLocalTextClassifierEnabled=true isSystemTextClassifierEnabled=true isModelDarkLaunchEnabled=false isSmartSelectionEnabled=true isSmartTextShareEnabled=true isSmartLinkifyEnabled=true isSmartSelectionAnimationEnabled=true getSuggestSelectionMaxRangeLength=10000 getClassifyTextMaxRangeLength=10000 getGenerateLinksMaxTextLength=100000 getGenerateLinksLogSampleRate=100 getEntityListDefault=[address, email, phone, url, date, datetime, flight] getEntityListNotEditable=[address, email, phone, url, date, datetime, flight] getEntityListEditable=[address, email, phone, url, date, datetime, flight]

FIXES: 111434669

Test: adb shell dumpsys textclassification
Change-Id: If0cbc290034ff51ec31fed1ce08e5bc806603549
2018-07-18 12:35:15 +02:00
Phil Weaver
a4002c8daf Fix a11y cache correctness bug
If two views change, their common ancestor can send
a subtree_changed event. But the cache is dropping
events that come from views that it hasn't cached.

Now clearing the cache entirely when a node not in
the cache sends a subtree changed event, since we
don't know which nodes are descendents and which
may have changed.

I'm not thrilled with this change, since it may
degrade performance, but I want to fix the correctness
problem quickly.

Bug: 111554539
Test: atest AccessibilityCacheTest
Change-Id: Ib32d3622cddd7001663943eff71e823d21f5e500
2018-07-17 15:38:33 -07:00
Jorim Jaggi
7823ee73ee Move allocateBuffers to RT
Such that it gets executed after setSurface, in order that
mReqUsage has the correct flags set.

Test: Take trace, ensure that allocateBuffers actually allocates
in the right format/usage by ensuring that dequeueBuffer doesn't
trash them immediately again.
Bug: 111517695
Change-Id: I94b402d7b29d565155a77a2d09106246261712d2
2018-07-17 17:34:49 +02:00
TreeHugger Robot
aa29832a8b Merge "Make IAutofillManager fully oneway." 2018-07-12 20:31:25 +00:00
TreeHugger Robot
a741f5dca4 Merge "Depecrate flags, and try to match them to actions" 2018-07-12 19:34:40 +00:00
Felipe Leme
d4e52285ed Make IAutofillManager fully oneway.
The critical methods on this interface - like updateSession() - were already
void, so all we had to do were to "onewaywize" the other methods. We could
either refactor them to be truly async, or implement a blocking mechanism that
let them still be sync *and* oneway - because these methods are not in the
critical path, we opted for the latter, which is simpler and less risky.

Fixes: 73536867

Test: mmma -j ./frameworks/base/apct-tests/perftests/autofill/ && \
      adb install -r $OUT/data/app/AutofillPerfTests/AutofillPerfTests.apk && \
      adb shell am instrument -w -e class android.view.autofill.LoginTest \
      com.android.perftests.autofill/android.support.test.runner.AndroidJUnitRunner
Test: CtsAutoFillServiceTestCases

Change-Id: I380430aa2a7805aed6f629afb360566fc5402abb
2018-07-12 10:37:05 -07:00
Jorim Jaggi
511ac80149 DO NOT MERGE Remove WTF spam
Root cause has been identified, but fix is too risky. Instead, we
remove the WTF for now and readd the fix as well as the WTF
in master.

Note that due to defensive programming, in case we land in the WTF
case, it doesn't cause any real bug.

Test: boots
Bug: 110834518
Change-Id: I0da1e48e420c3fcde0e818b7fe0527da9155a159
2018-07-12 12:01:48 +00:00
TreeHugger Robot
daf0e11ca5 Merge "Make sure checking for accessibility pane is consistent" 2018-07-12 02:33:30 +00:00
Felipe Leme
27e1bf3192 Minor logging improvement.
Bug: 77271640
Test: adb logcat

Change-Id: I66de01ebe3b5c09e7ca0e6f07b962e9beeeae1f5
2018-07-10 16:55:20 -07:00
TreeHugger Robot
d57794b1be Merge "Auto-dark mode prototype" 2018-07-10 00:02:26 +00:00
John Reck
9ce2bf7e0c Auto-dark mode prototype
Experimental force_dark prototype mode. Enabled
by setting debug.hwui.force_dark to true.

Test: verified nothing changes without prop being set

Change-Id: Ib02f3f1a9c591cab1f312b827451f04c782c2f41
2018-07-09 10:16:25 -07:00
youngmin0822.lee
4dde7d19cb don't call setSize() when creating SurfaceControl
When SurfaceControl is created with creating variable
in updateSurface(), sizeChanged is also set.
So, setSize() is called, and it blocks UI thread
until the transaction is handled in SF.
There is no need to resize in the creation time,
because size is already set when creating SurfaceControl.

Test: systrace any app including SurfaceView

Change-Id: I65028b4d0d0ba2b75fbe089c98a11a56b6c08104
2018-07-09 15:27:43 +09:00
Siarhei Vishniakou
91fa08ff1b Move displayId into InputEvent
Now both KeyEvent and MotionEvent will contain displayId. This will help
with dispatching input events to specific displays. There are use cases
where a particular input device is used for a specific display only, and
it sends key events to the system. This will help with those usages.

Test: atest view.MotionEventTest view.KeyEventTest
Bug: 64258305
Change-Id: I75891037617ed60820d60736216a0d615ab5e3b0
2018-07-05 16:29:51 +01:00
Tiger Huang
beac1471aa Merge "Don't flash system bars while showing an immersive app on lockscreen" 2018-07-04 03:06:31 +00:00
Tiger Huang
3404601e07 Don't flash system bars while showing an immersive app on lockscreen
Before applying this patch, when a show-when-locked immersive app is
showing, the system bars would quickly show and hide, which are
redundant to the user.

The root cause is that, for nav bar, we have a policy to show nav bar
if the width and height of status bar are MATCH_PARENT and status bar
has no PRIVATE_FLAG_KEYGUARD. When keyguard is becoming status bar,
its keyguard flag would be removed first, and then the height would
be changed to the bar height. So the nav bar would be shown between
these events. For status bar, we force showing it when it is expanded
by checking its width and height are MATCH_PARENT or not.

To fix the issue, this change introduces a new private flag which
indicates that the status bar window is now in an explicit expanded
state. We check this flag instead of checking the width and height of
status bar.

This change also fix a bug that: when AOD is enabled, if the
foreground app has FLAG_SHOW_WHEN_LOCKED, FLAG_TURN_SCREEN_ON, and
FLAG_FULLSCREEN, clicking on the power key would make it show the app
again instead of AOD. (not 100%, but chances)

Bug: 80147982
Test: 1. go/wm-smoke
      2. Launch a show-when-locked turn-screen-on immersive app on
         AOD, and see if any system bar flashes.
      3. Launch a show-when-locked turn-screen-on immersive app on
         lockscreen, and see if any system bar flashes.
      4. a. Enable AOD in Settings.
         b. Open a show-when-locked turn-screen-on immersive app.
         c. Click on power key, and see if AOD shows.
      5. Launch an immersive app and drag down the status bar, see
         if nav bar keeps there as long as status bar is expanded.

Change-Id: Ie885d504eb73ae8a86736b2c3ed4fb03eb9f739e
2018-07-03 14:41:43 +08:00
Jorim Jaggi
1f079b4f97 Merge "Only use simple rects for cutout region" into pi-dev am: 4764921dcc
am: b7dc212a61

Change-Id: I2af32c72ea859ff908fa30b5de1e722a99b28479
2018-07-02 14:58:32 -07:00
Qasid Sadiq
c7f8833c4a Make sure checking for accessibility pane is consistent
The documentation states " Setting to null indicates that this View is
not a pane." So make this behave consistently in that way..

Test: it builds!
Change-Id: Ied03a313b1fa1e26393f1497d63658acf6e297f4
2018-07-02 12:46:14 -07:00
Jorim Jaggi
606405180f Only use simple rects for cutout region
Otherwise there is a big performance hit in all kinds of
situations where we do operations with the region, specifically
when:

- updating input windows
- insetting the cutout during layout
- touch dispatch

Test: DisplayCutoutTest, WmDisplayCutoutTest
Bug: 110464019
Bug: 110452325
Change-Id: I94a25c3794ecd33b8b7204ca308ac91623498f13
2018-07-02 17:58:10 +02:00
TreeHugger Robot
cee49cd54d Merge "Make scroll bars more noticeable on round screens." 2018-06-30 00:26:35 +00:00
shepshapard
5229200dd3 Fix invisible scroll thumb blocks clicks.
The current issue is that Views that have either the horizontal or
vertical scroll bars enabled will intercept mouse interactions that
entire the region where the scrolling thumb would be even if the View
cannot actually scroll because it's content isn't larger than it.

This is fixed by only intercepting mouse interactions in the scroll
thumb region if there is something to scroll.

Bug: 110375792
Test: None yet

Change-Id: Ib638b4ac88375f55bc80ba2a66d945a16ecd6d22
2018-06-29 10:57:18 -07:00
Danny Epstein
b8cbf3aa5b Make scroll bars more noticeable on round screens.
Increase alpha from 15 to 30% for the track and use Google Material
Grey 200 for the thumb. Fix the geometry so that the track and thumb
don't extend off the edge of the screen.

Bug: 80258942
Change-Id: I43e603e5fffb8a05f486af35194c801060dd0b51
(cherry picked from commit 97b00cbc039a090659aed75e47a172a70222b02f)
2018-06-29 16:40:08 +00:00
Riddle Hsu
9a936e9677 Merge "Check for valid surface when starting to drag" 2018-06-29 03:57:40 +00:00
Riddle Hsu
0328b9c025 Check for valid surface when starting to drag
Also protect creating SurfaceSession with root surface.

Change-Id: I3649f160e85367169710b36faf26c96bef0f71fe
Fix: 110922266
Test: atest CtsViewTestCases:android.view.cts.DragDropTest
2018-06-28 20:59:37 +00:00
Riddle Hsu
af2748b28c Get new surface if it was released from setWindowStopped
If there is no visibility change, when the stopped state
changed from true to false, there is no valid surface to use.

Bug: 80170221
Test: Sample app in bug link
Test: atest ViewRootImplTest
Change-Id: I2324ed32980aae5a3ec2efbd612e6c143c9a0022
2018-06-27 02:07:28 +00:00
Qasid Sadiq
063eefa78a Depecrate flags, and try to match them to actions
First, depeprecate the setters for these flags.
Second, of those that it is possible, make them use actions instead.
This isn't possible with isScrollable because it maps to 6 actions,
so just have its setter do nothing instead.
Also fix up a bad unit test.

Bug: 37567816
Test: Ran CTS test suite for accessibiloty, which already test setting
and getting both flags and actions.
Also just ran testback to see if something terrible happened.

Change-Id: I76d9227987a25445485aab591e18f4e97324939f
2018-06-22 17:45:51 -07:00
Yohei Yukawa
99e1f6e04b Notify new IME target before IME starts interacting
Previously, there was a time window between when an IME starts new
input and when the IME issues an IPC IMM#setImeWindowStatus() so that
WindowManagerService (WMS) can be notified about the new IME target
window.

With this CL, it is now guaranteed that WindowManagerService (WMS) is
always notified about the new IME target window before IME starts
interacting with that window.

Note that WMS is not using notified IME target window yet hence there
should be no user-visible behavior change.

Bug: 110531072
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I032b91ce722a16b17518a5d88015c574d7d3e51b
2018-06-22 17:33:19 -07:00
TreeHugger Robot
b8b127406e Merge "Always send WindowToken when starting IME input" 2018-06-22 02:46:22 +00:00
Yohei Yukawa
80498d5576 Always send WindowToken when starting IME input
In InputMethodManagerService, windowGainedFocus() is a superset of
startInput().  If the window specified to windowGainedFocus() is
already seen in IMMS#mCurFocusedWindow, windowGainedFocus() just works
like startInput().  If the window specified to windowGainedFocus()
does not match to IMMS#mCurFocusedWindow, then it takes care of
everything we need to change the IME target window including tasks
that startInput() does.  The reason why we still have startInput() is
just because my previous CL [1], which unified windowGainedFocus() and
startInput() with keeping the existing behavior, did not intend to
change the existing behavior.

Now that we are going to enforce true traceability between input
session and target application window, IMMS#windowGainedFocus() is
what we want to always rely on.

Bug: 110531072
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I24feedf9ef5aca90ef947f4f2aa3e78365fd8c8a
2018-06-21 16:24:36 -07:00
TreeHugger Robot
4c51b7c057 Merge "Tweak some RenderNode API surfaces" 2018-06-21 19:05:27 +00:00
Riddle Hsu
95459d3e6e Ensure consistent attach/detach callback on transient view
- Not allow to add as transient view if it still has a parent.
  (The normal usage of addTransientView should be after removeView)
- If a view container is not attached, its transient view should
  not be attached.
- If a transient view is already detached from parent, no need
  to detach again when removing the transient view.

Bug: 109814657
Test: atest FrameworksCoreTests:ViewGroupTransientViewTest
Change-Id: I243cc292e4aaba987d48eeb202559de866a8c208
2018-06-20 05:09:32 +00:00
TreeHugger Robot
fcfd26b689 Merge "Improved logging on autofill authentication." 2018-06-18 17:41:22 +00:00
TreeHugger Robot
a0d1422d50 Merge "Remove unused parameter from TSMS IPC" 2018-06-18 06:22:15 +00:00