Commit Graph

85704 Commits

Author SHA1 Message Date
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
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
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
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
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
Marcin Oczeretko
f1d4563acd Merge "Collect telemetry data for System Server Loopers." 2018-09-05 19:12:45 +00:00
Ying Zheng
98bb3f5c37 Merge "MASTER - Add signal for last active user in global settings." 2018-09-05 18:38:29 +00:00
Lucas Dupin
6155aa402a Only set FLAG_SCALED for fixed size wallpapers
Change-Id: I98a18a9c115f66d0024a069456f5aaf2c138bbde
Fixes: 113828967
Test: set live wallpaper, set image wallpaper
2018-09-05 11:15:52 -07:00
Nader Jawad
071149a9e7 API Review: StateListDrawables#getDrawableForState
Renamed getStateDrawableIndex to findStateDrawableIndex
based on API review feedback.

Change-Id: If07fe279fb02bc8180a28c7f58ea84ca030773ad
Fixes: 113856171
Test: Re-ran CTS
2018-09-05 17:28:37 +00:00
Chia-I Wu
c803806efb Merge "Fix widecg and hdr ordering in Configuration" 2018-09-05 17:24:56 +00:00
TreeHugger Robot
322a8b214c Merge "Hide Vr2dDisplayFlag annotation" 2018-09-05 15:42:43 +00:00
TreeHugger Robot
73855d4071 Merge "Avoiding potential NPE when dumping to proto." 2018-09-05 01:11:26 +00:00
Yohei Yukawa
903eee75e1 Merge "Let SoftInputWindow handle BadTokenException" am: 680f6e802c am: da916d83a0
am: 045109ab03

Change-Id: I58e66e273892f6b756d5f75d75baa983c9d16344
2018-09-04 12:48:01 -07:00
Yohei Yukawa
045109ab03 Merge "Let SoftInputWindow handle BadTokenException" am: 680f6e802c
am: da916d83a0

Change-Id: Id3c6ae4c997c8394517d5c75e6b2813683b56b31
2018-09-04 12:38:14 -07:00
Yohei Yukawa
da916d83a0 Merge "Let SoftInputWindow handle BadTokenException"
am: 680f6e802c

Change-Id: I6f9c1ff99ee9cc2157e32ebe3c0ff3faa2b6bf7f
2018-09-04 12:27:47 -07:00
Treehugger Robot
680f6e802c Merge "Let SoftInputWindow handle BadTokenException" 2018-09-04 19:08:27 +00:00
Kweku Adams
15afdebe38 Avoiding potential NPE when dumping to proto.
Inspired by http://aosp/736453.

Bug: 113087610
Test: Android builds
Change-Id: I9f0dae9cd5a839947c7ed150980eb30b928beef7
2018-09-04 11:57:34 -07:00
Pat Plunkett
74d3fa5f23 Hide Vr2dDisplayFlag annotation
Bug: 113857483
Test: lunch taimen_xr-userdebug; builds; runs
Change-Id: Ide43d77cb3d453586c7df7d4653ed5a23b3e4b21
2018-09-04 10:58:27 -07:00
Ying Zheng
d067cd25ee MASTER - Add signal for last active user in global settings.
Bug: 112759705
Test: build
Change-Id: Ib68b3c643f86ef1d4b441dc3e6d535cf5e7430ae
2018-09-04 10:15:34 -07:00
Haoyu Zhang
1a05d88663 Merge "Add new class LineHeightSpan.Standard" 2018-09-04 16:29:06 +00:00
TreeHugger Robot
a8aaa38d51 Merge "[Magnifier-60] Fix race condition after #dismiss" 2018-09-04 14:37:19 +00:00
st.ji
298cce2320 Merge "Add DENSITY_600" am: 8ac363088c am: e79f44a393
am: cd6e61cd53

