Commit Graph

11934 Commits

Author SHA1 Message Date
TreeHugger Robot
358acd5854 Merge "Ignore ContentCapture events after the activity stopped." 2019-01-04 00:35:37 +00:00
TreeHugger Robot
ee00fea76b Merge "Fix drag and drop (1/3)" 2019-01-04 00:11:26 +00:00
Felipe Leme
bef744c48c Ignore ContentCapture events after the activity stopped.
Test: atest CtsContentCaptureServiceTestCases
Bug: 121033016

Change-Id: I016f13748287f77b7c5f0ceb12a5af1bb2b555ea
2019-01-03 13:02:02 -08:00
Adam He
f15c481604 Merge "Moved buffer for VIEW_TEXT_CHANGED events to MainContentCaptureSession." 2019-01-03 17:16:12 +00:00
Adam He
ac13265ed1 Moved buffer for VIEW_TEXT_CHANGED events to MainContentCaptureSession.
Bug: 121042846
Test: atest android.contentcaptureservice.cts.LoginActivityTest#testTextChangeBuffer
Test: atest CtsContentCaptureServiceTestCases
Change-Id: Ia0128c1c868d44da954e67b38dfb2bde6461b883
2019-01-02 14:44:03 -08:00
Eric Holk
d1a002605f Merge "[LayoutInflater] Cleanup - remove some nesting" am: 3a0fe2cdab am: a261d6e664
am: 6abf873683

Change-Id: I5b89a07c28f2d38af94a80137fd9a97d72b09091
2019-01-02 14:41:25 -08:00
Eric Holk
6abf873683 Merge "[LayoutInflater] Cleanup - remove some nesting" am: 3a0fe2cdab
am: a261d6e664

Change-Id: I8f6bb61ffc085ff224f631c916e19e05216faeed
2019-01-02 14:31:25 -08:00
Eric Holk
a261d6e664 Merge "[LayoutInflater] Cleanup - remove some nesting"
am: 3a0fe2cdab

Change-Id: I5f44de5983793c1a8e089977934d48bf032d0686
2019-01-02 14:13:34 -08:00
Eric Holk
bfc687007c [LayoutInflater] Cleanup - remove some nesting
The parseInclude method had some deep nesting that could be improved by
rearranging things a little.

Test: atest android.view.cts.LayoutInflaterTest
Change-Id: I2ee13c2ee80bcb220371d39a5a6da6044cfa245c
2019-01-02 11:11:24 -08:00
Mathew Inwood
8501ae1763 Merge "Limit access to suspected false positives." am: aeda49d185
am: 152d5a5dcd

Change-Id: I8e10322e69d2d479079df5cf8fec0287c7c117f1
2019-01-02 05:00:54 -08:00
Mathew Inwood
152d5a5dcd Merge "Limit access to suspected false positives."
am: aeda49d185

Change-Id: Ib24456aaad850d5aee46dd242513840511942536
2019-01-02 04:48:33 -08:00
Mathew Inwood
55418eada5 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 14:26:35 +00:00
Mathew Inwood
18e35038be Merge "Limit access to suspected false positives." 2018-12-28 14:23:00 +00:00
Jorim Jaggi
e24ac5a8eb Merge "A brave new world for window insets (6/n)" 2018-12-28 13:58:36 +00:00
Mathew Inwood
31755f94e1 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 11:50:04 +00:00
TreeHugger Robot
2555a5d46f Merge "Fixes NotificationHeaderView layout." 2018-12-27 22:37:42 +00:00
Yohei Yukawa
0c1ebffdb3 Deprecate null IME token rule in IMM#setInputMethod()
With my previous CL [1], InputMethodManagerService#setInputMethod() is
now guaranteed to be called only from IInputMethodManager and
IInputMethodPrivilegedOperations as 'adb shell ime set' no longer
directly calls this method (with null IME token).

