Commit Graph

2153 Commits

Author SHA1 Message Date
Kevin Han
7d14fde4f4 Add MANAGE_APP_HIBERNATION permission
Add permission for app hibernation state manipulation.

Bug: 183058954
Test: run hibernation job and confirm the API works for
PermissionController

Change-Id: Id57ee57f49710d0b8a49a4ec561800db43089f87
2021-03-18 17:02:25 -07:00
Evan Rosky
557bab6f87 Merge "Initial support for display rotation in shell transitions" into sc-dev 2021-03-18 23:24:48 +00:00
Uchenna Okoye
932239de0b Merge "Add priv-app permissions for CarMessenger" into sc-dev 2021-03-18 20:03:56 +00:00
Zimuzo Ezeozue
b3705153db Merge "Fix MANAGE_EXTERNAL_STORAGE permission gid mapping" into sc-dev 2021-03-18 15:02:17 +00:00
Shawn Lin
730ab07d11 Merge "[Reland] Add nav bar case to RemoteAnimationTarget of non-app window" into sc-dev 2021-03-18 13:32:36 +00:00
TreeHugger Robot
3be701e767 Merge "Only allow preinstalled application to be able to call setHotwordDetectionServiceConfig" into sc-dev 2021-03-18 08:24:21 +00:00
Wei Sheng Shih
6397a19ee8 Merge "Do not add starting window after the starting data was cleared." into sc-dev 2021-03-18 04:38:20 +00:00
TreeHugger Robot
da5e602a8d Merge "Added CarService Privileged permissions to xml files" into sc-dev 2021-03-18 04:32:59 +00:00
Mayank Garg
b61b288740 Added CarService Privileged permissions to xml files
Bug: 177455922
Test: m
Change-Id: I204de0a0e8b8c42ac734ea7393da67b78727cb74
2021-03-17 18:15:23 -07:00
Evan Rosky
1551cb7307 Initial support for display rotation in shell transitions
This puts display-content as another WC in a transition. It then
adds WC rotation to change tracking. If there is a rotation,
the shell-side handlers will play the transition.

This replaces ScreenTransitionAnimation, seamless-rotation, and
fixed-rotation:

 ScreenTransitionAnimation implementation will move to shell.

 seamless-rotation is redundant because the rotation setup is
 intrinsically "seamless": it requires shell to imbue an
 animation onto it rather than just doing the jump-cut.

 fixed-rotation is now just a custom animation where we
 counter-rotate the closing app on frame 1 and then perform
 the normal open animation on the opening app.

Bug: 179270750
Test: DisplayContentTests#testShellTransitRotation
      enable shell transitions and rotate the device or launch
      and close apps in different orientations.
Change-Id: I4bc23b2e614ba85bf9752f62da4c3f8d0c90436d
2021-03-17 15:08:10 -07:00
Zim
782dc19e95 Fix MANAGE_EXTERNAL_STORAGE permission gid mapping
In Android R, we introduced a platform.xml based
mapping. Unfortunately, it only worked for signature|preinstalled
apps.

To support apps granted the appop (via special app access
permissions), we now check the permission and appop grant state
explicitly and grant the app the external_storage gid appropriately

Test: Manual
Bug: 165515144

Change-Id: Ib91e1b3a7e54ac2c83fb1d94446bed06fd44bcf6
2021-03-17 19:42:18 +00:00
lpeter
b787d41387 Only allow preinstalled application to be able to call setHotwordDetectionServiceConfig
We added a new permission "MANAGE_HOTWORD_DETECTION" to allow
the application that held this permission to be able to use
setHotwordDetectionServiceConfig functions.

In order to avoid the feature leakage, we submit the change
about Shell in internal branch.

Bug: 178346114
Test: atest CtsVoiceInteractionTestCases
Test: atest PermissionPolicyTest
Change-Id: I8829c3c389fb5fe4b06ffcf21870db50fa2ede4b
2021-03-17 19:37:16 +08:00
wilsonshih
e19a5a29d6 Do not add starting window after the starting data was cleared.
After moving the starting window logic to Shell, some timeing could be
changed. For some case the starting window could be added back to
window manager after app has drawn, for this case the mStartingData
was already cleared.
A reasonable solution should to prevent the starting window add back
to window manager if window manager already clear the starting data,
and for this case we don't need to remove the starting window from
window manager.

