Commit Graph

10065 Commits

Author SHA1 Message Date
Michael Dooley
c106550132 Merge "Revert "Adding getModelState API to sound trigger"" 2018-09-14 16:21:17 +00:00
Michael Dooley
81f71f1c27 Revert "Adding getModelState API to sound trigger"
This reverts commit 4f809fe73e.

Reason for revert: fix build breakage

Change-Id: I75a54189f96fc21f6cb12dd8a05e513b1bda027c
2018-09-14 16:09:18 +00:00
Mathew Inwood
db0657a4f4 Merge "Move some members to the "Q blacklist"." 2018-09-14 13:54:28 +00:00
Michael Dooley
a707ba1cb0 Merge "Adding getModelState API to sound trigger" 2018-09-14 12:32:09 +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
TreeHugger Robot
7a21a3128d Merge "Support IME Window to show in secondary display." 2018-09-13 07:54:47 +00:00
lumark
90120a8b5b Support IME Window to show in secondary display.
1) Moving WMS.setInputMethodWindowLocked to DisplayContent,
   each display can have its own IME window.
2) Add getDisplayIdFromWindow in WindowManagerInternal,
   used for InputMethodManagerService to know which display
   for given IME window token.
3) Support add / remove IME window according displayId.
4) Modify WMS.inputMethodClientHasFocus to traverse all active display
   if inputMethodClient focused.
5) Add displayId parameter for IInputMethod.initializeInternal to
   update context display then client can addView to right display.

Note: 1) There should be zero behavior difference as long as the target
         app is running on the default display.
      2) The current implementation is not final and there are still
         chances that the current IME may not work well or even crash
	 depending on how the IME is implemented.

Bug: 111364446
Test: manual, use ActivityView & launch Messages in VirtualDisplay,
      tap search icon to see if soft input keyboard shown &
      app window size is adjusted by soft input.
Change-Id: I8da315936caebdc8b2c16cff4e24192c06743251
2018-09-13 12:52:40 +08:00
Lucas Dupin
a354763925 Merge "Pitch black SysUI theme" 2018-09-12 23:05:05 +00:00
Chih-hung Hsieh
38158dd171 Merge "Use multiple patterns and emails in per-file syntax." am: d3f10fe89c am: 697a0b6634
am: 7a84739070

Change-Id: Ibb610fabef94dfe309275f9d1dcb29e5ddf8f270
2018-09-12 14:13:10 -07:00
TreeHugger Robot
3f2333b050 Merge "Revert "Prepare to make InputMethodUtils package-private"" 2018-09-12 20:42:45 +00:00
Chih-hung Hsieh
7a84739070 Merge "Use multiple patterns and emails in per-file syntax." am: d3f10fe89c
am: 697a0b6634

Change-Id: Ie36d24fa75121430db5ec9cfd73aec36efd0a706
2018-09-12 13:21:25 -07:00
Chih-hung Hsieh
697a0b6634 Merge "Use multiple patterns and emails in per-file syntax."
am: d3f10fe89c

Change-Id: If9c5cda9043bb21b256ab614133ad8a57c312517
2018-09-12 11:38:48 -07:00
Yohei Yukawa
24d8f6d0ff Revert "Prepare to make InputMethodUtils package-private"
This reverts commit 16703c4b47.

Reason for revert:
Just realized that this was not the best approach.

We could already make LocaleUtils package-private too before this CL.
So the right approach was moving these methods to new Java class(es)
instead of moving these methods to LocaleUtils.

Bug: 77730201
Bug: 114660660
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:com.android.internal.inputmethod
Change-Id: I29c87b9692f0f5e8255835579e2fb5270bc6c9c3
2018-09-12 17:26:55 +00:00
TreeHugger Robot
cdc36adcda Merge "Fix a JavaDoc link to inputMethodClientHasFocus()" 2018-09-12 01:37:17 +00:00
Lucas Dupin
d26faccd0c Pitch black SysUI theme
Test: visual
Bug: 110758454
Change-Id: Id673133763e5624f380facf008ecc4c78092fe13
2018-09-11 15:24:22 -07:00
Yohei Yukawa
603f4d00c6 Move InputMethodManagerService to com.android.server.inputmethod
This CL moves InputMethodManagerService (IMMS)
  from com.android.server
    to com.android.server.inputmethod
so that we can mechanically factor out inner classes from IMMS to
separate package private classes.

This is purely a mechanical refactoring of an implementation detail.
There should be no observable behavior difference.

Fix: 114660660
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:com.android.internal.inputmethod
Change-Id: I023d8f2863601ee54f304988117d8ea750770f70
2018-09-11 15:04:58 -07:00
Yohei Yukawa
e302d2ea28 Fix a JavaDoc link to inputMethodClientHasFocus()
I forgot to update this JavaDoc in my recent CL [1] that moved
inputMethodClientHasFocus() from WindowManagerService to
WindowManagerInternal.

 [1]: I20c618174d8279a9a57f458fb908235f452b2281
      cf93f9a53f