With this CL, IInputMethodManager#setInputMethod(), which has been
kept just for null IME token rule, is finally gone. This is achieved
by letting InputMethodManager#setInputMethod() directly update
DEFAULT_INPUT_METHOD (and SELECTED_INPUT_METHOD_SUBTYPE) secure
settings if a priviledged component still relies on this undocumented
null IME token rule.

 [1]: I6fd47b5cc1e7da7222774df20247a2c69a70f45b
      db25df71be

Fix: 114488811
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: I42dd0325b01c527009bf85566ca8ba0766b2294e
2018-12-27 14:06:28 -08:00
Gus Prevas
c79816b005 Fixes NotificationHeaderView layout.
The layout method in NotificationHeaderView was incorrectly adding the
margins, width, etc. of views laid out on the right side to the position
it was tracking for views being laid out on the left side.  This change
fixes that error.

Test: manual
Change-Id: I747b318c621e6cf518e0752020ca8909c36c2ed7
Fixes: 122036911
2018-12-27 15:46:00 -05:00
Jorim Jaggi
e35c05982b A brave new world for window insets (6/n)
Mirror state back to server

In case the client does some local visibility modification to the
leash, the server needs to be informed for a couple of reasons:

- Dispatching state to other apps
- Updating accessibility services
- Updating SystemUI/IME system

For that we send the state back whenever we modified it and send
it via IWindowSession.insetsModified. The server ensures that
visibility state is only updated if we have a match for the
controlling app, and then updates the visibility state and
dispatches it to other apps.

We also invert mHidden to mVisible in InsetsSourceConsumer as it
was really really confusing.

Bug: 118118435
Change-Id: I92f187bf892a5f26b8b007ed7e6fbf4d2c7b13e6
2018-12-27 18:10:57 +00:00
Jelle Fresen
ba281ccf76 Merge "Add add/remove for AnimationListener's" 2018-12-27 07:52:37 +00:00
chaviw
59f532efad Fix drag and drop (1/3)
Add transferTouchFoucus API in SurfaceControl to pass info to native.

Test: Builds
Bug: 120463595
Change-Id: Ifb20a135c13de7380176e285dac273eef776ee19
2018-12-26 15:34:59 -08:00
Yohei Yukawa
6048d89453 Temporarily move MULTI_CLIENT_IME_ENABLED to frameworks.jar
This is a preparation to implement per-profile IME in
InputMethodManagerService (IMMS).

Multi-client IME is designed and implemented to be able to deal with
multiple profiles at the same time from its beginning [1].  This means
that when multi-client IME is enabled with system properties, it also
means that per-profile IME is enabled.

At the same time, the following classes need to change its behavior
whether per-profile IME is enabled or not.

 * android.provider.Setings
 * com.android.server.inputmethod.InputMethodManagerService
 * com.android.server.textservices.TextServicesManagerService
 * com.android.server.devicepolicy.DevicePolicyManagerService
 * com.android.server.devicepolicy.OverlayPackagesProvider

The problem is that android.provider.Setings lives in the
frameworks.jar.  Hence if we want to expose something like
PER_PROFILE_IME_ENABLED to android.provider.Setings, then such a flag
needs to live in frameworks.jar.

Note that this is expected to be a temporary change.  Once per-profile
IME becomes always enabled in IMMS, we can safely roll back this
change.

Note also that static initializer of InputMethodSystemProperty is
expected to be evaluated only once as long as
InputMethodSystemProperty is loaded before Zygote.

 [1]: I41dfe854557b178d8af740bc2869c936fc88608b
      bae5bea23c

Bug: 120709962
Test: prebuilts/checkstyle/checkstyle.py -f \
        frameworks/base/core/java/android/view/inputmethod/InputMethodSystemProperty.java
Test: Manually verified as follows:
  1. make -j MultiClientInputMethod
  2. adb install -r $OUT/system/priv-app/MultiClientInputMethod/MultiClientInputMethod.apk
  3. adb root
  4. adb shell setprop persist.debug.multi_client_ime \
       com.example.android.multiclientinputmethod/.MultiClientInputMethod
  5. adb reboot
  6. Make sure that multi-client IME is enabled
