Commit Graph

1385 Commits

Author SHA1 Message Date
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
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
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
Martijn Coenen
3585d12c0f Allow DownloadProvider to have WRITE_MEDIA_STORAGE.
It previously got this permission by sharing a UID with the
MediaProvider, but now that that has become a mainline module, ask for
it explicitly.

Bug: 146378784
Test: boots
Change-Id: I678efac65c8521ea9b7bec59aa193e637272cd57
2020-01-23 16:52:04 +01:00
Kelvin Kwan
f533034e77 Add INTERACT_ACROSS_USERS permission for DocsUI
Test: make aosp_x86_64-eng
Test: check INTERACT_ACROSS_USERS in /system/etc/permissions/com.android.documentsui.xml
Test: check INTERACT_ACROSS_USERS grant to DocumentsUI.apk
Test: atest DocumentsUITests:com.android.documentsui.PermissionsTest
Bug: 148198996
Change-Id: I6bcef56c508b3fad7a56cdc629089a36f4cdbec5
2020-01-23 15:35:16 +00:00
Steven Ng
38e58dea36 Grant READ_DREAM_STATE & WRITE_DREAM_STATE permissions to shell
This is required for ambient display tests.

NOTE: This CL is manually cherry-picked from aosp/1215115 due to
merge conflict.

Bug: 147874708
Test: Run newly added ambient display tests.
Change-Id: I61c28e15c4e5c3d0ffee4137ecb86e33f7e8f64d
2020-01-23 14:22:09 +00:00
Vadim Caen
fc14c66439 More verbose messaging for orientation debugging
Test: N/A
Bug: 143053092
Change-Id: I05c5a9a1c61221c2966f72bb0e8479bd7130cb1b
2020-01-23 12:20:30 +01:00
Zim
7da9f80d6a Deprecate WRITE_MEDIA_STORAGE permission
Previously, this permission would give the holder the media_rw gid
thereby granting access to the following file paths on disk:
1. /data/media
2. /mnt/media_rw
3. /mnt/expand/<uuid>/data/media

With the introduction of a stacked FUSE filesystem on external
storage, modifying any files directly on the lower filesystem (the
paths listed above) could lead to VFS cache inconsistencies and file
corruption.

To mitigate this risk, this cl blocks unneeded access to the lower
filesystem. Apps relying on this permission should instead use
android.permission.MANAGE_EXTERNAL_STORAGE.

Test: cat /proc/<pid>/status of mediaprovider doesn't have media_rw
Bug: 144914977

Change-Id: I8335d18067231657ac9793f7b1dcf6adb617ecfc
2020-01-22 19:29:29 +00:00
Soonil Nagarkar
4c0b85ba06 Overhaul FusedLocationProvider
Fix some minor bugs and ensure fused location provider correctly
supports location bypass. This is especially important for when
location bypass is invoked in direct boot.

The added UPDATE_DEVICE_STATS permission is necessary for FusedLocation
to correctly update WorkSources. FusedLocation receives work from LMS and
then further delegates that work to other location providers. The other
location providers should be informed of the correct applications for
battery blame, and should not be blaming the FusedLocation package.
1) This is the minimally scoped permission necessary to battery blame
correctly.
2) There is no way to attribute battery blame without this permission.
3) This is the correct permission - as required by LocationManager, and
this permission will likely never be removed (FusedLocation will always
need to battery blame).

Test: atest FusedLocationTests
Change-Id: If7126fffaae5577ddf8e366a0b5c17b3e5286582
2020-01-22 17:22:54 +00:00
Roshan Pius
3b64846933 Revert "network_stack: Move network_stack @hide bypass to platform"
This reverts commit 71fd312054.

Reason for revert: No longer needed.

Bug: b/141954427
Change-Id: Ib3205494695fad0389e15e2a52427d0496be8f44
2020-01-22 15:20:25 +00:00
Automerger Merge Worker
b492f4e347 Merge "Remove CONNECTIVITY_INTERNAL permission" am: a785f7bf4c am: eb5bee128c am: dbbdc8b6f4
Change-Id: I691de648a1f99555423ec0ab04c0a68bb7ab5c81
2020-01-21 11:33:20 +00:00
Paul Hu
a785f7bf4c Merge "Remove CONNECTIVITY_INTERNAL permission" 2020-01-21 11:03:59 +00:00
Hall Liu
6392e2548d Merge "Add system service for accessing SystemConfig" 2020-01-20 21:34:28 +00:00
Treehugger Robot
046d939399 Merge changes from topic "apps_to_system_ext"
* changes:
  Move the app to /system_ext
  Set sdk_version "current" in test package
  Move the permission.xml to /system_ext
  Move SystemUI to /system_ext
  move privapp_whitelist_com.android.storagemanager to system_ext
  Move 'privapp_whitelist_com.android.launcher3' to system_ext
  Move 'privapp_whitelist_com.android.settings' to system_ext
  move privapp_whitelist_com.android.provision to system_ext
  privapp_whitelist_com.android.emergency to system_ext
  privapp_whitelist_com.android.carrierconfig to system_ext
