1408 Commits

Author SHA1 Message Date
Automerger Merge Worker
7e66d1c563 Merge "Merge "Key revocation check is permissive when device is unlocked" am: a9384cdc9b am: 3f638d9a3f" into qt-qpr1-dev-plus-aosp am: 5882228ab8
Change-Id: I39879ca88d139e51e71f2fa7050ff2ee5a67b96b
2020-02-19 23:13:15 +00:00
Yo Chiang
be20495f0b Key revocation check is permissive when device is unlocked
imageValidationThrowOrWarning() logs the error as a warning if device
bootloader is unlocked, else re-throw the error.
Device lock state is queried via PersistentDataBlockManager service.

Bug: 128892201
Test: adb shell am start-activity \
    -n com.android.dynsystem/com.android.dynsystem.VerificationActivity \
    -a android.os.image.action.START_INSTALL \
    --el KEY_USERDATA_SIZE 8192 \
    -d file:///storage/emulated/0/Download/aosp_arm64-dsu_test.zip \
    --es ${IMAGE_KEY}
Test: Observe the logcat
Change-Id: I895e70d90624afda2bf7cd3b34ea8d21a1702163
2020-02-19 11:11:29 +00:00
Linus Tufvesson
ab72687615 Merge "Block TYPE_PRESENTATION windows on default display" 2020-02-17 17:03:26 +00:00
Abhijeet Kaur
0a04f04ea0 Merge "Whitelist PlatformCompat permissions for MediaProvider" 2020-02-17 14:18:48 +00:00
Linus Tufvesson
b386456680 Block TYPE_PRESENTATION windows on default display
... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

Bug: 141745510
Test: atest CtsWindowManagerDeviceTestCases:PresentationTest
Change-Id: I2aaab1903dee54190338f7b6e49888aa51437108
2020-02-17 13:37:25 +00:00
Abhijeet Kaur
0f7b206acd Whitelist PlatformCompat permissions for MediaProvider
Bug: 132649864
Test: builds
Change-Id: If3d37a00f607e3cbe16a943c89bfbf3e7c100b5d
2020-02-14 12:27:52 +00:00
Varun Shah
0cbb6b63ee Obfuscate visibility of notification-related events.
UsageStats will return obfuscated NOTIFICATION_SEEN or
NOTIFICATION_INTERRUPTION events to callers of #queryEvents
and #queryEventsForUser if they don't hold the MANAGE_NOTIFICATIONS
permission.

Additionaly, refactor the query API in UsageStats to take in flags as
defined in UsageEvents to make future obfuscation/visibility parameters
cleaner.

Also, add the MANAGE_NOTIFICATIONS permission to shell for CTS test.

Bug: 144724524
Test: atest android.app.usage.cts.UsageStatsTest
Test: atest com.android.server.people.data.UsageStatsQueryHelperTest
Test: atest android.content.pm.cts.shortcutmanager.ShortcutManagerUsageTest
Change-Id: I118de7e589ac8dd5924d3740c70903fa484b79b5
2020-02-13 12:01:13 -08:00
Alex Kershaw
e7a405a54e Merge "Give new permission to set cross-profile app-op to ManagedProvisioning" 2020-02-11 22:44:23 +00:00
Robin Lee
9be54b5b67 Give CONTROL_DEVICE_LIGHTS permission to the shell
Bug: 144979010
Bug: 144978691
Test: atest LightsManagerTest
Change-Id: I2924460c76ce4545c9c3dd3875456b936fe3fc69
Merged-In: I2b4224e79e013bae27ee068b0a0898b5afa5489a
2020-02-11 17:46:40 +00:00
Alex Kershaw
0124a09844 Give new permission to set cross-profile app-op to ManagedProvisioning
This is required for the provisioning cross-profile consent screen which
is used to take some apps off INTERACT_ACROSS_USERS.

Hidden API CrossProfileApps#setInteractAcrossProfilesAppOp is changed
from requiring the broad app-op permissions to requiring
CONFIGURE_INTERACT_ACROSS_PROFILES. It then clears identity before
calling into AppOpsManager. For convenience, we also allow apps (such as
Settings) with the broader app-op permissions to continue to call this
method; in that case, we simply don't clear the identity and let
AppOpsManager check the permissions (so we allow AppOpsManager to set
the requirements if you don't have the new
CONFIGURE_INTERACT_ACROSS_PROFILES).

The CL also adds 'withCleanCallingIdentity' support to
CrossProfileAppsServiceImpl and moves over existing calls.

Bug: 136249261
Bug: 140728653
Test: atest --verbose com.android.managedprovisioning.provisioning.crossprofile.CrossProfileConsentActivityRoboTest
Change-Id: Ibd304563dd1ef5f16784e3502be5ef1ec4675b63
2020-02-11 14:06:33 +00:00
Chris Ye
473c84ff4c Access to Device Vibrator State
Add API to access vibrator state and vibrator state listener.