Bug: 182749276
Test: atest ActivityRecordTests
Change-Id: Iec8581908a413a1d8f70a2006d58386c5c8f5b86
2021-03-17 12:00:22 +08:00
shawnlin
8da5fa2d48 [Reland] Add nav bar case to RemoteAnimationTarget of non-app window
1. Only send navigation bar target when:
   - It is the transition of launching an app
   - In gesture navigation bar mode
   - The navigation bar is not controlled by fixed rotation or recents

2. Add a windowType field to RemoteAnimationTarget so that the remote
   clients could use this to find the non-app window they want.

3. Handle the onAnimationFinish() callback for non-app adapters.

Bug: 139273001
Test: atest RemoteAnimationControllerTest
Change-Id: I0612163502bdda01c4bdbae3b0ecda47efedad51
2021-03-17 10:08:23 +08:00
Uchenna Okoye
4c90a7d30e Add priv-app permissions for CarMessenger
Bug: 177455922
Change-Id: I221d5571fa0db8b1dd2368ab98733e85008d542a
Test: Tested locally and it grants desired permissions
2021-03-17 00:30:07 +00:00
Mayank Garg
e5eb17a7cc Fix indentation
Bug: 177455922
Test: Warning removed

Change-Id: I9d8b3adfeb4ad160ee187732b2907e41692491a1
2021-03-16 20:36:03 +00:00
Mayank Garg
82769e003b Merge "Added CarService Privileged permissions to xml files" into sc-dev 2021-03-16 20:09:13 +00:00
Evan Rosky
1b529aa19d Merge "Do the same size-configuration bucketing on both server and client" into sc-dev 2021-03-16 19:37:12 +00:00
Mayank Garg
70271f0685 Added CarService Privileged permissions to xml files
Bug: 177455922
Test: m
Change-Id: I0e96a9cd9043760b8bc89427f66651e29263529b
2021-03-16 01:25:52 -07:00
Evan Rosky
6c5f8fc3d8 Do the same size-configuration bucketing on both server and client
Otherwise they get out-of-sync and sometimes AR will not relaunch
the app, but the app client will think it needs to be relaunched

Bug: 181697795
Test: app configuration tests pass.
      With 3-button nav, open app in split and observe launcher
      reconfigure properly.
Change-Id: Idc8d71d92d9ae107e3adb949a2137de6c08908e9
2021-03-15 15:37:07 -07:00
Oscar Azucena
4537327187 Added interact accross user permission to media uid
Added interact accross user permission to media uid so that it can query
packages for UID in cases where media service is running for user 0 and
applications runs for different user id (i.e. 10) as is the case in car.

Bug: 181574201
Test: build seahawk (car target)
Test: run media recorder application with RECORD_AUDIO permission
Test: run media recorder application without RECORD_AUDIO permission
Change-Id: I5052c92831978a7e6c8277d3c5a4e6cb5ed8a78b
2021-03-12 10:50:54 -08:00
Robert Shih
8201fd11d9 Merge "Give uid media REGISTER_STATS_PULL_ATOM permission" into sc-dev 2021-03-12 18:40:00 +00:00
Robert Shih
7562087ee0 Give uid media REGISTER_STATS_PULL_ATOM permission
Bug: 141714243
Bug: 159337195
Test: statsd_testdrive 10099
Change-Id: I08d4f4aef3dcd7c94e9a120b0d4fa1d1e267a2b0
2021-03-12 16:58:23 +00:00
TreeHugger Robot
45125b21b4 Merge "Update FontManager#getFontConfig to require permission" into sc-dev 2021-03-12 07:59:09 +00:00
Issei Suzuki
b596505c95 Merge "Make sure that IRemoteAnimationController is always triggered." into sc-dev 2021-03-11 12:33:47 +00:00
Philip Junker
b47e468602 Merge "Map reference remote control to a single key-layout file" into sc-dev 2021-03-11 08:26:45 +00:00
Seigo Nonaka
84383b5ef8 Update FontManager#getFontConfig to require permission
There is no security risk in getFontConfig without calling permissions
but for keeping compatibility it is recommended to have permissions
to all (non-mainline) system APIs.