Change-Id: Iad8aba7edb1e60ccc1ce5192a11e01b6aa8d00a0
2018-12-25 09:57:31 -08:00
TreeHugger Robot
af6721f945 Merge "Re-work IMM#getShortcutInputMethodsAndSubtypes()" 2018-12-25 07:54:56 +00:00
Yohei Yukawa
4773ee18a2 Stop supporting null IME token in IMM#setInputMethodAndSubtype()
Hopefully no one has relied on this undocumented behavior that when
the caller has WRITE_SECURE_SETTINGS then null IME token is allowed in
IMM#setInputMethodAndSubtype().

Note that if the caller had WRITE_SECURE_SETTINGS they can achieve the
same goal by directly updating the following secure settings:
  * Settings.Secure.DEFAULT_INPUT_METHOD
  * Settings.Secure.SELECTED_INPUT_METHOD_SUBTYPE

Bug: 114488811
Test: CtsInputMethodServiceHostTestCases
Change-Id: Ic5c59299ace16778fc57a4ec2639508564f416a7
2018-12-24 21:13:53 -08:00
Yohei Yukawa
fefedc52bb Re-work IMM#getShortcutInputMethodsAndSubtypes()
It seems that InputMethodManager#getShortcutInputMethodsAndSubtypes()
was designed to be a bit more generalized concept, but in reality it
just ended up being a convenient API that returns a single Voice IME
subtype if exists.  As far as we can tell, It has never returned two
or mode pairs.  It also has never returned non-voice
InputMethodSubtype.

In order to support per-profile IME mode in InputMethodManagerService
without introducing a bunch of new complexity and technical debt, this
CL re-implements IMM#getShortcutInputMethodsAndSubtypes() based on how
it has been used actually in the ecosystem.

The first thing this CL changes is that
IMM#getShortcutInputMethodsAndSubtypes() no longer takes subtype
locale into account when looking for the best voice IME subtype. This
is because InputMethodSubtype is no longer a recommended way to
represent IME languages.  Ignoring subtype locale makes the
implementation much easier to understand and maintain.

The second thing this CL changes is that
IMM#getShortcutInputMethodsAndSubtypes() is now just a utility method
that is implemented in the client side on top of other well-defined
public APIs such as IMM#getEnabledInputMethodList() and
IMM#getEnabledInputMethodSubtypeList().  This means that this API
becomes per-profile IME ready for free once other public APIs become
per-profile IME ready.

 [1]: Ibd0f7ef5101013569c303820a3adc9038a97356d
      4e4569dab5

Bug: 120709962
Test: AOSP Keyboard still shows voice IME shortcut when the device has
      one or more IMEs that expose voice InputMethodSubtype.
Change-Id: Iaf31e9f3213f4e644b64c9658f1b59d371e3c2b4
2018-12-24 19:43:17 -08:00
Feng Cao
c5cd1325fc Merge "Fix augmented autofill window positioning to be right below the input field." 2018-12-21 18:57:13 +00:00
TreeHugger Robot
5f175e3d6f Merge "Move orientation request into hierarchy." 2018-12-21 16:52:05 +00:00
Jelle Fresen
65d2171d00 Add add/remove for AnimationListener's
FragmentManagerImpl in AndroidX currently uses reflection to read
mListener, so it can wrap it with another listener. Adding add/remove
methods for AnimationListener's next to setAnimationListener removes the
need for AndroidX to touch mListener, which is private API.

Bug: 117519981
Test: atest AnimationTest
Change-Id: I69cb19d61078215ca6697b3d41f4c536decc2e6e
2018-12-21 15:18:09 +00:00
Jorim Jaggi
99dc47483c Merge "A brave new world for window insets (5/n)" 2018-12-21 14:00:45 +00:00
Jorim Jaggi
5bb571dc40 A brave new world for window insets (5/n)
Implement controlWindowInsetsAnimation

