Commit Graph

9327 Commits

Author SHA1 Message Date
TreeHugger Robot
59d3c40855 Merge "Minor fixes on documentation." 2017-02-16 04:36:56 +00:00
Aaron Whyte
22db07f308 Revert "Re-hide AXIS_SCROLL constant."
This reverts commit 8171658b9f.
Bug: 27314061
Bug: 22836852
Bug: 18707397
Change-Id: I6f78962cfa18f11ce5c8caa1d146252bd79f6dbd
2017-02-16 00:59:16 +00:00
Felipe Leme
f23e652c40 Minor fixes on documentation.
Bug: 31001899
Test: m update-api
Change-Id: I1f08552885fb5572ca9d811959dfe2b965ce3537
2017-02-15 09:06:24 -08:00
TreeHugger Robot
4dba3cdf89 Merge "Refactor auto-fill" 2017-02-14 09:37:53 +00:00
Svet Ganov
782043caf8 Refactor auto-fill
* Fix a layering issue where auto-fill manager which is in view
  depended on activity which is in app

* Moved auto-fill classes to view or service based on their
  purpose and removed dependecy on the classes in view to the
  classes in service

* Push state to local auto-fill manager whether auto-fill is
  enabled to avoid making IPC for every focus transition if
  the user did not enable the feature

* Remove unnecessary offload to messages when handling calls
  to auto-fill manager service as these are made over a oneway
  interface and in general they do almost no work and typically
  we do these on the binder thread

* Removed id from data set and fill response as the provider
  can embed everything it needs to id them in the auth pending
  intent

* Enforce the auth UI to be only an activity as this will work
  with multi-window, recents, and back and also does not require
  draw on top of other app special permission

* Authentication also no longer requires passing a remotable
  callback to the auth activity but the activity handles the
  request as if called for a result

* Handling stopping of a user to clean up in-memory state as
  well as handling when a user gets unlocked as a provider may
  be non-direct boot aware

* User the correct context when creating an auto-fill manager

* Move the receiver that listens for requests to hide system
  windows to the manager service as the UI is a singleton and
  no need every per-user state to register its own

* Removed extras from dataset as the only case a provider needs
  to associate state with a dataset is for auth and the provider
  can embed this data in the auth pending intent

Test: manual and CTS

Change-Id: I4bc54c13cf779d7f6fdb3ab894637f9fac73f603
2017-02-13 21:31:37 -08:00
TreeHugger Robot
3400795aec Merge "Propagate setImeWindowStatus() to WMS" 2017-02-14 01:38:07 +00:00
Sergey Vasilinets
2eaae562fe Merge "DeferredLayerUpdater: clean up Layer lifecycle" 2017-02-14 01:28:26 +00:00
sergeyv
00eb43dbc0 DeferredLayerUpdater: clean up Layer lifecycle
Test: refactoring CL, all existent tests should pass
bug:34919311
Change-Id: Ib2889667a5ab8a2aaba443458782bc163467f0ea
2017-02-13 14:41:20 -08:00
Yohei Yukawa
ff54b306de Merge "Track event flow to IMMS#setImeWindowStatus" 2017-02-13 22:08:35 +00:00
TreeHugger Robot
9f5ce93549 Merge "Introduce a minimum scrollbar touch target size" 2017-02-13 20:48:14 +00:00
TreeHugger Robot
a21f3e782a Merge "Do not enter touch mode on non-touchscreen events" 2017-02-13 20:44:39 +00:00
Yohei Yukawa
69e6802422 Propagate setImeWindowStatus() to WMS
setImeWindowStatus() introduced in the previous CL [1] can help
WindowManagerService (WMS) address Bug 34628091.  As a preparation
this CL has InputMethodManagerService propagate relevant information
to WMS WMS for later use.

 [1]: I9921b381e02106dbffff5e0b3d13f0a1245ce807
      db2afde0e584904ee4ce115ce176a4dfe1773990

