Commit Graph

11035 Commits

Author SHA1 Message Date
Jorim Jaggi
757cbfead3 Merge "Pretend to be having the original background" into qt-dev 2019-04-12 14:19:51 +00:00
TreeHugger Robot
dd0e027ca5 Merge "Sharesheet - Align spacing with spec" into qt-dev 2019-04-12 13:01:47 +00:00
Adrian Roos
76d2f52e3f Merge "System Bars: API to ensure contrast when app requested transparent bar" into qt-dev 2019-04-12 09:43:57 +00:00
Ying Zheng
a4b089bd10 Merge "Revert "Flip default value of headless user 0 flag."" into qt-dev 2019-04-11 23:08:01 +00:00
Philip P. Moltmann
08ccf9bba4 Merge "Handle onBindingDied in AbstractRemoteService" into qt-dev 2019-04-11 22:12:49 +00:00
Matt Pietal
ab986b5fcf Sharesheet - Align spacing with spec
Various fixes including: correct fonts, colors, drag handle size, as
well as allowing more space for chooser grid items and text

Bug: 129980360
Test: Visual inspection
Change-Id: I10f78ef9c12b3444360e4ab50f7bd5900f2967f3
2019-04-11 12:36:36 -04:00
Ying Zheng
1deedca952 Revert "Flip default value of headless user 0 flag."
This reverts commit 4214a0933d.

Reason for revert: need to update per build

Bug: 130310171
Change-Id: I9ff55e9de4ec3ad64451ef41f34cbfe9b793a5e9
2019-04-11 16:16:46 +00:00
Matt Pietal
43e9ec2354 Merge "Sharesheet - 4->8 direct share expansion fix" into qt-dev 2019-04-11 15:30:34 +00:00
Philip P. Moltmann
bc093c37c2 Handle onBindingDied in AbstractRemoteService
If the package is "pm clear"-ed the binding dies permanently and has to
be re-created. Hence force an unbind at this time.

Test: atest CtsPermissionTestCases:android.permission.cts.LocationAccessCheckTest#notificationIsShownAgainAfterUninstallAndReinstall
Bug: 129480112
Change-Id: I3f9b106e2f172f8d5b6510a07c4b1f060de192bd
2019-04-11 15:17:28 +00:00
Adrian Roos
6eb1ed3a61 System Bars: API to ensure contrast when app requested transparent bar
Bug: 129533768
Test: atest EnsureBarContrastTest
Change-Id: I42facefc15dce227193a4db5f368184e1b5ebd32
2019-04-11 16:50:32 +02:00
Ricky Wai
bbde1150c5 Merge "Do not allow moveToFront() and moveTaskToFront() when app is in background" into qt-dev 2019-04-11 13:33:04 +00:00
Alison Cichowlas
bf72ee109b Merge "Merge caller targets and ranked targets." into qt-dev 2019-04-11 12:24:22 +00:00
TreeHugger Robot
a81892761b Merge "Flip default value of headless user 0 flag." into qt-dev 2019-04-11 01:10:29 +00:00
Alison Cichowlas
d0a075ba0d Merge caller targets and ranked targets.
Bug: 126566208
Test: Manual; test apk and twitter
Change-Id: Ib264d4a646cafe160b9d3115d42292d940dc1918
2019-04-10 20:52:50 -04:00
Lucas Dupin
a4d6b7801c Merge "Remove color extraction from scrims" into qt-dev 2019-04-11 00:19:03 +00:00
Ying Zheng
4214a0933d Flip default value of headless user 0 flag.
Since this is to replace an existing car property which default to true.

Bug: 130310171
Test: build
Change-Id: Ie4f6389b4514727cf88c72e931e9fff4bf5f1484
2019-04-10 15:32:29 -07:00
TreeHugger Robot
b5258351ea Merge "System Bars: Ensure contrast when app requested transparent bar" into qt-dev 2019-04-10 21:58:42 +00:00
Lucas Dupin
2bd3af67a0 Remove color extraction from scrims
Fixes: 129295950
Test: atest SysuiColorExtractorTests
Test: atest ScrimControllerTest
Test: atest ScrimViewTest
Test: visual
Change-Id: Ie45fd3f2e7b022236f0dda22fa1c854c0eff19ea
2019-04-10 13:30:43 -07:00
TreeHugger Robot
592192f813 Merge "Sharesheet - navbar color integration" into qt-dev 2019-04-10 18:37:26 +00:00
Matt Pietal
a9c8e5053a Sharesheet - 4->8 direct share expansion fix
The 4->8 expansion area can become stuck when the user is scrolling as
the list is rebuilt, say from a package changed event. Be more
specific about when we choose to lock this area.

