Commit Graph

11602 Commits

Author SHA1 Message Date
TreeHugger Robot
9c1c9c2acb Merge "Fix CtsApacheHttpLegacy27ApiSignatureTestCases:SignatureTests" 2018-09-28 18:01:14 +00:00
lumark
17159152cd Fix CtsApacheHttpLegacy27ApiSignatureTestCases:SignatureTests
Set InputMethod.updateInputMethodDisplay as default method for fixing API
check.
Since this method is @hide & we don't want to enforece user to implement.

Bug: 116662257
Bug: 111364446
Test: atest CtsApacheHttpLegacy27ApiSignatureTestCases:SignatureTest#testSignature

Change-Id: Ifb136d86d19bc4f95154a9076d42326ce12f665f
2018-09-28 13:05:21 +08:00
John Reck
702196562e Merge "Wire-up default force-dark based off of isLightTheme" 2018-09-27 23:04:02 +00:00
John Reck
bb3a358317 Wire-up default force-dark based off of isLightTheme
Bug: 102591313
Test: Compared settings in light & dark UI modes with
force_dark set to true. Observed that force_dark fixes
were not present when UI mode was set to dark, indicating
force_dark was appropriately globally-disabled

Change-Id: I5882829bb5871829fc8fc9911682f52a6ba5f445
2018-09-27 19:38:13 +00:00
John Reck
a6107c1659 Merge "De-couple RenderNode from View package" 2018-09-27 16:54:32 +00:00
John Reck
6b1644022b De-couple RenderNode from View package
First step of moving RenderNode to the graphics package

Test: builds
Change-Id: Ife7f5ec6698e32393d1b85ed2bad909ef0210be4
2018-09-26 16:29:32 -07:00
TreeHugger Robot
dfc12dba82 Merge "Export lib3 to AOSP (System server part)" 2018-09-26 16:53:28 +00:00
Yohei Yukawa
bf25f9ed4e Use DisplayContext to obtain InputMethodManager in ViewRootImpl
Historically ViewRootImpl#mContext has been just pointing to the
Context instance associated with whatever first View instance that is
being added to a Window.  In other words, ViewRootImpl#mContext is not
owned by ViewRootImpl.

This can become a problem if ViewRootImpl is moved from a display to
another display with ViewRootImpl#updateInternalDisplay(), which was
added last year to support multiple displays [1], because there is no
guarantee that the target Contaxt that is pointed from
ViewRootImpl#mContext is also updated to have the new display ID.

In order to support multi-display we need to use the right Context at
least when interacting with InputMethodManager. Hence as a short term
solution this CL introduces ViewRootImpl#mDisplayContext so that the
right instance of InputMethodManager can receive callback from
ViewRootImpl. In this way, we can make sure that the behavior change
in ViewRootImple is limited to how InputMethodManager instance is
obtained.

Longer term solution will be discussed in Bug 116349163.

 [1]: I9a9501cab788623ada15a31efb53e4b2378639fe
      b047b8bd7e

Bug: 115893206
Test: atest ActivityManagerMultiDisplayTests
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: Ifa0ca24e9cf764caf492ee065606680b6a06751a
2018-09-25 15:19:38 -07:00
Tony Mak
64c4cb2ea9 Export lib3 to AOSP (System server part)
The java counterpart of the JNI is now moved to external/libtextclassifier.

Test: atest android.view.textclassifier.TextClassificationManagerTest

Change-Id: Ide5e58d1c80d9a028cea4e9192a91aeac2843c71
2018-09-25 13:42:44 +01:00
TreeHugger Robot
fd74da1573 Merge "Deprecate InputMethodManager#getInstance()" 2018-09-24 22:41:07 +00:00
TreeHugger Robot
e64d55010f Merge "Create plumbing for disabling force-dark" 2018-09-24 19:54:33 +00:00
TreeHugger Robot
cc704723bd Merge "Fixed FillCallback.onFailure() and SaveCallback.onFailure() behavior." 2018-09-24 18:48:13 +00:00
John Reck
1423e1331f Create plumbing for disabling force-dark
Test: sysui's rounded corners are no longer white
Bug: 102591313