Test: Verified the callback in WindowManagerService as follows:
       1. Rebuild the system with DEBUG_INPUT_METHOD=true
       2. adb logcat -s WindowManager:*
            to make sure the visibility passed to
            WindowManagerService#updateInputMethodWindowStatus matches
            to the actual IME window visibility
Bug: 34628091
Bug: 35079353
Change-Id: I54fb1faf513883a54293a756e4c9d2ae9453d778
2017-02-13 12:04:50 -08:00
Yohei Yukawa
6db3bfe33d Track event flow to IMMS#setImeWindowStatus
This is part of work to introduce historical debugging infrastructure
for Android IME.

In this CL, we will focus on the following two event flows.

 A1. IMMS#attachNewInputLocked() queues MSG_(RE)START_INPUT to deliver
     new InputConnection/EditorInfo to the current IME
 A2. The IME triggers IMS#onStartInput()/IMS#onRestartInput() and
     updates the following fields:
      - InputMethodService#mStartedInputConnection
      - InputMethodService#mInputEditorInfo

 B1. IME is expected to call back IMM#setImeWindowStatus() to notify
     its window visibility change to IMMS.
 B2. IMMS updates the following field if the caller is still the
     current IME.
      - InputMethodManagerService#mImeWindowVis

What this CL aims to do is to enable IMMS to access A1 state when it
was in B2 state, by considering that for given a B1 the last A2
happened before B1 is the cause of B1 and B2.

To do this, IMMS issues a binder token in A1 and each IME keeps it
so that it can be passed in B1. By using this Binder token as a key,
IMMS can keep tracking state snapshot taken from each A1. Note that
those state snapshots keep alive until the Binder token's proxy in the
IME process loses strong reference from its GC root.

Test: Make sure `adb shell dumpsys input_method | grep mImeWindowVis`
      matches to the IME window visibility.
Test: Make sure the current IME is not receiving any
      InvalidParameterException from IMMS.
Bug: 35079353
Change-Id: I9921b381e02106dbffff5e0b3d13f0a1245ce807
2017-02-13 12:04:41 -08:00
Vladislav Kaznacheev
75e5029e46 Do not enter touch mode on non-touchscreen events
Currently ACTION_DOWN and ACTION_SCROLL cause
entering touch mode regardless of the event source.
This is especially awkward for mouse.

This should only happen when the event source is
SOURCE_TOUCHSCREEN.

Bug: 35314124
Test: android.cts.view.ViewTest#testTouchMode
Change-Id: I2205d4240be4afcbd9a3ac5558e701f7cac51926
2017-02-13 10:46:05 -08:00
Abodunrinwa Toki
bbc21401b3 Merge "TextClassifierImpl: Handle urls." 2017-02-13 17:35:18 +00:00
TreeHugger Robot
04fa542db5 Merge "Set oom adj for processes displaying app-overlays to PERCEPTIBLE_APP_ADJ" 2017-02-13 16:19:41 +00:00
Abodunrinwa Toki
9b4c82a83c TextClassifierImpl: Handle urls.
This cl also updates label strings, renames an internal method,
and fixes some bugs in TextClassifierImpl caught by tests.

Test: See: I31ee94177e58c986e61e9b24c6c5816fa4b022e1
Bug: 34778263
Bug: 34922928
Change-Id: Ibf60d345d462dfc8a13dead6f01053f1ae50f35a
2017-02-13 15:00:32 +00:00
Wale Ogunwale
d993a573d7 Set oom adj for processes displaying app-overlays to PERCEPTIBLE_APP_ADJ
For processes with a window of type TYPE_APPLICATION_OVERLAY adjust their
oom importance to PERCEPTIBLE_APP_ADJ to reduce the chance of them getting
killed by the low-memory-killer since they are displaying something that
is perceptible to the user.

Also z-order TYPE_DREAM windows above alerts windows.