Bug: 129979914
Test: Constantly scroll while sharesheet is loading
Change-Id: I969d628e1e420fd12133cef413dadf4f14ca75d7
2019-04-10 14:27:35 -04:00
Ricky Wai
aca8a770cd Do not allow moveToFront() and moveTaskToFront() when app is in background
Bug: 129063631
Test: Unable to start activity / move task in background
Change-Id: Icb5ebad3567b911719341f221483df1a1512109b
2019-04-10 17:24:30 +01:00
Adrian Roos
4c864595bd System Bars: Ensure contrast when app requested transparent bar
Bug: 129533768
Test: atest EnsureBarContrastTest
Change-Id: Ib8f4045b9e8e7bf65c13437133f114d91d0cb050
2019-04-10 18:16:25 +02:00
Jeff Sharkey
0185ea0802 Refactor s/TypeInfo/MimeTypeInfo/ per feedback.
Bug: 128903949
Test: atest android.content.cts.ContentResolverTest
Change-Id: Idb9e63a68dc9ffe0c35ad3e6bff55aaa10320e81
2019-04-10 00:04:27 -06:00
TreeHugger Robot
343b96786b Merge "Sharesheet - Add outline to image preview" into qt-dev 2019-04-09 22:47:21 +00:00
TreeHugger Robot
56453ede41 Merge "Allow wallpapers and IMEs to get location if needed" into qt-dev 2019-04-09 19:31:45 +00:00
Matt Pietal
9aaf00c51c Sharesheet - Add outline to image preview
Support thin border around content preview images

Bug: 129979196
Test: Visual inspection
Change-Id: I3984a22507352cc3de8fd38ee3ded39a63bb442d
2019-04-09 15:10:58 -04:00
Matt Pietal
031afcacc0 Sharesheet - navbar color integration
Fix divider color for dark/light themes. Color the navbar and add the
navbar separator.

Bug: 129980358
Test: Visual inspection
2019-04-09 15:03:52 -04:00
Jorim Jaggi
1ab06de89f Pretend to be having the original background
...as otherwise setWindowBackground(bg) => bg == dv.getBackground
property is violated.

Test: WindowTest
Fixes: 130170137
Change-Id: I21dc45b291fd2568355ff186966a910cd05ed994
2019-04-09 17:13:50 +02:00
Matt Pietal
a4b30072a0 Sharesheet - Add support for sunshine
Set apps/targets to be visually disabled when in suspended state. Do
not auto launch when the only app is suspended.

Bug: 112553778
Test: Manually inspect colors on app suspension
Change-Id: Ief9faba831c4f3676f02f84b0174b74d4103f940
2019-04-09 07:57:04 -04:00
TreeHugger Robot
5a56c2d9cc Merge "Sharesheet: Rank the first N apps, then show the rest alphabetically." into qt-dev 2019-04-09 11:10:00 +00:00
TreeHugger Robot
e3aa7b9ac3 Merge "Fixes crash due to assigning service before linking death recipient." into qt-dev 2019-04-09 02:06:17 +00:00
Amith Yamasani
c45a990330 Allow wallpapers and IMEs to get location if needed
Wallpapers and Input Methods are bound by the system
and are only brought up to BFGS, which is insufficient
for getting foreground location. Add the required
flag to the bindService call to allow the bound process
to reach FGSL when visible.

Same for VoiceInteractionServices

Bug: 117494189
Test: Manually enable a wallpaper that needs location and
     verify it gets location.
      atest CtsAppTestCases:ActivityManagerProcessStateTest