To be able to test these APIs, grant UPDATE_FONTS permission to shell.

Bug: 181796732
Test: atest FontManagerTest
Change-Id: Ic1f663e1e01f3625a076e68949f717366e79f5fa
2021-03-09 18:13:20 -08:00
Naomi Musgrave
93281edad3 Sandbox letterbox and size compat apps
Sandbox Display#getRealSize and WindowManager
bounds when letterbox or size compat mode are
applied to the configuration. Display uses
this field to provide the sandboxed display
size.

This reverts commit 0ba6185639.

Test: atest WindowConfigurationTests
Test: atest FrameworksMockingCoreTests:android.view.DisplayTests
Test: atest WmTests:SizeCompatTests
Bug: 181219241

Change-Id: I86e8edb8368269da8e02cf34f429d245550666c6
2021-03-09 22:48:07 +00:00
Issei Suzuki
6bf846920c Make sure that IRemoteAnimationController is always triggered.
When an app transition is executed, RemoteAnimationTarget instance is
created for apps and IRemoteAnimationController#onAnimationStart is
called.
However it's possible that no valid app exists when an app transition is
executed, for example, an activity doesn't resume before timeout. If it
happens, RemoteAnimationController triggers
IRemoteAnimationController#onAnimationCancelled.

Test: atest RemoteAnimationControllerTest
Bug: 175687166
Change-Id: I50ddc91f7bd7ed24a977fa3face9c6e56e1bea02
2021-03-08 14:28:33 +01:00
Oli Lan
265752d824 Add SET_CLIP_SOURCE permission.
This adds a permission that allows the holder to provide the source
package when setting the primary clip in clipboard. This will be done
using a new system API.

This is needed to ensure that the clipboard access notifications can be
properly attributed. For example, when a copy is performed through the
share sheet, the data should be attributed to the app that opened the
share sheet, not Android System.

Bug: 180577866
Test: builds
Change-Id: If3193d476fa923b849b505ad8b6dd893a2feae8f
2021-03-08 10:27:46 +00:00
Danny Epstein
7a3134cd7a Merge "Configure privapp perms for rotary service" into sc-dev 2021-03-05 19:26:51 +00:00
Danny Epstein
ffe2cfcffa Configure privapp perms for rotary service
Test: Check for SecurityException on boot
Bug: 181577696
Change-Id: Ib0596f87c81fda75c830989ecc57059392b7fc42
Merged-In: Ib0596f87c81fda75c830989ecc57059392b7fc42
2021-03-04 19:53:53 -08:00
TreeHugger Robot
8e7ced4d4f Merge "Give camera/audio the OBSERVE_SENSOR_PRIAVY permisison" into sc-dev 2021-03-04 22:14:46 +00:00
Evan Rosky
637ddadc69 Merge "Use clientVisibility and visibleRequested model for wallpaper" into sc-dev 2021-03-04 21:34:33 +00:00
TreeHugger Robot
c4684fc7bc Merge "Request focus on recents animation input consumers" into sc-dev 2021-03-04 16:00:48 +00:00
Evan Rosky
a841c15459 Use clientVisibility and visibleRequested model for wallpaper
This is to maintain similarity to ActivityRecord. ClientVisiblility
is now moved up to WindowToken and shared. VisibleRequested is still
separated since other windowtokens don't support it.

This lets us replace wallpaper-specific logic like deferHideWallpaper
in favor of the same visibility model as activity.

This model is effectively:
X calls setVisibility(v)
  sets visibleRequested = v
  if there's a transition, only commit the visibility when appearing.
  othrewise, commit here.
If there was an ongoing transition, once the transition is over,
  call commitVisibility.

Bug: 180143925
Test: Everything should behave the same and existing test should pass
      atest WallpaperControllerTests
Change-Id: I7bd216922983c6bca5a3b39e5a09c55889f788ee
2021-03-03 12:33:25 -08:00
Peiyong Lin
246c0bbbc1 Merge "Allow systemui to force stop a package." into sc-dev 2021-03-03 20:32:29 +00:00
Evan Severson
e47b4eafe3 Give camera/audio the OBSERVE_SENSOR_PRIAVY permisison
This permission is needed to check if they should mute the feed.