Bug: 33256752
Test: cts/.../run-test CtsAppTestCases android.app.cts.AlertWindowsTests
Change-Id: I4c05a9fee6fad61399bf4d10c8647467cc596ca6
2017-02-12 16:57:24 -08:00
Yohei Yukawa
22dac1c8df Introduce @SoftInputModeFlags annotation
Doing this allows us to annotate integer values that should corresponds
to WindowManager.LayoutParams#softInputMode.

Test: There should be no behavior change.  RetentionPolicy.SOURCE
      annotation should change nothing in production code.
Test: checkbuild
Bug: 32784563
Bug: 35079353
Change-Id: I96300b090edce327d0515c740183abe91ded6bac
2017-02-12 16:54:16 -08:00
Yohei Yukawa
22a8923368 Track the last softInputMode in IMMS
A field in WindowManager.LayoutParams softInputMode is something that
definitely needs to be kept tracking in historical debugging
infrastructure across IME-related processes (Bug 35079353) [1].  As a
preparation, this CL enables InputMethodManagerService (IMMS) to
include the last softInputMode specified in IMMS#windowGainedFocus()
in the dumpsys in human readable format.

 [1]: As explained in b.android.com/224318, softInputMode misspecified
      by app developers is a typical root cause of unexpected behavior
      in keyboard visibility.  Bugs such as Bug 23168250, Bug 27275709,
      and Bug 31770400 fall into this category.

Test: `adb shell dumpsys input_method | grep softInputMode=`
Bug: 35079353
Change-Id: I485ced030def179dad78b4b811c6eb52b5e5c951
2017-02-12 16:38:59 -08:00
Andrii Kulian
3d227ad86c Merge "Allow destroying display content on removal" 2017-02-10 20:49:49 +00:00
Evan Rosky
187706f3e4 Merge "Don't notify parents of views made focusable off UI thread" 2017-02-10 20:36:13 +00:00
TreeHugger Robot
077bf66250 Merge "Clear mExtraDataKeys when clearing A11yNodeInfo." 2017-02-10 19:58:09 +00:00
Vladislav Kaznacheev
4d2c60145c Introduce a minimum scrollbar touch target size
Currently a default scrollbar is fairly hard to grab with
a mouse as it is sometimes as narrow as 8dp.

Introduce a larger touch target configured by
config_minScrollbarTouchTarget

Bug: 35114313
Test: manual
Change-Id: Ib15b24e5a82ea912ec5837d965319b758b4d9b6b
2017-02-10 11:27:10 -08:00
Phil Weaver
9b83ffbfae Clear mExtraDataKeys when clearing A11yNodeInfo.
Bug: 35244501
Test: Ran Accessibilitiy CTS. I can no longer get the test mentioned
in the bug to fail.

Change-Id: I69e5e1b5c8f12226837ced928fbd10ff77bcd235
2017-02-10 10:10:01 -08:00
Abodunrinwa Toki
fd9d0ee9f8 Merge changes from topic 'smartselect'
* changes:
  Introduce a model file for language detection.
  Change package for LangId and SmartSelection.
2017-02-10 15:56:40 +00:00
Andrii Kulian
250d653325 Allow destroying display content on removal
This CL sets the behavior for displays when they are removed.
For public displays by default all content will be moved to the
primary display and become focused. For private displays default
behavior is to destroy all content - first it moves stacks from
the secondary display to the primary display to the bottom, then
it destroys all activities in those stacks.

This CL adds two specified behaviors as modes, so in future these
rules might be altered if needed.

Bug: 34263289
Test: android.server.cts.ActivityManagerDisplayTests
Test: #testContentDestroyOnDisplayRemoved
Change-Id: I3f89f06ff82cb4b487df58a86ba3b146a32cbd00
2017-02-09 22:45:19 -08:00
Abodunrinwa Toki
c3e7a4fade Introduce a model file for language detection.
Test: cts-tradefed run cts-dev -m CtsViewTestCases -t
android.view.textclassifier.cts.TextClassificationManagerTest#testLanguageDetection
Bug: 34777495