Change-Id: I6767e1f480e5b3d6e33864dabd9cb167df4846f5
2019-04-08 17:18:21 -07:00
Alison Cichowlas
1c8816c3ad Sharesheet: Rank the first N apps, then show the rest alphabetically.
Bug: 126566208
Test: atest ChooserListControllerTest
Change-Id: I4277a28cc7ad8a1f08c9a08ec018726161e5d596
(cherry picked from commit 363ed278fb)
2019-04-09 00:02:13 +00:00
Adam He
967cb0aed7 Fixes crash due to assigning service before linking death recipient.
Fixes: 129686274
Test: atest CtsAutoFillServiceTestCases
Change-Id: I052ca9a13947f0ad25da70747e8db2be22af742b
2019-04-08 14:37:58 -07:00
TreeHugger Robot
353c5cc16a Merge "Allow themeing of icon in SuspendedAppActivity" into qt-dev 2019-04-08 20:17:28 +00:00
Bryan Mawhinney
cf1eee71f0 Allow themeing of icon in SuspendedAppActivity
By passing the current theme to getDrawable, we allow the suspending app
to provide, e.g., a vector drawable tinted according to the system theme
(note, *not* the suspending app theme).

Test: manual
Bug: 129995419
Change-Id: Id9d4e3292baa324856dd817fe9ac979c07339fb0
2019-04-08 20:17:01 +00:00
TreeHugger Robot
85e35eb118 Merge "Protect against null drawable" into qt-dev 2019-04-08 17:27:52 +00:00
TreeHugger Robot
658312b51c Merge "Sharesheet - Fix scroll behavior moving past bounds" into qt-dev 2019-04-08 15:27:12 +00:00
Jorim Jaggi
1ed6889243 Protect against null drawable
Test: App with no background drawable doesn't crash
Fixes: 130015147
Change-Id: I28e3605aa84240979f9a04108be98d6e3006e470
2019-04-08 16:35:34 +02:00
Matt Pietal
d568294c1a Sharesheet - Fix scroll behavior moving past bounds
ResolverDrawerLayout is tracking fractions of pixels, but just drops
these fractions when offsetting the child views. When scrolling up and
down continuously, this can lead to the view scrolling past the window
bounds. Do not discard these fractions. Track the remainders and add
them in when the sum to >= 1px.

Bug: 129979914
Test: Manual scrolling test
Change-Id: I0e8ea04baca341c6b6e0573e086f3f2f8c2b39b5
2019-04-08 09:57:07 -04:00
Svet Ganov
d8eb8b2690 Restricted permission mechanism - framework
This change adds a mechanism for restricting permissions (only runtime
for now), so that an app cannot hold the permission if it is not white
listed. The whitelisting can happen at install or at any later point.

There are three whitelists: system: OS managed with default grants
and role holders being on it; upgrade: only OS puts on this list
apps when upgrading from a pre to post restriction permission database
version and OS and installer on record can remove; installer: only
the installer on record can add and remove (and the system of course).

Added a permission policy service that sits on top of permissions
and app ops and is responsible to sync between permissions and app
ops when there is an interdependecy in any direction.

Added versioning to the runtime permissions database to allow operations
that need to be done once on upgrade such as adding all permissions held
by apps pre upgrade to the upgrade whitelist if the new permisison version
inctroduces a new restricted permission. The upgrade logic is in the
permission controller and we will eventually put the default grants there.

NOTE: This change is reacting to a VP feedback for how we would handle
SMS/CallLog restriction as we pivoted from role based approach to roles
for things the user would understand plus whitelist for everything else.
This would also help us roll out softly the storage permisison as there
is too much churm coming from developer feedback.

Exempt-From-Owner-Approval: trivial change due to APi adjustment

Test: atest CtsAppSecurityHostTestCases:android.appsecurity.cts.PermissionsHostTest
Test: atest CtsPermissionTestCases
Test: atest CtsPermission2TestCases
Test: atest RoleManagerTestCases

bug:124769181

Change-Id: Ic48e3c728387ecf02f89d517ba1fe785ab9c75fd
2019-04-07 22:39:54 -07:00
Yohei Yukawa
17c1af439c Fix a bug in RegisterStatusBarResult parceling
This is a follow up CL to my previous CL [1], which introduced
RegisterStatusBarResult to consolidate return values from
StatusBarManagerService#registerStatusBar().

It turns out that the following fields are not correctly unmarshalled.
 - RegisterStatusBarResult#mFullscreenStackBounds
 - RegisterStatusBarResult#mDockedStackBounds

This is because those two fields were written with
Parcel#writeParcelable() while we were reading them directly with
Rect.CREATOR#createFromParcel().  Parcel#writeParcelable() needs to be
used with Parcel#readParcelable() for null handling and custom
class-loader handling.