Bug: 112722651
Test: compile
Change-Id: I46cc9dd7479cc178770098a7bb6f0785598db3cf
2018-09-11 14:23:31 -07:00
TreeHugger Robot
5789fa6b73 Merge "Prepare to make InputMethodUtils package-private" 2018-09-11 21:19:48 +00:00
TreeHugger Robot
48c882b485 Merge "Move notifyUserAction() to IInputMethodPrivilegedOperations" 2018-09-11 21:11:41 +00:00
Sudheer Shanka
61585a8094 Merge "Add javadoc for package-name arg passed during the process start." 2018-09-11 19:53:06 +00:00
Yohei Yukawa
c07fd4c284 Move notifyUserAction() to IInputMethodPrivilegedOperations
This CL re-implements the way to propagate user action on an IME to
InputMethodManagerService (IMMS) so that we can dynamically update IME
Subtype rotation list discussed as requested in Bug 7043015.

It turns out that my previous CLs [1][2][3][4] are unnecessarily
complex because I tried to monitor user behavior in the IME client
process rather than in the IME process.  In the end, I ended up
introducing a sequence number protocol for the sake of performance
with a ton of complexity.

This could have been implemented in a much safer and simpler way by
sending user action signals from the IME process to IMMS, because

 A. IME already knows when it switches to a new subtype. IME needs to
    send a signal only once per subtype change.  There is no need to
    use sequence counter.
 B. Malicious IME client is unable to disturb IME rotation list by
    sending a fake signal because the IPC endpoint is no longer exposed
    to IME client processes.

In case there remain some applitations that still call this hidden API
via reflection without gracefully handling exceptions, this CL keeps
InputMethodManager.notifyUserAction() as a stub method so as not to
break such applications.

 [1]: I11ed9a767588f8080753cd9bce011dac7db579ad
      d7443c83ce
 [2]: I7f3e13a7226ef0dceee82b67e8a0d8536f7e9807
      2a6a8d2fbb063c84e388c185402c4ca788618c72
 [3]: I19ad8542659bc092b92ee13eb9f1d68ddd4b815a
      b56c6c721fc01fba8e36632d8e28f5123831abc5
 [4]: I03fa436df0a5e348b3f93170aab3a8ac5a7e1677
      c21ccc151631663d71230a3c1c756d94b575ab9e

Bug: 113177698
Fix: 114159783
Test: Manually verified as follows
  1. Build and flush aosp_taimen-userdebug
  2. make -j SoftKeyboard
  3. adb install -r $OUT/system/app/SoftKeyboard/SoftKeyboard.apk
  4. adb shell ime enable com.example.android.softkeyboard/.SoftKeyboard
  5. Open AOSP Keyboard settings
  6. Enable "English (US)", "French", and "German"
  7. Open SoftKeyboard settings
  8. Enable "English (United States)", "English (GB)"
  9. Open the Dialer app and tap the top edit field.
 10. Make sure that the IME layout rotation order when tapping the
     globe key will be updated only when you tap the keyboard to enter
     some character.
 11. Also confirm it with "adb shell dumpsys input_method" by checking
     "mSwitchingController:" section there.
Change-Id: Icc1f9c7f530f0144ecfd460e86114e109ae0044e
2018-09-11 11:37:13 -07:00
Yohei Yukawa
16703c4b47 Prepare to make InputMethodUtils package-private
In Bug 77730201, we cleaned up a bunch of files so that only modules
inside framework/base depend on InputMethodUtils.  This CL is a
preparation of a further hardening.

Just by moving two utility methods from InputMethodUtils to
LocaleUtils, InputMethodUtils is used only from
InputMethodManagerService and its direct dependencies.  This allows us
to make InputMethodUtils package-private class to make sure anyone
outside our team is unexpectedly depending on InputMethodUtils in a
subsequent CL.

This is a mechanical refactoring.  There should be no observable
behavior difference.

Bug: 114660660
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:com.android.internal.inputmethod
Change-Id: Ie8cb198880a145a7b81d2bf1eae1531ac3614019
2018-09-10 15:19:53 -07:00
Chih-Hung Hsieh
83a24d8e9b Use multiple patterns and emails in per-file syntax.
Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: I46a4788c0cda69d0a3aadcf1f3dc539aa3c62fc3
2018-09-10 10:26:49 -07: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
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
Annie Meng
1dbac1a58f Merge "[FBR] Extract app metadata backup to helper" 2018-09-07 14:52:44 +00:00
Annie Meng
1374690674 [FBR] Extract app metadata backup to helper
In full backup, we backup additional metadata about the app
(manifest, widget, apk, obb) not specified by the app's backup agent.
This CL extracts these methods out to their own helper (AppMetadataBackupWriter)
and adds unit tests for these methods.

** Note: The backup behavior is the same, only the structure has changed.
Behavioral changes will be done in future CLs. **

What this CL covers:
- Move the backup of this extra app data out of the FullBackupEngine to
separate agent data backup and non-agent data backup.
- Move logic of deciding what data to backup from FullBackupEngine to
FullBackupRunner (where the writer is used).
- Add unit tests for metadata backup.
- Some style fixes/clean up.

