Commit Graph

85736 Commits

Author SHA1 Message Date
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
00ebba4f98 Merge "Disable preview on volume change" 2018-09-10 11:47:22 +00:00
Andrey Kulikov
33d0507ea6 Merge "Fix IntDef's usages in the platform Transitions" 2018-09-10 09:56:14 +00:00
Yohei Yukawa
41b094f785 Use correct @*Res annotation for updateStatusIcon()
There was a small mistake in my previous CL [1].

What updateStatusIcon() takes is a resource ID for Drawable, not ID
for an integer value.

These @*Res annotations are still just hints for IDE and lint tools.
They are actually all @Retention(SOURCE) hence this kind of mistake
has no impact at run time actually.

This CL also adds the right annotation for corresponding methods in
InputMethodManager and InputMethodManagerService.

 [1]: I995c4b922f91b94438c1292392b2c3030598594f
      c7ca36845e

Bug: 114418674
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: Id7fd610c07643c79b8ec03efbda24b3dc0686844
2018-09-09 23:58:45 -07:00
TreeHugger Robot
d172e22a6a Merge "Allow IMM to forward API calls to IMS" 2018-09-10 06:13:52 +00:00
TreeHugger Robot
5d42542130 Merge "Stop relying on IMM in IMS for token-guarded IME APIs" 2018-09-10 05:53:25 +00:00
TreeHugger Robot
8aadce5633 Merge "Add a wrapper for IInputMethodPrivilegedOperations" 2018-09-10 05:34:13 +00:00
TreeHugger Robot
cbf1df8eb3 Merge "Remove redundant synchronized blocks" 2018-09-10 05:01:36 +00:00
Yohei Yukawa
eec552e9e9 Allow IMM to forward API calls to IMS
This is one further step towards deprecating 8 IME APIs that were
accidentally defined InputMethodManager (IMM) instead of
InputMethodService (IMS).

With this CL, API calls to those 8 deprecated ones in IMM will be
forwarded to IMS so that we can completely remove corresponding IPC
methods from IInputMethodManager.aidl.  This guarantees that processes
that have no InputMethodService running there become unable to access
IPC methods behind such IME APIs that are intended to be used only
from IMEs.

One tricky thing is that the following 4 public APIs have been allowed
to processes that have WRITE_SECURE_SETTINGS permission, even if such
a process does not have active InputMethodService.

 * InputMethodManager.setInputMethod
 * InputMethodManager.setInputMethodAndSubtype
 * InputMethodManager.switchToLastInputMethod
 * InputMethodManager.switchToNextInputMethod

In general, user mode apps should not have WRITE_SECURE_SETTINGS
permission.  Thus it might be not that difficult for us to simply
deprecate such a special rule.  Bug 114488811 is tracking that effort.

For now, this CL preserves the existing behavior when a null IME token
is specified to those 4 APIs.

Bug: 114418674
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: If762714b2003fa6477e1318110f63e13968c1d7e
2018-09-09 20:48:41 -07:00
Yohei Yukawa
c7ca36845e Stop relying on IMM in IMS for token-guarded IME APIs
This is a follow up CL to previous CLs [1][2][3] that made sure that
APIs that are exposed only to IMEs should live in InputMethodService
instead of InputMethodManager.

Now that we have a dedicated Binder inferface [4] that allows
InputMethodService (IMS) to directly send IPCs to
InputMethodManagerService (IMMS) without relying on
InputMethodManager (IMM), it is natural for the above public APIs in
IMS to stop relying on IMM.

This CL also addresses a small concern that it is no longer obvious
when those APIs become available.  Previously, it was a bit more
obvious that passing null IME token doesn't work so IME developers
could imagine that those APIs were unavailable until attachToken() is
called.

With this CL, InputMethodPrivilegedOperations starts showing warning
messages when called too early, which we hope help IME developers
understand why those APIs do nothing when called too early.

  [1]: I3163f3cbe557c85103ca287bee0874a3b4194032
       d8d03a8e1b
  [2]: If6a786c5774805d041ea9672ef2721e4a38df7fc
       fbc2f7acd5
  [3]: I6efd5ca473e33e6faeadb7eea7772b9d2b8ca12b
       164cfba536
  [4]: I2f3ec3c5de546fb3603275a4b64000ed3f863b65
       c54c117164

