Commit Graph

9528 Commits

Author SHA1 Message Date
Aaron Whyte
f830652e97 Split scroll factor into a 2d float.
Test: Existing unit tests, manual sanity check.
BUG=35764483

Change-Id: If6ac121452698747e1f8bc9d4ec0111bb881d4d4
(cherry picked from commit e9956c5c65)
2017-03-29 23:34:56 +00:00
TreeHugger Robot
dd83c2006b Merge "TextClassifier: Switch model based on locale" into oc-dev 2017-03-29 19:17:36 +00:00
TreeHugger Robot
94696c5ac5 Merge "Fix bad Java docs in View.java" into oc-dev 2017-03-29 18:33:11 +00:00
Rob Carr
76d779374a Merge "SurfaceView: Make surfaceRedrawNeededAsync work with WM bypass." into oc-dev 2017-03-29 16:44:41 +00:00
Philip P. Moltmann
dc90922f78 Fix bad Java docs in View.java
Test: Used intelliJ to warn about bad docs
Change-Id: Idb119aff8ce0f2370f66707bd583e2d131fb0751
(cherry picked from commit f4946e7f15)
2017-03-29 16:29:22 +00:00
Abodunrinwa Toki
c39006a1cd TextClassifier: Switch model based on locale
Test: cts-tradefed run cts-dev -m CtsViewTestCases -t
android.view.textclassifier.cts.TextClassificationManagerTest

Change-Id: I91f814fc47bd75922c0e42a774dc7376daf65366
2017-03-29 17:12:56 +01:00
TreeHugger Robot
36e2483663 Merge "Add Configuration param to onMovedToDisplay" into oc-dev 2017-03-28 21:36:40 +00:00
Robert Carr
8508bb2f10 SurfaceView: Make surfaceRedrawNeededAsync work with WM bypass.
Prior to SurfaceView bypassing the WM, the WM would see that
the app had multiple windows and wait for them all
to finish drawing before beginning any animation, or similar operations.
Now that SurfaceView is invisible to the WM we have to replicate this
two-way latching in ViewRootImpl.

Bug: 36492285
Test: Launch Chrome over and over.
Change-Id: Ie72c2d394f1bb0eb8551e6f63bb1c19a5df43afd
2017-03-28 12:39:33 -07:00
Andrii Kulian
e5c58eefb1 Add Configuration param to onMovedToDisplay
To be consistent with other multi-window callbacks adding
Configuration param to the onMovedToDisplay, so that app
developer can handle configuration change at the same time
when it receives a notification about move.

Bug: 36649499
Test: android.server.ActivityManagerDisplayTests
Test: #testOnMovedToDisplayCallback
Change-Id: I80c765473bfc09ea1fb7aa4e2e77baf3b21606b8
(cherry picked from commit 2c32a11a71)
2017-03-28 17:28:17 +00:00
Tadashi G. Takaoka
da5790de78 Fix double-checked locking in InputMethodSubtype
No functional change.

Fixes: 35737935
Test: run cts test and confirmed all tests passed
  cts-tradefed run singleCommand cts-dev -m CtsInputMethodTestCases
Change-Id: I44e5e91b6462c3c7d023f50365b30da9cf98c509
2017-03-28 14:39:12 +00:00
Abodunrinwa Toki
b5ab25948b SmartSelection: Pass hintFlags to native library.
Test: cts-tradefed run cts-dev -m CtsViewTestCases -t android.view.textclassifier.cts.TextClassificationManagerTest
Tests have been written on the native side.
Bug: 35416389

Change-Id: If2de73391e1a343e0dc7698039ad1464cedfbf08
2017-03-28 10:02:07 +01:00
Abodunrinwa Toki
d2d1399a62 TextClassifier updates
- Increase the size of the text sent as context to the classifier
- Pass regex match hints to the classifer

Test: Build still works. Regex hints logged correctly. The hints won't
matter until we've actually passed in this values to native code. Native
library test will be written and I've got a tracker bug to write more robust Java tests.

Bug: 35416389
Bug: 36584397

Change-Id: I29e56189b388b36dc0cc7a8bb13ef237ff55be7b
2017-03-27 17:53:24 +01:00
TreeHugger Robot
2858ad3a4b Merge "TextClassifier cleanup." 2017-03-27 14:51:13 +00:00
TreeHugger Robot
1e8fd460fd Merge "Target selection for Accessibility button" 2017-03-25 04:04:16 +00:00
Casey Burkhardt
5e8b980c5d Target selection for Accessibility button
Allows for selecting a single accessibility service or feature
to be triggered by the accessibility button in the navigation bar