With this CL, we now read/write these two fields with the following
methods, which can also be used to write/read Parcelable objects in a
bit more simpler style unless as long as we can rely on the default
class-loader.
 - Parcel#writeTypedObject()
 - Parcel#readTypedObject()

This CL also adds unit tests for StatusBarIcon and
RegisterStatusBarResult to make sure that these classes can be sent
over Parcel.

 [1]: Ib1c0ae8f591ca09d0bce7a39f85ba57aad386e47
      49efa718a8

Bug: 122439339
Test: atest FrameworksCoreTests:StatusBarIconTest
Test: atest FrameworksCoreTests:RegisterStatusBarResultTest
Change-Id: I0f41cbcb4c2f1222f18e1e34e3cf40bb0dfdfdb3
2019-04-05 16:53:32 -07:00
TreeHugger Robot
5f75b42b76 Merge "Sharesheet - Content preview polish" into qt-dev 2019-04-05 19:36:23 +00:00
Matt Pietal
832cdbf374 Sharesheet - Content preview polish
1. Add ripple feedback to clipboard copy even though the sharesheet
disappears really fast and you may not see it.
2. Make sure file icon is gray and not influence by the overlay.
3. Default multiple file sharing to file preview area and not image
preview area when there are mixed file types

Bug: 129979196
Test: Visual inspection
Change-Id: Ia86d418ccaca9a122f00dbc3e9c3b30785fb2abd
2019-04-05 13:38:06 -04:00
TreeHugger Robot
7b0c0c7694 Merge "Catch ArrayIndexOutOfBoundsException in StateMachine.toString()" into qt-dev 2019-04-05 15:27:05 +00:00
Matt Pietal
4e2e36323d Sharesheet - Limit EXTRA_INITIAL_INTENTS to 2
Will eventually merge with suggested apps

Bug: 129979509
Test: ChooserActivityTest
Change-Id: I0e5f5a42155c83c77c6f6e355289218bc88033e7
2019-04-05 08:32:47 -04:00
TreeHugger Robot
9620e07e4f Merge "Sharesheet - Fix portrait -> landscape switch" into qt-dev 2019-04-05 05:33:13 +00:00
Quang Luong
abe10b3e62 Catch ArrayIndexOutOfBoundsException in StateMachine.toString()
StateMachine.toString() calls mSmHandler.getCurrentState(). In the
rare case when mStateStackTopIndex is -1 due to the StateMachine being
not yet initalized, this results in an ArrayIndexOutOfBoundsException.

Bug: 124858416
Test: none

Change-Id: Id558be95b6e12d8a923d325bca5f6f6d7f942b22
2019-04-04 13:12:26 -07:00
Matt Pietal
399e8c74ee Sharesheet - Fix portrait -> landscape switch
Calculating the reserved height was using the wrong figures. Expose
the correct reserved alwaysShow height, and use it to determine the
offset for scrolling.

Bug: 120419081
Test: manual, rotate device
Change-Id: I21fd9fa8494a258d17f6002f79967aacc0efde34
2019-04-04 15:49:48 -04:00
Yohei Yukawa
49efa718a8 Introduce a result class for IStatusBarService#registerStatusBar()
This is a preparation to fix an issue that IME cannot enable light
navigation bar on direct-reply.

The initial state of StatusBar client is provided as return values of
IStatusBarService#registerStatusBar().  However, the way for the
client to receive the return values is to rely on "out" parameters in
the Binder method as follows.

    void registerStatusBar(IStatusBar callbacks,
            out List<String> iconSlots,
            out List<StatusBarIcon> iconList,
            out int[] switches,
            out List<IBinder> binders,
            out Rect fullscreenStackBounds,
            out Rect dockedStackBounds);

The issue is that if I want to add a new parameter into
StatusBarManagerService to fix Bug 122439339, then it needs to be
notified back to the client via one of these out values, e.g. a new
element in "switches", which is hard to understand and maintain.

It'd be better to introduce a dedicated return object as follows.

    RegisterStatusBarResult registerStatusBar(IStatusBar callbacks);

This is a purely mechanical code clean-up.  Hence there should be no
behavior change.

Bug: 122439339
Test: presubmit
Change-Id: Ib1c0ae8f591ca09d0bce7a39f85ba57aad386e47
2019-04-04 11:49:02 -07:00