Bug: 114418674
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I995c4b922f91b94438c1292392b2c3030598594f
2018-09-09 20:48:38 -07:00
Yohei Yukawa
2bc3d6f0a6 Add a wrapper for IInputMethodPrivilegedOperations
This is a mechanical refactoring to split out boilerplate code around
IPCs from InputMethodManager to another file.

Bug: 114418674
Bug: 113177698
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I9ca251482867daea84c2777f74fd9b8a2b0f29cd
2018-09-09 20:48:34 -07:00
Yohei Yukawa
83b7d72a05 Remove redundant synchronized blocks
Unless it is also touching any internal field that needs to be
synchronized with InputMethodManager#mH, just making IPC to
InputMethodManagerService (IMMS) does not need any additional
serialization in the caller side.  IMMS itself already has internal
lock to serializate incoming operations.

Bug: 114418674
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I214d2c481c9fe862fbb9ec0759df2c798915b9f0
2018-09-09 20:48:25 -07:00
Phil Weaver
ec2b49927e Merge "Change API name for a11y keyboard flag" 2018-09-08 23:20:32 +00:00
TreeHugger Robot
b0142d5def Merge "WM: Parent SurfaceView to a new bounds surface" 2018-09-08 16:53:57 +00:00
TreeHugger Robot
5f6823f58b Merge "Add documentation about threading." 2018-09-08 12:12:14 +00:00
Vishnu Nair
b040c0150e WM: Parent SurfaceView to a new bounds surface
Fixes a couple of issues seen with PiP animations.
1. SurfaceView expands over the parent bounds.
2. SurfaceView and/or its background surface draws over the surface inset region of the parent.

Creates a child surface in ViewRootImpl that will crop any region outside its surface bounds after
adjusting for surface insets. Changed SurfaceView to parent to this new surface.

Test: manually run through PiP animations for Maps and YouTube.
Test: go/wm-smoke
Change-Id: Ib4b8e7f6753eda1e690e1ff6c92ce27165fa693e
2018-09-07 11:38:32 -07:00
Haoyu Zhang
f0e6794cae Merge "Add fontVariationSettings to TextView and TextAppearance in XML" 2018-09-07 17:43:47 +00:00
Julia Reynolds
fe992198c1 Add documentation about threading.
Change-Id: I8e0df7398f464cc829a83012f2ab6ee6441d0e4c
Fixes: 112249346
Test: make
2018-09-07 17:39:02 +00:00
Julia Reynolds
d7e9d35a44 Disable preview on volume change
Test: manual
Change-Id: If6994c4f41f5c727b1589b14a6a6f89abb346f80
Fixes: 112169378
2018-09-07 17:35:19 +00:00
TreeHugger Robot
59c1d01b85 Merge "Revert "Revert "DiskStats Westworld Migration""" 2018-09-07 17:24:28 +00:00
Seigo Nonaka
18df22767e Merge "Introduce system font enumeration API" 2018-09-07 17:14:13 +00:00
Andrey Kulikov
275ca2a651 Fix IntDef's usages in the platform Transitions
Bug: 68490704

1) Add annotation in some places where it was missed: constructors of Fade and Slide
2) Add Fade.IN and Fade.OUT into a set of allowed values for Visibility.MODE IntDef. Without it Lint will false alarm on this line:
new Fade().setMode(Fade.IN);
It should be allowed as Fade.IN is just a proxy value for Visibility.MODE_IN.

Test: n/a
Change-Id: I56d8ba5f49b1cf8f6a61357f58ac76312e7cf037
2018-09-07 16:54:45 +00:00
TreeHugger Robot
645537e522 Merge "Fixed findValueLocked() so it fetches values from previous sessions." 2018-09-07 16:22:38 +00:00
Eric Sandness
a521deb920 Merge "Block Policies From Device Admin Targetting Q" 2018-09-07 09:07:21 +00:00
TreeHugger Robot
fda4ab69fc Merge "Fix javadoc syntax in TypedValue" 2018-09-07 04:29:48 +00:00
TreeHugger Robot
826a36c19b Merge "Add a new Binder interface to allow IMS to directly talk to IMMS" 2018-09-07 02:11:07 +00:00
Ashley Rose
2b9a3355ec Fix javadoc syntax in TypedValue
Fixes: 114296097
Test: make
Change-Id: Ib5b8fef1607487cc0a37f58fe63f67c151cd12fb
2018-09-06 19:06:51 -04:00
Yohei Yukawa
c54c117164 Add a new Binder interface to allow IMS to directly talk to IMMS
Historically, InputMethodService (IMS) has relied on
InputMethodManager's hidden methods to communicate with
InputMethodManagerService (IMMS).  Because of this, InputMethodManager
(IMM) has ended up being a mixture of IPC endpoint for both IME
clients and IME itself.