Bug: 34720082
Test: Manual
Change-Id: I320febede0398b1eff38a87d4db31fd7dfc53062
2017-03-24 19:17:12 -07:00
Felipe Leme
4753bb0c34 Make auto-fill UI robust
Now the autofill UI tracks the movement of the anchor view,
both real and virtual and while still preventing the filled
app from accessing the chooser UI. This was achieved by using
a popup window in the app process to determine the window
location and adding a window presenter interface to popup
window that controls the actual window addition, removal, and
update which is implemented by the system server.

Test: all autofill CTS tests pass

bug: 36392498
bug: 35708258
bug: 34943932
fixes: 36039182
fixes: 36493078

Change-Id: I0321913b2e2e759f4b17003bf85cb873e63a467c
2017-03-24 15:16:28 -07:00
Felipe Leme
b4ca70184c Added LocaleList on ViewStructure.
Fixes: 36219641
Test: CtsAssistTestCases pass

Change-Id: I4f208a3b979a524d631e9d2c642b9b5a3cdccb22
2017-03-22 18:51:00 -07:00
Andrii Kulian
38691e9d8f Merge "Revert "Update display contents when metrics change"" 2017-03-22 21:57:31 +00:00
Andrii Kulian
b6c5c0d902 Revert "Update display contents when metrics change"
This reverts commit eddb7c0985.

Reason for revert: b/36518752

Bug: 36518752
Change-Id: I39773db7b8d02aec360ca80d02b3c161ccf02786
2017-03-22 21:50:52 +00:00
Rob Carr
fcc79f5474 Merge "SurfaceView: Fix Surface leak when changing format." 2017-03-22 20:26:40 +00:00
Abodunrinwa Toki
9841ea07c0 TextClassifier cleanup.
- Remove "removed" methods.
- Temporarily log more information about the classification result.

Test: Successfully builds. Manually inspected logs.
Change-Id: I81312ac9992c08ce6137610bd16b339777f8f1fc
2017-03-22 20:13:21 +00:00
TreeHugger Robot
c8e2d5bad4 Merge "Don't call setAutofillId() when populating virtual structure for Assit." 2017-03-22 17:20:57 +00:00
Felipe Leme
4c7b841add Don't call setAutofillId() when populating virtual structure for Assit.
Change-Id: Ia96b5fd6ed7b8f7909b9df59cee57f606a0b37da
Fixes: 36503715
Test: manual verification
2017-03-22 08:26:29 -07:00
Kirill Grouchnikov
6eea0d2a4c Add support for tinting icon menus
Test: CTS tests in separate CL (same topic)
Bug: 31545315
Change-Id: I8877c77dab9b7b229b4246012b9380beadeb4790
2017-03-22 11:05:49 -04:00
TreeHugger Robot
e4e40af10b Merge "Update display contents when metrics change" 2017-03-22 00:02:32 +00:00
Felipe Leme
03ee781b97 Fixed bad link caused by race conditions on git merges.
Test: no time for that
Change-Id: Iffbba4ab2aa0751a406e031fe34e8e2c75e0abde
2017-03-21 16:28:26 -07:00
TreeHugger Robot
1f08e1369b Merge "Changes on Assist structure to handle virtual child for autofill:" 2017-03-21 22:52:09 +00:00
Andrii Kulian
eddb7c0985 Update display contents when metrics change
There are two separate overrides for display metrics in DisplayManager
and WindowManager:
- In DM - LogicalDisplay#mOverrideDisplayInfo, in most cases not null.
- In WM - DisplayContent#mBaseDisplayWidth/Height/Density, different
from #mInitialDisplayWidth/Height/Density values when some metrics are
forced.

When display was resized its windows weren't updated because of
two problems: old LogicaDisplay#mOverrideDisplayInfo was preventing
WM from detecting the change and override (base) display metrics were
never updated by resize.

When display size changes:
- Before this CL:
DM receives DISPLAY_CHANGED event, it updates internal values.
In most cases there is an override obtained from WM and WM doesn't
get new values from LogicalDisplay#getDisplayInfoLocked().

- With this CL:
DM receives DISPLAY_CHANGED event, it updates internal values and
resets the override received from WM. WM will receive updated values
and will decide whether to apply them or not: if there is no override
in WM - it will apply values from WM, otherwise it will keep the
override. In both cases WM will eventually update its own override
and will update the override in DM.