Change-Id: Id99ae38c354cef06b94a5fb79b5b1a9a216a514c
2018-09-24 09:34:18 -07:00
TreeHugger Robot
21ba5d4f3f Merge "Let IMM have internal APIs for layoutlib" 2018-09-22 16:31:28 +00:00
Yohei Yukawa
6c07572f16 Deprecate InputMethodManager#getInstance()
With this CL, no one in the Framework is using
InputMethodManager#getInstance() directly or indirectly.  It is time
to mark this method deprecated.

For applications that still call InputMethodManager#getInstance()
directly or indirectly via reflection, they will start seeing warnings
with stacktrace in logcat.

Except for that explict warnings in logcat, there is no behavior
change in this CL.  Added a new test to make sure that
InputMethodManager#getInstance() and InputMethodManager#peekInstance()
are still working in a way we expected for such applications.

Fix: 115891476
Test: atest FrameworksCoreTests:android.view.inputmethod.InputMethodManagerTest
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: Ib393086d921f91993395b5f0007b725a5db7bf22
2018-09-21 14:52:12 -07:00
Felipe Leme
d9dc954e8f Fixed FillCallback.onFailure() and SaveCallback.onFailure() behavior.
FillCallback.onFailure() was not working as intented - it finished the session
on AutofillManagerService, but didn't update the client state on
AutofillManager.

And both of these methods were displaying Toasts to the user, which is something
the autofill services could take care of. Hence, for services target with SDK
Q, the message is ignored.

Also added a new Autofill Metric: FIELD_AUTOFILL_MESSAGE_LEN

Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.LoginActivityTest#testAutofillAgainAfterOnFailure
Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break anything
Test: time mmm -j frameworks/base/:doc-comment-check-docs
Test: m -j update-api

Bug: 112192360
Fixes: 116103297

Change-Id: I499909200980943dedf1fc8524dd1f14b49e2158
2018-09-21 13:31:44 -07:00
TreeHugger Robot
e1b637d296 Merge "Make IMM#peekInstance() thread-safe" 2018-09-21 01:48:13 +00:00
kopriva
b7b399ed76 Merge "docs: fixing several minor documentation bugs" into pi-dev am: 82b0d17b39
am: f6b27fbff0

Change-Id: I14f98e023001c75719ab8b891db6abf3f0fd4564
2018-09-20 17:12:29 -07:00
kopriva
f6b27fbff0 Merge "docs: fixing several minor documentation bugs" into pi-dev
am: 82b0d17b39

Change-Id: Ieb1447c0d7cda629338de8d6e03f46670d8ed0b0
2018-09-20 16:55:47 -07:00
Yohei Yukawa
daf0d1b6fb Let IMM have internal APIs for layoutlib
In order to stub out InputMethodManager (IMM), currently layoutlib
tries to directly update internal details of InputMethodManager, which
is really fragile and hard to maintain.

With this CL, IMM officially defines an internal concept "EditMode"
and privately exposes internal APIs to layoutlib.

There should be no behavior difference in production build.

Bug: 115891476
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: Ide6aa5bc36c14449e87bec33a4962b87809b9d77
2018-09-20 15:53:07 -07:00
Yohei Yukawa
3b3a2ade94 Make IMM#peekInstance() thread-safe
Somehow InputMethodManager#peekInstance() has not been thread-safe.
Although we basically do not care this deprecated method, but let's
just update it for consistency.

Bug: 115891476
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I56bf05f76a7939f004efefdd956776e533bae058
2018-09-20 15:50:35 -07:00
Chavi Weingarten
3623c39cd3 Merge "Remove minLayer and maxLayer from display screenshot." 2018-09-20 19:03:42 +00:00
kopriva
f07a46058c docs: fixing several minor documentation bugs
Test: make ds-docs