There are multiple problems.

 * IMM is instantiated in almost all user mode processes.  This means
   that unnecessary IPC endpoints have been accessible to them via
   reflection.  Even though those endpoints refuses request without a
   valid IME window token, and even though we have tighten up use of
   private APIs in the runtime level, exposing unnecessary IPC
   endpoints is still questionable.
 * Mixing multiple responsibilities has been caused unnecessary
   complexity in IMM.  In Bug 70282603, we have moved some APIs from
   IMM to IMS to sort out this complexity that are surfaced in API
   boundary, but in the implementation level everything remained to be
   the same.

Now that Bug 70282603 is fixed, the natural next step is to start
implementing actual an IPC connection from IMS to IMMS without relying
on IMM.

Here is the new diagram that describes (most of) IPC interfaces around
IMEs.

   APP---(1)---IMMS
     \          |
      \         |
       \        |
        \       |
         \      |
         (2)   (3)
           \    |
            \   |
             \  |
              \ |
               \|
               IME

 (1): IInputMethodManager.aidl: send requests from APP to IMMS
      IInputMethodClient.aidl:  send requests from IMMS to APP
 (2): IInputMethodSession.aidl: send requests from APP to IME
      IInputContext.aidl:       send requests from IME to APP
       -> this is the actual interface behind InputConnection
 (3): IInputMethod.aidl:        send requests from IMMS to IME
      IInputMethodPrivilegedOperations.aidl:
                                send requests from IME to IMMS

IInputMethodPrivilegedOperations.aidl is what this CL is adding.

With that, this CL moves 5 IPC methods
  from IInputMethodManager.aidl (1)
  to IInputMethodPrivilegedOperations.aidl (3).

There remain some IPC methods that are intended to be used only from
IMEs in IInputMethodManager.aidl because those methods have been
unfortunately exposed via public APIs in InputMethodmanager.

Although all of those public APIs were deprecated in Android P as part
of Bug 70282603, we still need to keep maintaining those APIs until
(most of) IMEs migrate to APIs that are newly introduced in
InputMethodService.  It would take several years.

IInputMethodManager#getInputMethodWindowVisibleHeight() is another
method that we cannot migrate right now because some apps have already
relied on its corresponding hidden method in IMM, as discussed in Bug
113914148.

Fix: 113177698
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: I2f3ec3c5de546fb3603275a4b64000ed3f863b65
2018-09-06 11:39:50 -07:00
Phil Weaver
b8c855d1da Merge "Add test mapping for a11y" 2018-09-06 18:25:57 +00:00
TreeHugger Robot
1d6784b9ca Merge "Clarify that InputMethod.attachToken() can be called at most once" 2018-09-06 17:49:27 +00:00
Yohei Yukawa
674cc4bedd Clarify that InputMethod.attachToken() can be called at most once
I don't know whether this comment was valid in the initial
implementation or not, in the current system InputMethod.attachToken()
is not (indirectly) exposed to the IME client process vir Binder
interface.  The only Binder interface that is exposed from the IME
process to the IME client process is IInputMethodSession, not
IInputMethod that implements attachToken().

One may think that a malicious app could try to call
Context.bindService() with InputMethod.SERVICE_INTERFACE to directly
obtain IInputMethod, but it should fail because IMEs must be
protecting their InputMethodService with BIND_INPUT_METHOD so that
only the system can bind to them.

This CL clarifies this point in both JavaDoc and its implementation.
If an IME happened to receive multiple attachToken(), it is an OS bug
and worth letting people know by crashing the IME process.

Fix: 114164394
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Change-Id: Ia1e1d5ce020155b906e42a222f27b76905217395
2018-09-06 10:47:15 -07:00
Tej Singh
86dc9dba06 Revert "Revert "DiskStats Westworld Migration""
This reverts commit 6188aa3294.

Reason for revert: ag/4819964 has now been submitted. undoing the roll back.
Test: revert
Test: manually verified output is the same as diskstats.