Bug: 135949568
Change-Id: I96636b432d581cea03a9fc9fecba4c08045f5006
2020-02-11 00:02:37 +00:00
Automerger Merge Worker
746ba5d891 Merge "More renames for API council" am: b03661f5d8 am: 02e64e352c am: 9522f9ff0f
Change-Id: I642777126bf77db09c8b64a8302145472272c9c6
2020-02-06 17:48:17 +00:00
Jack Yu
4d5d4fb7ba Merge changes from topics "area_info_refactor", "dbgf_test"
* changes:
  Added device-based geo-fencing debug info support
  Refactored cell broadcast area info support
2020-02-06 17:17:49 +00:00
Neil Fuller
b03661f5d8 Merge "More renames for API council" 2020-02-06 17:05:02 +00:00
Automerger Merge Worker
29097108e3 Merge "Add permissions for using PlatformCompat methods" am: 7202e904c9 am: 69ca2fcfa0 am: 9e28d2118f
Change-Id: Id9b74f1f74f3e4efaaa3e1657a64b7f8d229cc01
2020-02-06 14:18:16 +00:00
Andrei-Valentin Onea
7202e904c9 Merge "Add permissions for using PlatformCompat methods" 2020-02-06 13:40:34 +00:00
Andrei Onea
26559bcb40 Add permissions for using PlatformCompat methods
- READ_COMPAT_CHANGE_CONFIG is required to read the current state of the
config
- LOG_COMPAT_CHANGE is required to log the status of a compat change for
a package and/or uid to statsd
- OVERRIDE_COMPAT_CHANGE_CONFIG is required to add overrides

The permissions must be signature|privileged, as there are already
examples of code which this would not be sufficient (e.g.
MediaProvider).

This is a re-landing of https://r.android.com/1209240, which was
reverted due to http://b/142942524. The actual fix was done in
http://ag/10234812.


Bug: 142650523
Test: atest PlatformCompatTest
Test: atest PlatformCompatPermissionsTest
Change-Id: Ie9429477c9a1725b5cb67756787bf742038e5d2b
2020-02-06 12:22:42 +00:00
Neil Fuller
c0d59e39d7 More renames for API council
Renames PhoneTime[|Zone]Suggestion to TelephonyTime[|Zone]Suggestion.
Makes changes to generally avoid PHONE and use SLOT_INDEX or telephony
as appropriate for the usage. Removes telephony / phone from a few
variable names where it doesn't add value.

This commit also renames some remaining phoneId instances to slotIndex
which were missed when that rename happened.

Bug: 148842434
Test: treehugger
Change-Id: I4302e68082b802b75b53c02a9c9b1ae39dff6085
2020-02-06 08:41:26 +00:00
Automerger Merge Worker
3a8f7de209 Merge "Associate MAINLINE_NETWORK_STACK with net_raw and net_admin gid" am: ee6679031e am: 9ebb8455fa am: 246a2e1f72
Change-Id: I4a71ae683ff443e1f7867b3f83d4de80aa5cc785
2020-02-06 03:48:55 +00:00
Hungming Chen
14858acba5 Associate MAINLINE_NETWORK_STACK with net_raw and net_admin gid
Provide network stack the permission to access eBPF maps for tethering
offload

Test: m
Test: cat /proc/<pid>/status of network_stack has net_raw (3004) and
      net_admin (3005)

$ adb shell cat /proc/<pid>/status | egrep "Name|Uid|Gid|Groups"
Name:   rkstack.process
Uid:    1073    1073    1073    1073
Gid:    1073    1073    1073    1073
Groups:	1073 3001 3002 3003 3004 3005 3006 3007 9997

Change-Id: Ib3f6094e4c846832e44497466e3fed7dcd125593
2020-02-05 11:55:30 +00:00
Jack Yu
324ca000ac Refactored cell broadcast area info support
Area info cell broadcast messages are not handled
by cell broadcast receiver anymore. Instead, they will
be processed in cell broadcast service. Privileged apps
that are interested in getting the information will need
to get it directly from cell broadcast service.

Note this is only enabled for certain countries and carriers.

Test: Manual
Bug: 141318859
Bug: 141425194