Bug: 36949243
Bug: 116169695
Bug: 37001248
Bug: 37044885
Bug: 37053166

Change-Id: I844a8978518cd7214bf9d068d602902dfa7e8246
Exempt-From-Owner-Approval: Docs-only change
2018-09-20 11:20:27 -07:00
TreeHugger Robot
4435742cd1 Merge "Let IMMS be responsible for IInputMethodClient lifecycle" 2018-09-20 17:27:53 +00:00
daqi
ef4dda2d02 Merge "Merge "Set InputMethoMananger#mCurRootView to null when window dismissed" am: 7bd18423f6 am: 9c5a6e2c6c" into pi-dev-plus-aosp
am: 205f5bd249

Change-Id: I69f543dc6be8383b289e61aabb5de4bd1f8f09c1
2018-09-19 20:00:44 -07:00
daqi
4d5ba15e69 Merge "Set InputMethoMananger#mCurRootView to null when window dismissed" am: 7bd18423f6
am: 9c5a6e2c6c

Change-Id: I6198c9d52c19e48f61bb4d488018c067d4b80108
2018-09-19 19:35:27 -07:00
daqi
9c5a6e2c6c Merge "Set InputMethoMananger#mCurRootView to null when window dismissed"
am: 7bd18423f6

Change-Id: Ie0127bd83b714c540bcf387a3fc74d01bd60eb13
2018-09-19 19:22:12 -07:00
Yohei Yukawa
a71bb25cff Let IMMS be responsible for IInputMethodClient lifecycle
This is the last step to remove the dependency on IInputMethodClient
from WindowManagerService.

With my previous CL [1], now WindowManagerService (WMS) depends on
IInputMethodClient just because it implements lifecycle management of
IInputMethodClient on behalf of InputMethodManagerService (IMMS).

This CL mechanically moves that responsibility from WMS to IMMS for
better separation of concerns.  It is a bit ironic that this CL is
partly undoing my previous CLs [2][3] that removed
IInputMethodManager.addClient() though.

This CL aims to preserve the current observable behavior (e.g. when
InputMethodManager instance is being created) as much as possible.
Most likely there would be no observable behavior difference when seen
from other components.

 [1]: I444077b1e4af4033f67ab72c181fac85b601e08a
      41f89c3bcc
 [2]: I453200fd5847e9a78876affb6a1caec221525e1d
      e24ed79edb
 [3]: Id91dd600120e4981aa1d9005ce644728968430c9
      fffc0e53c6

Fix: 115993358
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I7726c70613ea72d6e78fa5754e9fc840f0a40f11
2018-09-19 19:21:24 -07:00
Treehugger Robot
7bd18423f6 Merge "Set InputMethoMananger#mCurRootView to null when window dismissed" 2018-09-20 00:35:25 +00:00
daqi
dff365ef4d Set InputMethoMananger#mCurRootView to null when window dismissed
InputMethodManager#sInstance is a long live static object so we have to
set its field with right value, otherwise any object referenced by it
cannot be gc including potential activity context.

Now InputMethodManager#mCurRootView is set to null in
InputMethodManager#onPreWindowFocus which is invoked when app's
ViewRootImpl received ViewRootImpl#W#windowfocusChanged from WMS.
However, in the ViewRootImpl#W#windowfocusChanged, mViewAncestor is a
weak reference which get() may returns null sometimes.
One scenario is the ViewRootImpl#W#windowfocusChanged is called after
ActivityThread#handleDestroyActivity. The activity is destroyed and its
ViewRootImpl get GC'd. Then InputMethodManager#onPreWindowFocus won't
get called and InputMethodManager#mCurRootView won't be set to null.

And it is a proper time to set InputMethodManager#mCurRootView to null
when the window it served dismissed.

Fix: 116078227
Test: Break at ActivityThread#handleDestroyActivity and ViewRootImpl#W#windowfocusChanged