Change-Id: Id4102732d303151839ae54630746f882a98dce29
2017-02-10 00:57:11 +00:00
Abodunrinwa Toki
f67f0a584e Change package for LangId and SmartSelection.
Package change from android.text to android.view.textclassifier.
This change was delayed until the native library code was updated
to reflect this package change.

Test: cts-tradefed run cts-dev -m CtsViewTestCases -t android.view.textclassifier.cts.TextClassificationManagerTest
Bug: 34777495
Change-Id: I723aaf79f8fbed4758bb4ee6727dfb6a8e35bf99
2017-02-10 00:57:01 +00:00
Evan Rosky
f038cb454b Don't notify parents of views made focusable off UI thread
Clickable now implies focusable by default. While views are
only supposed to be modified on the UI thread, before O
this wasn't enforced when setting a view as clickable. Now,
it is enforced by virtue of clickable setting focusable for
auto-focusable views.

In order to prevent crashes, detect this situation for pre-O
target-sdks and skip notifying parents of a view made
focusable if:
- it was made focusable by the new auto-focusable mechanic.
- and this is occuring off the UI thread.

The net result in these cases will be a newly-focusable view
that won't immediately receive focus if it was supposed to
(though this will be exceedingly rare).

Bug: 34815147
Test: Verified that the crashing app in the bug (JWLibrary)
      doesn't crash after this change.
Change-Id: I90e9a082cb1e1a3fec75ae5159f2f2c8540ffdc2
2017-02-09 15:13:32 -08:00
TreeHugger Robot
b44818b10b Merge "Disable touch slop for generated gesture events" 2017-02-09 22:06:36 +00:00
Felipe Leme
3702b4760c Merge "Improved some toString() methods." 2017-02-09 17:47:23 +00:00
Yohei Yukawa
efdb428959 Merge "Eliminate out-of-sync IMM#mFullscreenMode error" 2017-02-09 16:55:04 +00:00
Peeyush Agarwal
651ea36f5a Merge "Extend MenuItem to allow modifier keys for shortcut" 2017-02-09 11:17:25 +00:00
Felipe Leme
0223ffb473 Improved some toString() methods.
- Never display AutoFillValue.text, because it could be sensitive.
- Simplified AutoFilllId.

Fixes: 35171960

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: I0853cabb695b842c947b0ae007e344f5d8385395
2017-02-08 18:54:29 -08:00
Yohei Yukawa
2bc66171cc Eliminate out-of-sync IMM#mFullscreenMode error
As explained in the commit message of my previous CL [1], we have
had a design issue in how to notify the full-screen mode change
from the IME to InputMethodManager running in the target application.

Histrically we have done this by using hooking the following IPC
from the IME to the target application.

  InputConnection#reportFullscreenMode()

However, since we also want InputConnection to be deactivated in some
situations such as the when the target application is no longer
focused. In other words, InputConnection is not a reliable way to
notify something.

As a result, we have suffered from many stale state issues.
Bug 21455064 and Bug 28157836 are such examples.  In Android N, we
introduced yet another hack to work around those issues, but it is
really time to fix the protocol design instead.

The new strategy is to rely on internal IPCs provided by
InputMethodManager to deliver such critical notifications from one
process to the other. This is actually more natural because our goal
is to make sure that InputMethodManager#isFullscreenMode() always
returns the latest value as long as the caller is the focused
application.

For backword compatibility, applications that are monitoring
this callback should continue working, as InputMethodManager emulates
the previous behavior.  However, as updated in JavaDoc, IMEs are no
longer allowed to invoke InputConnection#reportFullscreenMode(),
which should be OK because even on previous releases IMEs should rely on
InputMethodService#updateFullscreenMode() instead.

 [1]: Iba184245a01a3b340f006bc4e415d304de3c2696
      1544def0fa

Fixes: 28406127
Test: Make sure Bug 21455064 is still fixed.
       1. Input some words in extract mode.
       2. Select a word.
       3. Perform copy.
       4. Select a word.
       5. Rotate the device.
       6. Try to select a word.
       7. Make sure he word is selected and action mode starts.