2020-01-17 11:44:42 +00:00
Jeongik Cha
45ebd05bea Move the permission.xml to /system_ext
As mentioned in b/132780927, we plan to forbid hidden APIs usage in /product partition,
in other word, apps in /product are allowed to use only either public API or system API.
So, this app will be moved to /system_ext, of course, it is not permanent,
they can be moved back to /product if they don't use hidden API anymore.

Bug: 137908189
Test: m
Test: check whether device boots successfully
Change-Id: I623e0dcc1d3bc1a2a69a6cad34ace1f79532654e
Merged-In: I623e0dcc1d3bc1a2a69a6cad34ace1f79532654e
2020-01-17 09:15:53 +00:00
Ruchir Rastogi
25e6dd3ed1 Merge "Migrate DeviceCalculcatedPower pullers to new API" 2020-01-16 19:16:50 +00:00
Automerger Merge Worker
2a7b367d06 Merge "Replace CONNECTIVITY_INTERNAL in SystemUI" am: 3950a24dca am: 8d82c3cbd9 am: 8e92458626
Change-Id: Id94e38dafad3dd6a5316c53ba357a8004a7d7b9e
2020-01-16 07:58:53 +00:00
Paul Hu
3950a24dca Merge "Replace CONNECTIVITY_INTERNAL in SystemUI" 2020-01-16 07:23:17 +00:00
Jeongik Cha
e4ac0ac9ad Move SystemUI to /system_ext
we plan to forbid hidden API in product partition.
So this app should be moved to /system_ext because it uses hidden API.
It is not permanent, so they can be moved back to /product due to
needs if there isn't hidden usage anymore.

Bug: 137908189
Test: m
Test: check whether device boots successfully
Test: atest SystemUITests
Exempt-From-Owner-Approval: cherry-pick from internal
Change-Id: I54f86496d4a0045af3576091cce00e5cd285b4f8
Merged-In: I54f86496d4a0045af3576091cce00e5cd285b4f8
2020-01-16 06:50:41 +00:00
paulhu
f53b338e63 Remove CONNECTIVITY_INTERNAL permission
After check the usage of those apps who declared
CONNECTIVITY_INTERNAL permission, they don't access any API which
protected by CONNECTIVITY_INTERNAL. And CONNECTIVITY_INTERNAL
has been removed from their AndroidManifest.xml. So remove the
redudant permission from privapp-permissions-platform.xml.

Bug: 32963470
Test: build, flash, boot to home w/o any permission problem.
Change-Id: I3f31d16163e359b0b16f06129452a758ea149fc1
2020-01-16 14:33:38 +08:00
Heemin Seog
3f338317e7 Add new permission to privapp-permissions
Fix: 147751923
Test: manual
Change-Id: Iba966baa91558a57c1e1bd2809eaab05151ac13b
2020-01-15 23:43:59 +00:00
Ruchir Rastogi
5ea3163325 Migrate DeviceCalculcatedPower pullers to new API
As part of migrating the pullers to the new API, we modify
permission checks within BatteryStatsService. Previously, a Binder
thread within StatsCompanionService (with statsd's calling identity)
called BatteryStatsService functions, which was why statsd was assigned
the BATTERY_STATS permission. Now, that call is being made from the
system process Background thread. Because enforceCallingPermission
outside of Binder threads, we switched to enforceCallingOrSelfPermission.

Test: m -j
Test: adb shell cmd stats pull-source 10039
Test: adb shell cmd stats pull-source 10040
Test: adb shell cmd stats pull-source 10041
Test: atest CtsStatsdHostTestCases:UidAtomTests#testDeviceCalculatedPowerUse
Test: atest
CtsStatsdHostTestCases:UidAtomTests#testDeviceCalculatedPowerBlameUid
Test: atest CtsStatsdHostTestCases:BatteryStatsValidationTests#testPowerUse
Bug: 145565211
Change-Id: Ie009e6eead3e48ecee6b40d9a38c9d571d4d4117
2020-01-15 15:39:56 -08:00
Automerger Merge Worker
4e37fa7cb3 Merge changes from topic "sp06-offloadcontroller" am: 01d30a4ce0 am: b61116705a am: c6a841b77b
Change-Id: I4e7924ebb2d37ecffb8facce0ec51643afb12264
2020-01-15 05:33:32 +00:00
Saeid Farivar Asanjan
7440af3dc8 Whitelist Paintbooth
Test: manually
Change-Id: I5ed9a31ab1af9eb5353038e82418cfe7fad89dfe
2020-01-14 15:58:49 -08:00
junyulai
37ed835f3a [SP06.1] Add UPDATE_DEVICE_STATS permission to Tethering
Add corresponding permission to allow tether offload to update
network usage through new API that requires UPDATE_DEVICE_STATS
permission.

This is the minimum permission that required to update network
usage with the new system api.

Test: atest FrameworksNetTests OffloadControllerTest TetheringTest
Bug: 130855321
Change-Id: I9c0c86e20d4797ea3570feed741be3a07f839c7d
2020-01-14 20:14:47 +08:00
Automerger Merge Worker
9cea835311 Merge "Add Lorenzo to OWNERS for privileged permissions whitelist" am: 0fd118f5bb am: b310a107b7 am: 124ec9325e
Change-Id: Ia181cf99a9c4668e4b198d5088136f08350d8e93
2020-01-10 23:14:56 +00:00