Change-Id: Ifa769017f525bbbfc8f2a94871e33aaaf0606407
2018-09-03 14:08:57 -07:00
st.ji
cd6e61cd53 Merge "Add DENSITY_600" am: 8ac363088c
am: e79f44a393

Change-Id: I9a4cc11b8d45bafa5a4c25171c51b663b1091188
2018-09-03 13:59:46 -07:00
st.ji
e79f44a393 Merge "Add DENSITY_600"
am: 8ac363088c

Change-Id: I92fac616676fb93fcbe1ddc59b2e577b551cb387
2018-09-03 13:50:57 -07:00
Treehugger Robot
8ac363088c Merge "Add DENSITY_600" 2018-09-03 20:25:30 +00:00
Mihai Popa
ddcd54813b [Magnifier-60] Fix race condition after #dismiss
The CL fixes a race condition introduced by
I2799229bee7acfbd6236089487a5766f46605366, which caused apps to crash
when, for example, the following happened:
 1. #show(xc, yc, xm, ym) is called on the main thread, and the
    arguments are stored in mPrevShow[Source/Window]Coords
 2. #show(xc, yc, xm', ym') is called on the main thread (note that only
    the window position is different from the previous call), and we
    post a job to the pixel copy handler thread to only update the
    expected position of mWindow (without doing pixel copy)
 3. the job starts and checks that mWindow != currentWindowInstance is
    false
 4. #dismiss() is called on the main thread, mWindow is set to null
 5. the position update job at step 3 continues, grabs mLock but now mWindow is null
    and the crash happens

Bug: 113272299
Test: manual testing
Test: atest CtsWidgetTestCases:android.widget.cts.MagnifierTest
Change-Id: Ibc815888f4eeaf077fa1a9ddfb1d4d401382623a
2018-09-03 17:56:27 +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
Bernardo Rufino
74eee1031c Use RemoteCall for quota exceeded in backups
For both key-value and full-backup. This makes the tasks wait for the
quota exceeded call, allowing the agent to complete before being torn
down (as described in bug). Also added a short time-out (3s) in case of
misbehaving agents.

Bug: 68762178
Bug: 110082831
Test: atest FrameworksServicesRoboTests
Test: 1. while true; do atest FullBackupQuotaTest; done
      2. Stop after ~50 executions, verify all succeeded.
Test: 1. while true; do atest KeyValueQuotaTest; done
      2. Stop after ~50 executions, verify all succeeded.
Test: CtsBackupTestCases

Change-Id: Ib582e75a4d317ab53a6df8cb261966a04ef085fb
2018-09-03 13:53:33 +00:00
Iavor-Valentin Iftime
bf57547efb Merge "Resize image wallpaper surface to match bitmap size in order to optimize memory (on AndroidTV there is no need for wallpaper and RAM is wasted)" 2018-09-03 07:30:37 +00:00
Kevin Chyn
deb136b00a Merge "Send authentication type from AuthenticationClient to BiometricDialog" 2018-09-02 05:56:32 +00:00
Kevin Chyn
5a2ff5d7a2 Send authentication type from AuthenticationClient to BiometricDialog
Bug: 111461540

Test: Tested with BiometricPromptDemo

Change-Id: Id495dbb7465675a2a5b0b5f99c34a29297f89f55
2018-08-31 17:45:25 -07:00
TreeHugger Robot
f5121c964b Merge changes from topic "kv-refactor-agent-throws"
* changes:
  [KV] Consider throwing BackupAgent a failure
  [KV] Remove states
2018-08-31 21:49:27 +00:00
TreeHugger Robot
6416694472 Merge "Hide inputMethodClientHasFocus() from apps" 2018-08-31 20:00:27 +00:00
Chia-I Wu
0d8acf5a96 Fix widecg and hdr ordering in Configuration
Wide Gamut qualifier should be before the HDR one.

Bug: 78136980
Test: am get-config
Change-Id: If0f09ddb750d586d29b4cedcbab3d5981f393b92
2018-08-31 17:18:36 +00:00