Change-Id: I8fabb30f14bcb2cd7019e29b6642b4562d49d248
Signed-off-by: daqi <daqi@xiaomi.com>
2018-09-20 08:30:40 +08:00
chaviw
08520a05af Remove minLayer and maxLayer from display screenshot.
When taking a full display screenshot, there's no longer a need for min
and max layer. Instead, the entire display will be screenshotted. If
only some layers should be screenshotted, then use the captureLayers method
instead.

Also, condensed the methods so there is only one screenshot method for
displays that returns a GraphicBuffer. SurfaceControl can then convert
it to the desired format, like Bitmap or Surface.

Test: Rotation, adb shell screencap, power + volume down, bugreport.
Change-Id: Ia5a293e89d2cf3811fd06ffcbafeee389a32840e
2018-09-19 10:11:53 -07:00
TreeHugger Robot
bd5fed399f Merge "Let InputMethodPrivilegedOperationsRegistry deal with its singleton-ness" 2018-09-19 16:48:54 +00:00
Yohei Yukawa
d746a7e893 Let InputMethodPrivilegedOperationsRegistry deal with its singleton-ness
This is a preparation to allow InputMethodManager to have per-display
instances rather than the current per-process singleton instance.

When I introduced InputMethodPrivilegedOperationsRegistry [1], there
was an assumption that InputMethodManager was a per-process global
singleton object.

Now that we are going to break up that global per-process instance
into multiple per-display instances, having multiple
InputMethodPrivilegedOperationsRegistry instances probably does not
make much sense, because it would likely to increases the risk of
compability issues in existing IMEs.  Although IME developers soon
really need to use the right Context to obtain the right instance of
InputMethodManager anyway, unnecessarily introducing compatibility
pitfalls that can be avoided in the Framework side is not my
intention.

With this CL, following 9 methods can continue to work no matter
whether InputMethodManager is a per-process singleton or not.
This is fine because those APIs had been mistakenly exposed in
InputMethodManager and already deprecated in favor of newly added ones
in InputMethodService.

 * InputMethodManager.hideSoftInputFromInputMethod
 * InputMethodManager.hideStatusIcon
 * InputMethodManager.setInputMethod
 * InputMethodManager.setInputMethodAndSubtype
 * InputMethodManager.shouldOfferSwitchingToNextInputMethod
 * InputMethodManager.showSoftInputFromInputMethod
 * InputMethodManager.showStatusIcon
 * InputMethodManager.switchToLastInputMethod
 * InputMethodManager.switchToNextInputMethod

 [1]: If762714b2003fa6477e1318110f63e13968c1d7e
      eec552e9e9

Bug: 115893206
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I4a61470f06ffac5f7a512536f8431489db0108f4
2018-09-18 18:55:02 -07:00
TreeHugger Robot
a52c7fc776 Merge "Log when autofill is disabled in a view." 2018-09-18 23:51:49 +00:00
TreeHugger Robot
173222142f Merge "Always use Context.getSystemService() to get IMM" 2018-09-18 22:25:52 +00:00
Felipe Leme
b9467a1155 Log when autofill is disabled in a view.
Such log helps diagnosing when app developers explicitly disabled autofill.

Bug: none

Test: manual verification

Change-Id: I829b2c583db4b6513ec877dd868b3e8181a0f266
2018-09-18 10:44:26 -07:00
Philip P. Moltmann
08b171d0ff Merge "Allow mainline modules to set private window flags" 2018-09-18 16:46:13 +00:00
Rhed Jao
7102a0dfcc Merge "Add text entry key property to a11y info node" 2018-09-18 06:06:31 +00:00
TreeHugger Robot
6467990e46 Merge "Fixed when the CompatibilityBridge is attached to an activity." 2018-09-18 01:19:27 +00:00
Yohei Yukawa
484d4afc92 Always use Context.getSystemService() to get IMM
This is a preparation to deprecate the following two methods.

 * InputMethodManager#getInstance()
 * InputMethodManager#peekInstance()