Merged-In: I2245c39f679d0ad94c9a1325edc553f362fdce7c
Change-Id: I2245c39f679d0ad94c9a1325edc553f362fdce7c
(cherry picked from commit 80e432043582a14dc9d7382ed81b0699b9a01e49)
2020-02-04 20:49:23 -08:00
Eugene Susla
177caa7a2b Merge "Auto-revoke permissions for unused apps" 2020-02-04 18:31:09 +00:00
Jack Yu
80e4320435 Refactored cell broadcast area info support
Area info cell broadcast messages are not handled
by cell broadcast receiver anymore. Instead, they will
be processed in cell broadcast service. Privileged apps
that are interested in getting the information will need
to get it directly from cell broadcast service.

Note this is only enabled for certain countries and carriers.

Test: Manual
Bug: 141318859
Bug: 141425194

Change-Id: I2245c39f679d0ad94c9a1325edc553f362fdce7c
2020-02-04 00:35:58 +00:00
Nikita Ioffe
bf19417b0d Grant shell REBOOT permission
Shell already can reboot a device (via `adb reboot` command). This
change allows shell to also trigger a reboot logic inside the
system_server.

Additionally, it allows to CTS test PowerManager.reboot API.

Test: adb shell svc reboot
Change-Id: I4545c4f3587fee2840a00648c569f75bb57501fc
Merged-In: I4545c4f3587fee2840a00648c569f75bb57501fc
2020-02-03 23:35:24 +00:00
Nikita Ioffe
40ac77aac5 Merge "Grant shell REBOOT permission" 2020-02-03 23:35:01 +00:00
TreeHugger Robot
ca24f88d0e Merge "Make MANAGE_ROLLBACKS a privileged permission." 2020-02-03 22:10:31 +00:00
Nikita Ioffe
1ef721380a Grant shell REBOOT permission
Shell already can reboot a device (via `adb reboot` command). This
change allows shell to also trigger a reboot logic inside the
system_server.

Additionally, it allows to CTS test PowerManager.reboot API.

Test: adb shell svc reboot
Change-Id: I4545c4f3587fee2840a00648c569f75bb57501fc
2020-02-03 10:56:31 +00:00
Issei Suzuki
2b1f4315b0 Merge "Add animation type in SurfaceAnimator" 2020-02-03 10:04:01 +00:00
Adrian Roos
22a20a8174 WM: Introduce DisplayArea (3/n)
Introduces the concept of a DisplayArea, corresponding to an area
on a logical display within which content can be placed.

DisplayAreas can contain more DisplayAreas, WindowTokens and ActivityStacks.

A future CL will expose an API which allows leashing a DisplayArea to transform
all its content simultaneously.

DisplayAreas are managed by a DisplayAreaPolicy, which creates and places the
areas, and decides which area a container is placed in.

This CL introduces the concept, but applies a no-op policy that maintains the
current orderings and does not apply any overrides.

Future work that remains:
- Writing the feature policies
- Adjusting Display & DisplayMetrics if the area is constraining its children.
- Moving the policy into an product-adjustable component

Bug: 147406652
Test: atest WmTests
Change-Id: If6fb1bba3b65ebf7ac9fdf99408c54bf77f602c9
2020-02-01 09:07:42 +00:00
Issei Suzuki
8b995dfc3f Add animation type in SurfaceAnimator
Animation type is specified when starting a surface animation,
and is passed as an argument of a callback which is triggered
when a surface animation finishes.

Bug: 131661052
Bug: 142617871
Test: atest DimmerTests SurfaceAnimatorTest
Change-Id: I89c671cf49b049dd241b874096d8ef245deb547d
2020-01-31 17:51:01 +01:00
Dario Freni
b395b3ac61 Make MANAGE_ROLLBACKS a privileged permission.
Test: N/A
Bug: 144843717
Change-Id: I7118b525256f15ee33a6107a2e39173628306872
2020-01-31 15:42:38 +00:00
Yan Zhu
0744dc2d7a Merge "Add privileged permissions for secondary home app" 2020-01-31 02:49:26 +00:00
Daniel Bright
3f6ebb55ff Merge "Whitelist telephony broadcasts for bground use" 2020-01-30 23:45:52 +00:00
Varun Shah
acab2bea32 Merge "Restrict visibility of SHORTCUT_INVOCATION events." 2020-01-30 23:18:25 +00:00
Yan Zhu
59d19268c9 Add privileged permissions for secondary home app
- MANAGE_USERS is required for getting current user
- ACTIVITY_EMBEDDING is required for launching app in ActivityView

Bug: 137197603
Test: manual test: build and flash
Change-Id: I80a2d39a825c2bc9d52572a434c2ccf32408ccff
2020-01-30 11:32:43 -08:00
Tarandeep Singh
a6590189c8 Handle IME target change gracefully
App window requests IME, IME would be shown when showSoftInput() is
called from currently IME target.
This CL handles cases when IME target changes after showSoftInput was called
from the initial window and new window has received focus within same
app/task.
This CL also reports current control target on every startInput, which
sets current control target in WM.