Test: Make sure Bug 28157836 is still fixed.
       1. Rotate device to landscape mode.
       2. Tap on EditText and start full screen extracted mode.
       3. Rotate device to portrait mode.
       4. Long press to start action mode.
       5. Make sure Action mode gets started.
Test: `adb shell dumpsys input_method` to make sure that fullscreen
      state is synchronized across the app, IMMS, and the IME.
Change-Id: If23e7c7c265ab3dfb48c2fb6fdb361b17d22c594
2017-02-09 00:51:18 +00:00
Evan Rosky
f10db8e444 Merge "Separate cluster-focus and default-focus." 2017-02-08 22:27:53 +00:00
TreeHugger Robot
697221e84d Merge changes Ia7670aa6,I602b421b
* changes:
  Get rid of VirtualViewDelegate.
  Set autofill id on virtual structures.
2017-02-08 16:55:01 +00:00
Adam Powell
2ec94fde4f Merge "Provide old behavior for View#hasFocusable to old apps" 2017-02-08 16:21:06 +00:00
Paul Duffin
24843fdf3b Merge "Replace com.android.internal.util.Predicate with java.util.function.Predicate" 2017-02-08 14:49:34 +00:00
Abodunrinwa Toki
5a6a99d2f5 Merge "TextClassificationManager: Avoid exposing lock." 2017-02-08 12:19:27 +00:00
Paul Duffin
ca4964ccbe Replace com.android.internal.util.Predicate with java.util.function.Predicate
Bug: 35089332
Bug: 30188076
Test: make checkbuild
Change-Id: I0a5b4bf520fc39b59d8d790b01e9cff0d54e6d21
2017-02-08 11:55:39 +00:00
TreeHugger Robot
61294f4c8b Merge "Removed value from AutoFillManager.virtualFocusChanged()." 2017-02-08 09:37:22 +00:00
Felipe Leme
0221887e6a Get rid of VirtualViewDelegate.
VirtualViewDelegate was used by views providing virtual children to:
- auto-fill the chidren
- notify system about children changes

Since the notification logic moved to the AutoFillManager class, it's
kind of an overkill to provide a delegate just for autoFill(); instead,
it's simpler to add a new autoFillVirtual(virtualId, value) method on
View.

BUG: 31001899

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: Ia7670aa665918496a009017a11c3de72c4ed3fa2
2017-02-07 20:05:51 -08:00
Felipe Leme
7f60d35d94 Removed value from AutoFillManager.virtualFocusChanged().
BUG: 31001899

Test: manual verification
Test: CtsAutoFillServiceTestCases passes

Change-Id: I71c9f9b4b02b210121a1d15860c3c7172d26a62d
2017-02-07 17:23:56 -08:00
Felipe Leme
1bdf3f070b Set autofill id on virtual structures.
ViewStructure.newChild(virtualId) uses the AutoFillId of the parent,
which was not set anymore due do a previous refactoring, and was
causing this method to crash a custom view when
onProvideAutoFillVirtualStructure() was called on it.

Test: manual verification
Bug: 31001899

Change-Id: I602b421b0ec3a926ffdd52253d5b2498c4217d02
2017-02-07 13:50:53 -08:00
Winson Chung
cd161864a3 Merge changes I3ef361bd,I89a5184c
* changes:
  Refactor PiP logic in preparation for expanded state.
  Modifying RemoteAction callback to PendingIntent.
2017-02-07 21:18:15 +00:00
Abodunrinwa Toki
b89cf026cf TextClassificationManager: Avoid exposing lock.
Test: CtsViewTestCases passes
Bug: 35040457
Change-Id: Ia27730816f8aa4832a16aa9ebcafac68acb79e27
2017-02-07 20:41:44 +00:00
Evan Rosky
a5082a3f67 Merge "Default focus order now tries to adhere to view hierarchy" 2017-02-07 19:40:44 +00:00
Phil Weaver
1e2758256a Merge "Provide text locations to accessibility services." 2017-02-07 19:14:09 +00:00