Since we soon need to stop relying on the current per-process
InputMethodManager singleton model to fully support multi-display,
those two methods really need to be deprecated.

With this CL, framework code no longer depends on
InputMethodManager#peekInstance(), which is also marked as deprecated
in this CL.

InputMethodManager#getInstance() is a bit tricky because it also works
as a constructor of such a per-process singleton instance.  Remaining
two call-sites of this method will be migrated in a subsequent CL.

This is a mechanical refactoring, which in theory should have no
observable logical behavior difference.

There could be a small performance regression, but it is basically not
avoidable to correctly support multi-display scenarios.

Bug: 115891476
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest CtsWidgetTestCases:android.widget.cts.EditTextTest
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: atest FrameworksCoreTests:com.android.internal.inputmethod
Test: atest FrameworksServicesTests:com.android.server.textservices
Change-Id: I5db31491f3d47d3ad4a621e956995135c72e007b
2018-09-17 16:47:08 -07:00
Philip P. Moltmann
d66dd99a9f Allow mainline modules to set private window flags
We need to prevent apps from trying to decorate the permission grant
requests. Hence the the permission controller app (which will become a
mainline module) will need to set the
PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS private window flag.

Test: Built
Bug: 110953302
Change-Id: I7dfed6aac8ec487ac0665ad33c2892cad416224a
2018-09-17 19:16:44 +00:00
Felipe Leme
ce40498dc2 Fixed when the CompatibilityBridge is attached to an activity.
The AccessibilityManager is a singleton, so we need to update it everytime
an activity is resumed.

Test: manual verification with Chrome (CTS test is an overkill here)
Test: atest CtsAutoFillServiceTestCases # to make sure it didn't break anything

Fixes: 112690889
Change-Id: If011db203dee96ec511da80f4e49395c0340f482
2018-09-17 09:58:56 -07:00
TreeHugger Robot
a02f4332b3 Merge "Extract constructLocaleFromString()" 2018-09-15 16:58:05 +00:00
Ian Lake
9183f2d97c Merge "Annotate Window.Callback menu methods with nullability" 2018-09-14 15:52:56 +00:00
Mathew Inwood
db0657a4f4 Merge "Move some members to the "Q blacklist"." 2018-09-14 13:54:28 +00:00
Mathew Inwood
8c854f86a4 Move some members to the "Q blacklist".
Based on some analysis, these fields/methods are likely false positives.
Set maxTargetSdk=P so that any apps using them are required to migrate off
them in future. See the bug for more details.

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: I719b5c94e5b1f4fa562dd5d655953422958ad37e
2018-09-14 13:18:34 +01:00
kopriva
eac0905c11 docs: fixed instances of typo in 'overridden' am: debd4ee72d
am: 9b641cbc71

Change-Id: I071643e73656a2a17a3c0ab89ffacda9c1bfec80
2018-09-13 15:11:27 -07:00
kopriva
9b641cbc71 docs: fixed instances of typo in 'overridden'
am: debd4ee72d

Change-Id: Idde6240486463dee51cdc27b8cd066a80fb869e0
2018-09-13 14:57:25 -07:00
Ian Lake
0b71b8e719 Annotate Window.Callback menu methods with nullability
Also update the two common implementations using these:
Activity and Dialog.

BUG: 78245676
Test: make
Change-Id: If7b95b73df7dedb12210819d831ba7102344facf
2018-09-13 14:07:17 -07:00
kopriva
debd4ee72d docs: fixed instances of typo in 'overridden'
This affects several files beyond those mentioned in the bug.

I didn't fix some instances because the files had code
problems that blocked presubmit checks.

Test: make ds-docs

Bug: 37094741

Change-Id: I642f0384fef2b267ebc970bae1b4fb90bae667e7
Exempt-From-Owner-Approval: Docs-only change
2018-09-13 11:40:59 -07:00