Bug: 111084606
Test: atest CtsInputMethodTestCases
      1. Open files app
      2. Tap editor and make sure IME shows.
      3. Open bubbles app.
      4. Create a bubble and try typing in it.
      5. verify IME shows as expected.
Change-Id: I9e8984b7e5aa989a53ece9e2576393f795b9ef94
2020-01-29 17:51:36 -08:00
Daniel Bright
8acac15ced Whitelist telephony broadcasts for bground use
Whitelisted telephony broadcasts using the intent background flag.
Ensured that each broadcast was protected manually through cts test below.

Bug: 148181747
Test: Switched on ActivityManagerDebugConfig.DEBUG_BACKGROUND_CHECK for SIM_STATE_CHANGED
Test:  android.telephony.cts.TelephonyProtectedBroadcastsTest
Change-Id: Id280fc2128b84dda2a8184dfa32ecc5b8f787afb
2020-01-29 16:46:05 -08:00
TreeHugger Robot
b651b4562e Merge "Revert "network_stack: Move network_stack @hide bypass to platform"" 2020-01-30 00:23:52 +00:00
Varun Shah
01f6f26b54 Restrict visibility of SHORTCUT_INVOCATION events.
UsageStats will not return SHORTCUT_INVOCATION events to callers
of #queryEvents and #queryEventsForUser if they don't have visibility,
as defined by ShortcutService#hasShortcutHostPermission.

Also, add ACCESS_SHORTCUT permission to shell for CTS test and add the
ShortcutManagerUsageTest to postsubmit.

Bug: 145549490
Test: atest android.app.usage.cts.UsageStatsTest
Test: atest android.content.pm.cts.shortcutmanager.ShortcutManagerUsageTest
Change-Id: I2a69f061c35c31035a5d0381ab2f42029ec4fffc
2020-01-29 11:28:22 -08:00
Zimuzo Ezeozue
584d30b583 Merge "Whitelist privapp MANAGE_EXTERNAL_STORAGE permission" 2020-01-29 17:56:10 +00:00
Steven Ng
733ac0d946 Grant READ_DREAM_STATE & WRITE_DREAM_STATE permissions to shell
This is required for ambient display tests

Bug: 147874708
Test: Run newly added ambient display tests.
Merged-In: I61c28e15c4e5c3d0ffee4137ecb86e33f7e8f64d
Change-Id: I26ab1cd48816ddb3aa8b30708726a3e1a3a20b9a
2020-01-29 09:54:19 +00:00
Eugene Susla
6db4be5c60 Auto-revoke permissions for unused apps
android.permission.PACKAGE_USAGE_STATS is the minimal required
permission to get app usage stats, as confirmed by the API author
and usage stats is the only place giving us historical app-usage information.

Test: reduce thresholds and test with a toy app
Change-Id: Id8767cab93802d3fc90dc32a93ffb20a53f45ad9
2020-01-28 23:18:38 +00:00
Zimuzo Ezeozue
2910188714 Merge "Associate MANAGE_EXTERNAL_STORAGE with external_storage gid" 2020-01-27 23:51:24 +00:00
Zim
7a5050b95a Associate MANAGE_EXTERNAL_STORAGE with external_storage gid
Test: m
Bug: 144914977
Change-Id: I3966701af00e07842a474e7e7fceb7db0fe62273
2020-01-27 16:03:39 +00:00
Zim
9eba4a9772 Whitelist privapp MANAGE_EXTERNAL_STORAGE permission
After adding MANAGE_EXTERNAL_STORAGE permission to several apps on the
system partition, we should whitelist them

Test: m
Bug: 144914977
Change-Id: Ia4401904e23193b8628071d6a2a6d789faf0ece5
2020-01-27 13:36:38 +00:00
Vadim Caen
9e9c3e7488 Merge "More verbose messaging for orientation debugging" 2020-01-27 12:57:10 +00:00
Robin Lee
413dd36486 Give CONTROL_DEVICE_LIGHTS permission to the shell
Bug: 144979010
Bug: 144978691
Test: atest LightsManagerTest
Change-Id: I2b4224e79e013bae27ee068b0a0898b5afa5489a
2020-01-24 21:57:36 +01:00
Steven Ng
8f00f6a2ca Merge "Grant READ_DREAM_STATE & WRITE_DREAM_STATE permissions to shell" 2020-01-24 09:41:00 +00:00
TreeHugger Robot
4a4a32c8d7 Merge "Allow DownloadProvider to have WRITE_MEDIA_STORAGE." 2020-01-24 08:17:34 +00:00
TreeHugger Robot
12ce8338cc Merge "Add INTERACT_ACROSS_USERS permission for DocsUI" 2020-01-23 17:18:49 +00:00