Based on the leashes we have on the client, and the insets the
client has requested, we are able to move the surfaces around
such that the resulting insets will match what the client
requested.

Bug: 118118435
Change-Id: I0616e53455a6544aaf374c1b0eb10e258aced21d
2018-12-21 13:05:30 +01:00
TreeHugger Robot
84cdbdfc13 Merge "Send logs to TextClassifier by calling onTextClassifierEvent in NAS" 2018-12-21 02:36:32 +00:00
Feng Cao
023b84c35f Fix augmented autofill window positioning to be right below the input field.
Test: manual verification

Bug: 120932071

Change-Id: If8fc3b78fd6240bca54035b139f44e56ddb996dc
2018-12-20 17:25:57 -08:00
Robert Carr
049902d9eb Implement construction of container layers am: c1ea10447f
am: ef7f39f4f5

Change-Id: I20c5e72ec3d278a3d9dd36618c45f32f330f72c6
2018-12-20 15:11:37 -08:00
Robert Carr
ef7f39f4f5 Implement construction of container layers
am: c1ea10447f

Change-Id: I5a8f0080051d2ae66a4a2f99c4a88ef452f0a467
2018-12-20 14:59:10 -08:00
Treehugger Robot
321b208f0f Merge changes from topic "fw_container"
* changes:
  DO NOT MERGE Set ContainerLayer for buffer-less surface
  DO NOT MERGE: WM: Restrict SC Builder to set a single surface type
  Implement construction of container layers
2018-12-20 22:45:18 +00:00
Garfield Tan
90b042819f Move orientation request into hierarchy.
This CL also removes a hidden method in IWindowManager that's only used
inside of WM right now.

Also wire up Task level logic.

Bug: 113252523
Test: Manual test that app requested orientation still rotates the
display and WmTests.
Change-Id: I7c5046e9beaea79de4ec471eabc792e3593583a2
2018-12-20 13:39:00 -08:00
Felipe Leme
87a9dc9a97 Moved createContentCaptureSession() to ContentCaptureSession.
Such move will allow nested sessions. For example, WebView could create a
new session for the main page, then child sessions for IFRAMEs contained on it.

This CL changes the API and provides an initial implementation, although it's
not quite ready yet - it only allows 1 level of children (from the activity
session), but the full implementation is coming soom to a movie theather near
you...

Bug: 121033016
Bug: 117944706

Test: atest CtsContentCaptureServiceTestCases

Change-Id: I86156bb3b8a2c08cb00b9518599eb6d67fbf77c2
2018-12-20 08:59:48 -08:00
Felipe Leme
fc24beab3e Changed ContentCaptureService to receive one event at time.
The initial implementation was using a batch the events to optimize the
performance, but that can be optimize behind the scenes (i.e., we can still
send the batches in the binder, but deliver them one by one).

This change not only makes it easier for the service to use the API, but it
paves the way to implement multiple sessions (so we can buffer children events
while the parent session is not completely started yet).

Bug: 121033016
Bug: 117944706
Bug: 121051220

Test: atest CtsContentCaptureServiceTestCases

Change-Id: I713ceb998bd81733255fd3ef8d0b8d7a3fcac20c
2018-12-19 16:36:19 -08:00
Felipe Leme
b63e0ddc84 Split ContentCaptureSession in 2 classes.
This is just a refactoring for now, but it paves the way to support children
sessions.

Bug: 121042846
Bug: 117944706

Test: atest CtsContentCaptureServiceTestCases

Change-Id: I64bb5562dcfd4a9f0f69bb13009e4cf47a4f3b37
2018-12-19 16:35:59 -08:00
Dieter Hsu
3541a64436 Merge "Refine API javadoc: onTouchExplorationHoverEvent" 2018-12-19 00:51:42 +00:00
Gus Prevas
1386358988 Merge "Fixes layout of icons in notification header." 2018-12-18 22:11:33 +00:00
Felipe Leme
b9687849bb Optimizes the Content Capture workflow by calling the service directly.
Initially, the ContentCaptureManager (in the app) was calling the
IContentCaptureManager (on system server) for everything, even to pass the
list of captured events, which caused 2 IPCs for each batch of events (i.e.,
from app to system_server, then from system_service to service).