Not covered (future CLs):
- Refactoring FullBackupEngine/FullBackupRunner mechanism.
- Streaming backup data directly instead of writing to temporary files.
- Separating out and fixing apk and obb backup.

Bug: 110081582
Test: 1) atest AppDataBackupWriterTest
2) atest RunFrameworksServicesRoboTests
3) atest GtsBackupHostTestCases
4) Verify success for:
 - adb shell bmgr backupnow <full backup package>; adb restore 1 <full
backup package>
 - adb backup <full backup package>; adb restore
 - cloud backup and restore
5) Use local transport and adb backup to inspect manifest and widget data
written and file metadata consistent between runs.
6) Verify compatibility with adb backup -keyvalue manifest

Change-Id: Icb43fd2e0505c2416738ee3ef370b206363fac68
2018-09-07 14:56:45 +01:00
TreeHugger Robot
b29199a6c1 Merge "Refine procstats metric protos." 2018-09-07 05:21:00 +00:00
Yangster-mac
bac8232377 Refine procstats metric protos.
Test: statsd tests.
BUG: b/113075414

Change-Id: Ifaff592a01f3bf33854033419e72949a8aa0717f
2018-09-06 18:40:52 -07: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
TreeHugger Robot
cf7039dc95 Merge "Fix lint errors around import lines in IInputConnectionWrapper" 2018-09-06 17:54:05 +00:00
Yohei Yukawa
5c1989a385 Fix lint errors around import lines in IInputConnectionWrapper
This is a mechanical code clean-up. No behavior change is expected.

Bug: 113177698
Test: Run the following command to confirm that there remains no lint
      error regarding import lines:
  prebuilts/checkstyle/checkstyle.py -f \
  frameworks/base/core/java/com/android/internal/view/IInputConnectionWrapper.java
Change-Id: Ife60e0b4234b5c8bc2d4d192b33dc97b156ea7fc
2018-09-06 10:52:45 -07:00
Marcin Oczeretko
c80c81a516 Extract CachedDeviceState from BinderCallsStats
Add a service that tracks the device state properties which are
interesting to System Server telemetry services. Allows the services to
share this code and have consistent state information.

Test: Unit tests and manually tested
Change-Id: Ia5c78c45a55414a0c5c46202db2a37283b50a703
2018-09-06 10:54:55 +01: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
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
Sudheer Shanka
d81b1d764b Add javadoc for package-name arg passed during the process start.
This was left out of earlier change which added the package-name arg.
Also, add @NonNull/@Nullable annotations to these arguments.

Bug: 111890351
Test: manual
Change-Id: I0e496172a95bfba432efc6f7f216eb1f0e951511
2018-09-05 18:56:38 -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
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
Marcin Oczeretko
f1d4563acd Merge "Collect telemetry data for System Server Loopers." 2018-09-05 19:12:45 +00:00
TreeHugger Robot
7ea11f2b14 Merge "Remove movement estimates from pointer location" 2018-09-05 16:13:09 +00:00
mike dooley
4f809fe73e Adding getModelState API to sound trigger
Test: built android
Bug-Id: 70206501
Change-Id: Ieb83a366d4ddd471186d5089efe0675ea6285454
2018-09-05 15:58:27 +02:00
Siarhei Vishniakou
8ab705d7c1 Remove movement estimates from pointer location
When pointer location is enabled, a line starting from (0,0) is drawn in
both positive and negative directions. This line is used for "movement
estimates", or predicted future coordinates of pointer location using
extrapolation with polynomials.

It's unclear what it's used for, but it is annoying to see on screen
when pointer location is enabled. It also only shows up on flings
directed to the top left corner or to the bottom right corner. It does
not show up otherwise, so it's likely not working as intended anyways.

Fixes: 111195578
Test: enable pointer location, the flings in different directions to
ensure that the line originating from (0,0) is no longer present.
also try flinging with multiple fingers to ensure that no crashes are
observed and velocities are displayed for each finger.

Change-Id: I42b2cbd7deebb2cb3593172156c3d948c8d7ba4d
2018-09-04 17:26:12 -07:00
Kenny Guy
2385d4fa78 Fix BrightnessTracker's handling of color temperature
If the user was using the default color temperature
for nightmode BrightnessTracker would incorrectly
record it as 0.

Bug: 112626811
Bug: 113656622
Test: atest BrightnessTrackerTest
Change-Id: Ib9152f516d0f2b24e1a3f91748f7ccc1647db222
2018-09-03 18:24:46 +01:00
Marcin Oczeretko
d8cc8593c0 Collect telemetry data for System Server Loopers.
Adds LooperStats and LooperStatsService which set a static
Looper.Observer to record the count of dispatched messages and
cpu/latency information. The aggregated stats are collected by
Westworld as pulled atoms.

The collection is disabled by default and requires a manual call to
enable:

adb shell cmd looper_stats enable

Test: Unit tests and tested manually that the collected data seems
reasonable.

Change-Id: I7162fbca4e324f62887f95df3405205cbe4416ca
2018-09-03 16:06:06 +01:00