Commit Graph

85715 Commits

Author SHA1 Message Date
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
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
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
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
Eric Sandness
ca5969d6e0 Block Policies From Device Admin Targetting Q
If a device admin app targets Android Q or above, and it is not a device
owner or profile owner, throw a SecurityException if it attempts to
control the following policies:
  - DeviceAdminInfo.USES_POLICY_DISABLE_CAMERA
  - DeviceAdminInfo.USES_POLICY_DISABLE_KEYGUARD_FEATURES
  - DeviceAdminInfo.USES_POLICY_EXPIRE_PASSWORD
  - DeviceAdminInfo.USES_POLICY_LIMIT_PASSWORD

The set of policies available to a device admin targetting Android P or below is unchanged.

Bug: 111546201
Test: com.android.server.devicepolicy.DevicePolicyManagerTest
Test: com.android.cts.devicepolicy.DeviceAdminHostSideTestApi24
Test: com.android.cts.devicepolicy.DeviceAdminHostSideTestApi29
Test: com.android.cts.devicepolicy.ManagedProfileTest
Change-Id: Idcd0b4b91ad2fa363535c718928d382c7da054d4
2018-09-05 18:47:42 +01: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