Test: Manual
Fixes: 181724488
Change-Id: I5ffa01b29b4deff72238688e06e0f0dd9a2b351f
2021-03-02 19:45:07 -08:00
Vishnu Nair
5cfa23e424 Request focus on recents animation input consumers
When setting up the recents animation input consumer,
provide focus to the input consumer. While we are
animating into recents, SystemUI needs to intercept
all input directed towards the app. Without intercepting
keys, the system will ANR the app going into recents.
This was the original behavior but regressed because of
the focus request change.

Test: go/wm-smoke
Test: atest FlickerTest
Fixes: 177923822
Change-Id: If9ac76fcb81a72f2c57407ce4a218f0954545abb
2021-03-02 12:18:31 -08:00
Corina Grigoras
c28d1fee5e Merge "Add MODIFY_QUIET_MODE permission to MediaProvider." into sc-dev 2021-03-02 20:08:02 +00:00
Joanne Chung
7e3f7d1061 Merge "Add shell commands and dump information for Translation" into sc-dev 2021-03-02 11:39:07 +00:00
Corina
7815a4717a Add MODIFY_QUIET_MODE permission to MediaProvider.
This is needed to be able to prompt for the work profile to be turned on
(probably needed for upcoming features).

Bug: 179656998
Test: no
Change-Id: I661b814930d1f999a7e1a2e0c6a923ec7dbb5535
2021-03-02 10:14:24 +00:00
TreeHugger Robot
e6b7ca4b95 Merge "Added CarService Privileged permissions to xml files" into sc-dev 2021-03-02 08:35:48 +00:00
Mayank Garg
c2df5ca25c Added CarService Privileged permissions to xml files
Bug: 177455922
Test: m
Change-Id: I68206ab450bfce692d126d264e6326f7b71c1bc6
2021-03-01 23:05:48 -08:00
Seigo Nonaka
444dc3366b Merge "Rename DancingScript and CutiveMono" into sc-dev 2021-03-02 02:45:01 +00:00
Meng Wang
1447d4c9b7 Merge "Allow privapp ImsServiceEntitlement read/modify phone state" into sc-dev 2021-03-02 01:45:52 +00:00
Peiyong Lin
0ce9e8f09f Allow systemui to force stop a package.
Bug: b/177921885
Test: verified by force stopping a package in systemui
Change-Id: Id4afb9f969e39aff68625be86aabb18eec1aa349
2021-02-27 22:13:50 +00:00
Danny Epstein
8d9eacea3a Configure privapp perms for car activity resolver
Test: Use KitchenSink's activity resolver fragment with touch and
      rotary.
Bug: 173543124
Change-Id: If7e5d48ce5d897a2cd90a02eaeda59e71d164520
(cherry picked from commit b04a4567a1)
2021-02-27 01:24:19 +00:00
Joanne Chung
3a907ab1eb Add shell commands and dump information for Translation
1. Add shell command to allow a temporary override of the
TranslationService that helps e2e CTS tests.
2. Add permission to allow the shell call the UiTranslationManager
APIs for the tests.
3. Dump translation systemservice and activity translation related
information to help debugging

We don't want to leak translation feature now, so we submit the
change about Shell in internal branch.

Bug: 179047265
Test: manual.
1. Switch to temp TranslationService by "adb shell cmd transformer set
<myTranslationService> 12000" and make sure only the same app can
access the APIs when switching to the temp service.
2. adb shell dumpsys transformer
3. adb shell dumpsys activity <myactivity> --translation
(We set "transformer" now to prevent feature leak, the final value is
translation)

Change-Id: I2573b7ea226bd805a951f8346d5370d9c9776364
2021-02-26 11:13:39 +00:00
Alex Buynytskyy
28d0b7b712 Remove INSTALLER_V2 permission since the API is finalized in S.
Bug: 152310230
Fixes: 152310230
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I624eb44a455ba65f156064c57787af5903567d96
2021-02-25 19:50:42 -08:00