Bug: 35258051
Bug: 34164473
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testDisplayResize
Test: #testForceDisplayMetrics
Change-Id: I80795434a6a35adb0577fbce334d76fabd2fa03d
2017-03-21 15:23:47 -07:00
TreeHugger Robot
e2436917d5 Merge "Allow draw hw bitmap on software canvas for hierarchyviewer" 2017-03-21 21:54:22 +00:00
TreeHugger Robot
709ff779e6 Merge "Improved WebView -> ViewStructure mapping for Autofill." 2017-03-21 19:49:43 +00:00
sergeyv
b94f89094a Allow draw hw bitmap on software canvas for hierarchyviewer
Test: runs hierarchyviewer on app with hw bitmaps
bug:34745484
Change-Id: I35f70f7927be23edebac171f3bc96405b14ca794
2017-03-21 17:26:22 +00:00
Robert Carr
3bc95b5b71 SurfaceView: Fix Surface leak when changing format.
We simply weren't destroying the old Surface (though the finalizer
would have eventually caught it). As we destroy it we need to use
a Window preservation scheme similar to what the WindowManager
provided.

Bug: 36447956
Test: Manual
Change-Id: I8b4210eb76cec364522cc0a40014517e42ebbe68
2017-03-20 21:57:23 -07:00
Robert Carr
44ab575092 SurfaceView: Fix some log spam.
We were throwing relatively harmless NPEs here
and catching them below. The log message when
catching exceptions also needed some updating.
Not assosciated with a particular bug just
noticed in logcat.

Test: Manual
Change-Id: I5f07e6fc8ff3a34318682bf7b6c309fbba4097e4
2017-03-20 21:48:53 -07:00
Adam Lesinski
60b4af5d65 Merge "AssetManager: Guard against null in array retrieval" 2017-03-21 01:03:18 +00:00
Felipe Leme
1a1e4687e4 Improved WebView -> ViewStructure mapping for Autofill.
Added setIdEntry() on ViewStructure and documented how WebView can map HTML
tags and attributes into ViewStructure.

Test: VirtualContainerActivityTest pass
Test: m update-api
Bug: 36056207

Change-Id: Idaee9612d2c1b1adac99f354c8f87137ee9ef877
2017-03-20 17:54:33 -07:00
Felipe Leme
f8a8174cd5 Changes on Assist structure to handle virtual child for autofill:
- Removed overloaded newChild() methods.
- Added a setAutofillId(parent, virtualId).
- Changed view so AutofillId is set on all relevant methods.

Test: VirtualContainerActivityTest (with new tests) pass
Bug: 36056207

Change-Id: Ia11344f95c2756e83307c54052878e9dbe471873
2017-03-20 16:21:41 -07:00
TreeHugger Robot
3f1fb26bbc Merge "Batch autofill() calls to views with virtual children." 2017-03-20 22:03:25 +00:00
Felipe Leme
28afe0e1d8 Batch autofill() calls to views with virtual children.
This is useful in the cases where the virtual children hierarchy is rendered
by a different process.

Test: VirtualContainerActivityTest pass
Bug: 36056207
Change-Id: Id9bf3a9e9366b616dc2a6e0a204e238a2bee3a20
2017-03-18 11:25:23 -07:00
Alan Viverette
42b0676d61 Merge "Revert "Changing initial and default focus behavior"" 2017-03-17 19:47:13 +00:00
Evan Rosky
cfd6c85d42 Revert "Changing initial and default focus behavior"
This is a soft revert.

This reverts commit 37df2dbab1

Change-Id: I7ac08c0ef514f7ce7a0b750e501a5333f4ffb6d2
2017-03-17 12:39:15 -07:00
TreeHugger Robot
2fb89f45b9 Merge "Removed 'virtual' from autofill method names." 2017-03-17 17:54:37 +00:00
Felipe Leme
81f01d9efd Removed 'virtual' from autofill method names.
Fixes: 36126001
Test: VirtualContainerActivityTest pass

Change-Id: I3b8fe835cd7c7f39c8e2cb8f2daca71b03236a1f
2017-03-17 09:09:31 -07:00
Andrii Kulian
c1b59ed73e Merge "Separate global and override config sent to client" 2017-03-17 15:39:37 +00:00
Felipe Leme
24aae15218 Added a new AutofillCallback.EVENT_INPUT_UNAVAILABLE event.
This event is called when:

- After notifyViewEntered() when autofill is disabled.
- After service returns an "empty" FillResponse to FillCallback.onSuccess().

BUG: 36056207

Test: LoginActivityTest.testAutofillCallbackDisabled
Test: LoginActivityTest.testAutofillCallbackNoDatasets
Test: VirtualContainerActivityTest.testAutofillCallbackDisabled
Test: VirtualContainerActivityTest.testAutofillCallbackNoDatasets