This CL optimizes the workflow by getting rid of the "middle man" and sending
the events from the app to the service directly, which the system_server only
calling the service to notify when the view starts and finishes (and passing
the UID in the former so the servier can validate the sendEvents() calls).

Bug: 119220549
Test: atest CtsContentCaptureServiceTestCases

Change-Id: I6c08dccf755605320ac37cbc9424132e5455a594
2018-12-18 10:03:37 -08:00
TreeHugger Robot
74f1ce3fc1 Merge "Changed verbosity of log message shown when context is not autofillable." 2018-12-17 21:46:12 +00:00
Gus Prevas
8771761757 Fixes layout of icons in notification header.
This change resolves a discrepancy between onMeasure() and onLayout() in
NotificationHeaderView.  Icons were measured with their defined
margins in order to figure out how much to truncate the header text, but
during layout potentially multiple icons used the container's end
padding as their end margin (and their start margin was ignored).

Change-Id: I513efe2723fc78dd81bbe07aa40a3ed5fd1182d1
Fixes: 120893622
Test: manual
2018-12-17 14:00:12 -05:00
Felipe Leme
261e75fca6 Changed verbosity of log message shown when context is not autofillable.
Test: echo 'In TreeHugger we trust!'
Bug: 121063774

Change-Id: If2c6b3a93563e55a1d41d5ff294018ee2c19bbf3
2018-12-17 10:16:13 -08:00
TreeHugger Robot
56208f49dc Merge "Another round of changes on Content Capture." 2018-12-17 17:59:40 +00:00
Tiger Huang
860ed7c688 Merge "Make per-display focus optional (1/2)" 2018-12-16 07:15:30 +00:00
Tiger Huang
51c5a1d042 Make per-display focus optional (1/2)
In general cases, we don't have multiple input methods simultaneously.
So that it may not make sense to have multiple focused window in the
system. Especially when there are multiple blinking cursors of input
boxes on different displays, the user may not be able to know which
input box can receive key events. In these cases, we let the system
has only one focused window.

In some cases, there can be multiple input methods simultaneously (one
for each display). To enable multiple users to interact with the
corresponding displays at the same time, we should let the system have
per-display focused window in these cases.

This CL makes per-display focus optional, and also reverts ag/5312657

Fix: 120241480
Fix: 120790099
Test: atest ActivityManagerMultiDisplayTests \
            CtsWindowManagerDeviceTestCases \
            WmTests

Change-Id: Ie030eed523599b217060887171710692d050e5d8
2018-12-15 16:30:14 +08:00
Felipe Leme
aa5088ede6 Another round of changes on Content Capture.
- Get rid of activity-level events.
- Renamed InteractionSessionId and InteractionContext to
  ContentCaptureSessionId and ContentCaptureContext (and made them public)
- Create the explicit concept of ContentCaptureSesssion (and moved notification
  APIs to it).
- Added APIs to let apps create new sessions (not implemented yet).
- Added APIs to remove user data based on some context properties (like URI).

The reasoning behind this change is to let app developers explicitly associate
the captured content with some app-level domain (and also let the app ask the
service to clear such data at user's request). For example, a browser app
(and WebView) can use these APIs to associate the content capture events with
the URL being rendered.

Bug: 117944706
Fixes: 121034139

Test: atest CtsContentCaptureServiceTestCases
Test: m update-api && m

Change-Id: I7841da303b6a39c825651b03a07e3081fbd0bdf5
2018-12-14 18:02:24 -08:00
Jorim Jaggi
e71551c45d Merge "Trace dispatchApplyInsets" 2018-12-15 01:21:01 +00:00