Change-Id: I9a3292f66e1e28661e1d29f3befd002073b681c1
2018-09-06 10:32:01 -07:00
Ashley Rose
66b0919dd2 Merge "Add isColorType to TypedValue" 2018-09-06 15:44:41 +00:00
David Brazdil
b19f26e78f Merge "Move ApplicationInfo.usesNonSdkApi to private flags" 2018-09-06 14:10:22 +00:00
Charles Chen
3b37d4d803 Merge "Fix WM input limitations on secondary displays (3/4)" 2018-09-06 11:26:44 +00:00
Marcin Oczeretko
3680ae6276 Add a flag to enable/disable LooperStats collection
Test: Manually tested

Change-Id: I9cd4c819297ea34ab59c3cf9cfd11136987acc22
2018-09-06 10:54:35 +01:00
David Brazdil
a5b4df2a89 Move ApplicationInfo.usesNonSdkApi to private flags
No need to create an extra field for a boolean flag. Move the recently
added ApplicationInfo.usesNonSdkApi to one bit in privateFlags.

This also solves an issue where the field was not propagated during
copying of the data structure.

Bug: 113315999
Test: phone boots
Change-Id: I09f8f39454c013a84893ac304904a4412fc542bf
2018-09-06 09:53:08 +01:00
TreeHugger Robot
ec3471c182 Merge "Wake-screen gesture implementation" 2018-09-06 07:23:23 +00:00
TreeHugger Robot
029f67f852 Merge "Add TODO about IMM#getInputMethodWindowVisibleHeight()" 2018-09-06 06:54:40 +00:00
Felipe Leme
5429ade944 Fixed findValueLocked() so it fetches values from previous sessions.
Test: atest MultiScreenLoginTest:testSaveBothFieldsCustomDescription_differentIds
Bug: 113593220

Change-Id: I662c526e1d885cc1cdbff113172a0b674dd0849c
2018-09-05 18:20:02 -07:00
Yohei Yukawa
b985e6e245 Add TODO about IMM#getInputMethodWindowVisibleHeight()
InputMethodManager#getInputMethodWindowVisibleHeight() has been kind
of unintentionally exposed to all the IME client processes and we know
some apps are already relying on this hidden API via reflection, which
is bad especially because it would be getting harder and harder to
keep maintaining the semantics of this not-well-defined hidden API
once we start supporting features like multi display. Thust this CL
adds TODO comments there to warn people who are going to touch this
method.

This CL does nothing except for adding comments.  Hence there should
be no behavior change.

Bug: 113914148
Test: compile
Change-Id: Id2084530bdb82deef226d8207d2f311d2e78b28d
2018-09-05 17:07:52 -07:00
TreeHugger Robot
b1559cdfac Merge "API Review: StateListDrawables#getDrawableForState" 2018-09-05 23:33:57 +00:00
Ashley Rose
aa554ae636 Add isColorType to TypedValue
There's a lot of places that used TypedValue.TYPE_FIRST_COLOR_INT and
TypedValue.TYPE_LAST_COLOR_INT, and I'd like to propose that it's enough
of an implementation detail that it should have a dedicated public
method to query it.

Fixes: 114126626
Test: CTS tests to be added
Change-Id: I4d2a927cc3d2e999985d7e1c9b647d513fff53fc
2018-09-05 19:30:53 -04:00
Lucas Dupin
323f9ffcb4 Wake-screen gesture implementation
Bug: 111414690
Test: adb shell dumpsys activity service com.android.systemui
Test: manual with alternative sensor event
Change-Id: Ib38085388c0e9ebce9eb59712cdfde5f8d7ccc8c
2018-09-05 15:24:23 -07:00
Seigo Nonaka
c7b3e62f0d Introduce system font enumeration API
To be able to use font file in their apps, provides blob and path to the
font file and locale list as well.

Bug: 26116537
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest
    CtsGraphicsTestCases:android.graphics.font

Change-Id: I1ae1302c6906b808012e1e91b1e4ab393c887cb6
2018-09-05 14:54:12 -07:00
TreeHugger Robot
900fa92042 Merge "Only set FLAG_SCALED for fixed size wallpapers" 2018-09-05 21:44:19 +00:00
TreeHugger Robot
46fef17ee5 Merge "Add feature flag for data usage v2." 2018-09-05 20:16:27 +00:00
TreeHugger Robot
329fd3bc0d Merge "Add FEATURE_FACE and FEATURE_IRIS" 2018-09-05 20:12:54 +00:00
TreeHugger Robot
1a56d75fb4 Merge "USB permission and resolve activity refactor." 2018-09-05 20:05:50 +00:00
TreeHugger Robot
11e4bd07e1 Merge "Move Viewport types to DisplayViewport" 2018-09-05 19:46:41 +00:00