Change-Id: I7b8636473f738bf600aa96b28c77827b2cc78815
2017-03-16 19:40:22 -07:00
Philip P. Moltmann
389d1c2b43 Merge "TRON log important auto-fill events" 2017-03-17 02:23:35 +00:00
Andrii Kulian
446079600e Separate global and override config sent to client
There is some flakiness in View#onConfigurationChanged callback -
if ViewRootImpl receives config update earlier than ActivityThread,
it may not detect the configuration change and skip inner updates.
Also now ViewRootImpl assumes that it receives the global config as
a param, but instead it gets merged config from WM. This means that
ViewRootImpl#sConfigCallbacks was sending incorrect values to the
recipients.

This CL switches to sending global and override configuration to the
client separately. Also in case if there is a corresponding activity,
it first updates it and waits for update callback to ViewRootImpl.
This way global config and override config for activity will always
be set first and resources will be updated before inner state of
ViewRootImpl is updated.

Bug: 35870157
Bug: 34164473
Test: android.server.cts.ActivityManagerDisplayTests
Test: testOnMovedToDisplayCallback
Change-Id: Ic9e7541cf25ecfac6ec90e48f7efb0ece91f657e
2017-03-16 19:13:02 -07:00
Adam Lesinski
ba9576d977 AssetManager: Guard against null in array retrieval
Resources does the right thing and throws NotFoundException
if the result from AssetManager.getResourceTextArray() is null,
but AssetManager itself doesn't guard from the native implementation
returning null.

This lets callers always protect against missing resources via
catching NotFoundException.

Change-Id: I4f7ad32819bc9598efb28dbb10a59ff5201ecfca
Test: manual
2017-03-16 17:42:04 -07:00
Philip P. Moltmann
7b77116802 TRON log important auto-fill events
Example log from
android.autofillservice.cts.LoginActivityTest#testAutoFill#testAutoFillOneDatasetAndSave
(translated from numbers of human readable string):

AUTOFILL_SESSION_STARTED
   package=android.autofillservice.cts
AUTOFILL_REQUEST
   type=TYPE_SUCCESS
   package=android.autofillservice.cts
   FIELD_AUTOFILL_SERVICE=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_DATASETS=1
AUTOFILL_FILL_UI
   type=TYPE_ACTION
   package=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_DATASETS=1
   FIELD_AUTOFILL_FILTERTEXT_LEN=0
AUTOFILL_DATASET_APPLIED
   package=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_VALUES=2
   FIELD_AUTOFILL_NUM_VIEWS_FILLED=2
AUTOFILL_SAVE_UI
   package=android.autofillservice.cts
   FIELD_AUTOFILL_NUM_IDS=2
AUTOFILL_DATA_SAVE_REQUEST
   type=TYPE_SUCCESS
   package=android.autofillservice.cts
   FIELD_AUTOFILL_SERVICE=android.autofillservice.cts
AUTOFILL_SESSION_FINISHED
   package=android.autofillservice.cts

Test: Ran auto-fill tests and looked at event log.
Change-Id: I58aaa58e4435e7d04c8cd91878411943d3eb13de
2017-03-16 15:41:33 -07:00
Yohei Yukawa
3b5011afc9 Add a compat hack into SurfaceView#setWindowType()
This is a follow up CL to a previous CL [1] that removed an @hide method
SurfaceView#setWindowType(int).

It turns out that at least one application has relied on this @hide method
via refection to set TYPE_APPLICATION_PANEL to the internal Window object
for some reasons.  Such an operation has never ever been allowed to the
application developers.

To minimize the risk of compatibility issues and to help developers and
QA teams figure out what is going on, this CL re-introduces the method in
question to do three things:

 1. Show an error message with stack trace in logcat if this method was
    still called.
 2. To emulate the previous behavior for applications that set
    TYPE_APPLICATION_PANEL, call SurfaceView#setZOrderOnTop(true) on behalf
    of them as a stop-gap, short-term solution until application developers
    are notified that their products are doing something unsupported.
 3. Throw an exception if the targetApi is Android O or later.

 [1]: Ie56b6f7ab16f32d7fc459b8eba26594337ad55de
      d5c7dd6da8

Test: Manually verified that the complaint in Bug 36345857 disappeared
Bug: 36345857
Change-Id: I5217f6417a73690ae8a978754218b7b089070fdd
2017-03-16 15:34:12 -07:00
Rob Carr
287452cf40 Merge "Delete some SurfaceView support code." 2017-03-16 05:07:10 +00:00