Commit Graph

961 Commits

Author SHA1 Message Date
Jeff Sharkey
9787a9459d Iterate on storage permissions model.
This change updates the permissions design to use app-ops for
controlling write access, which is only extended to the default app
for a particular collection type.

Bug: 119713234
Test: atest android.appsecurity.cts.PermissionsHostTest
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Test: atest cts/tests/tests/provider/src/android/provider/cts/MediaStore*
Change-Id: I40811ff175b3b8410b58ed901948a23a56f8a8c2
2018-11-26 12:00:35 -07:00
Eran Messeri
0bc24f6283 Device ID attestation for Corp-owned Profile Owner: follow-up
A small clean-up CL to follow-up on two comments from the original
review:
* Remove the new permission from privapp-permissions-platform.xml as it
is a signature-level permission, not a privileged premission, and as
such does not need to be in that file.
* Do not store the grant state if it's set to false - since the
de-serialization code will only care if there's a "true" value stored.

Bug: 111335970
Test: Manual
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: atest com.android.cts.devicepolicy.MixedProfileOwnerTest#testKeyManagement
Test: atest com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testKeyManagement
Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testKeyManagement
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDeviceIdAttestationForProfileOwner
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testDelegatedCertInstallerDeviceIdAttestation
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedDeviceOwnerTest#testDelegatedCertInstallerDeviceIdAttestation
Change-Id: I8b570220f5652846fccc53b5e4daaa57f89eb824
2018-11-21 11:30:56 +00:00
Eran Messeri
fdf99084ed Merge "Grant Device IDs access to Profile Owner" 2018-11-21 07:26:40 +00:00
Zimuzo Ezeozue
621a683ea7 Merge "Add privileged API to control keyguard secure notifications" 2018-11-20 04:50:52 +00:00
Roshan Pius
b8054120f8 Merge "AndroidManifest.xml: Add new network permission for managed provisioning" 2018-11-19 16:08:12 +00:00
Zimuzo
b3b9c26543 Add privileged API to control keyguard secure notifications
I688e87cf09ad206f4f517a7be960c2aa01af8fc4, restricted privileged apps from silently becoming Device Admins.

Ia4e1ce9b81756e7f84ed0aa22d97e0b968cd8d89 added privileged APIs for locking the device and resetting the password.
We continue that work by providing an alternative for DevicePolicyManager#setKeyguardDisabledFeatures guarded by android.permission.CONTROL_KEYGUARD_SECURE_NOTIFICATIONS

Bug: 111153365
Bug: 112601004
Test: Secure notifications can be redacted on keyguard
Change-Id: If81cecf6e74f7abcff581a122c4b68cc04ff57c6
2018-11-16 22:00:43 +00:00
Adam Bookatz
0dee99a7c7 Merge "Statsd atom: Power Use" 2018-11-15 20:20:08 +00:00
Anton Hansson
6f32b3bc09 Merge "Create privapp permission grant file for TZ updater" am: 78d2038ca0 am: e3df642295
am: 20da56b8ce

Change-Id: I19f653de3bed52faef13e7e08918e55abcad0c2f
2018-11-15 06:51:36 -08:00
Eran Messeri
bb27189f56 Grant Device IDs access to Profile Owner
In order to allow inclusion of device identifiers in the key attestation
record generated by the profile owner, the platform needs an explicit
signal that it is OK for the profile owner to access those identifiers.

Add a system-privileged method to the DevicePolicyManager that allows
system applications, as well as Managed Provisioning to indicate that the
profile owner may access those identifiers.

In the DevicePolicyManagerService the following has changed:
* The OwnerInfo now contains a flag indicating whether the profile owner
  was granted access to the device identifiers or not.
* The permission check for use of the Device ID Attestation flags in
  generateKeyPair has been adjusted to allow profile owner (or its
  delegate) to use them, if device identifiers access has been granted.
* A couple of utility methods have been added to ease checking of
  profile owner presence for a user and whether the profile owner can
  access device identifiers.

Additionally, a new adb command has been added to give this grant to an
existing profile owner for testing purposes.

Bug: 111335970
Test: Manual, using TestDPC + ADB command.
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Test: Additional CTS tests, see cts change in the same topic.

Change-Id: I05f2323d5edacd774cd3ce082ee9c551100f4afd
2018-11-15 10:34:20 +00:00
Bookatz
75ee604244 Statsd atom: Power Use
BatteryStats calculates power usage of the device and various components
(such as apps). This information is used, e.g., in the battery panel of
Settings. We now log it to statsd. It can be used for validating how
good the information displayed in Settings is. In the long-term, it is
likely not ideal for off-device calculations, since that can be
hopefully estimated using statsd's raw data.

Three atoms: one for the total power use, one for the power use of each
uid, and one for each non-uid component. Since they will all likely be
pulled together, StatsCompanionService will provide stale data for
BatteryStats pulls called within a second of a previous BatteryStats
pull.

Also in this cl:
Remove StatsLogEventWrapper.writeDouble. Statsd doesn't support actually
writing doubles into its proto reports, so having this function is
misleading (the data will get to statsd and then be completely ignored).
It's less confusing if we don't pretend it does something.

Change-Id: If80bab8ea938afa4632535bb88ff59879fbe8099
Fixes: 119111972
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testDeviceCalculatedPowerUse
Test: cts-tradefed run cts-dev -m CtsStatsdHostTestCases -t android.cts.statsd.atom.UidAtomTests#testDeviceCalculatedPowerBlameUid
Test: BatteryStatsHelperTest#testDrainTypesSyncedWithProto
2018-11-14 18:13:58 -08:00
Roshan Pius
b4c45334f8 AndroidManifest.xml: Add new network permission for managed provisioning
Adding a new permission for managed provisioning to access privileged network
operations.

Bug: 115980767
Test: Compiles
Change-Id: I6375c119a7c5e13f1648803c7da5cebd6830d46c
2018-11-14 15:25:53 -08:00
yuemingw
fa4381dd0f Add extra permissions to CalendarProvider.
Per requirement of cross profile calendar feature, CalendarProvider will
need MANAGE_USER to get work profile user, and INTERACT_WITH_USER to
access its work profile equivalent.

Personal CalendarProvider needs to get the corp user ID, so it needs to
call userManager.getUsers() which requires
{@link android.Manifest.permission#MANAGE_USERS} permission.

We'll maintain a whitelist of packages set by DPC that are granted access
to cross profile Uris in CalendarProvider, so random personal apps
won't be able to access those Uris.

Bug: 118456304
Test: manual
Change-Id: I59e4a7f39f9abc69f0dcc7ff03d822b8d44b4dbc
2018-11-14 19:19:52 +00:00
Anton Hansson
26dda1ef28 Create privapp permission grant file for TZ updater
This will be installed in /system/etc/permission when the TZ updater
app is installed.

Bug: 119481876
Test: make
Change-Id: I85a9ac353ee0ed0e30bc1db12a37370445e05527
2018-11-14 11:32:57 +00:00
Salvador Martinez
812ea7554b Create APIs to interact with DynamicPowerSaver
This creates the PowerManager APIs that allow apps with the
appropriate permissions to interact with Dynamic Power Saver.

Bug: 111450127
Test: WIP
Change-Id: I5b9483fa0fba81a4ade622b1f3dbaec580b68a67
2018-11-13 09:33:50 -08:00
Alison Cichowlas
3e34050a42 Re-patching in Sharesheet security model changes.
Previously reverted due to b/72554856, fix for that in topic.

Original commit message:

Security model for moving sharesheet to systemui

ResolverActivity (still in frameworks) now requests a "permission token"
that it hands to a stubbed system ui activity ChooserActivity.

This permission token allows an app (SysUI) with the signed permission
"START_ACTIVITY_AS_CALLER" to call
ActivityManagerService#startActivityAsCaller. Permission tokens are a
one-time use, limited-time offer.

Test: runtest systemui && manual testing
Bug: 69850752
Change-Id: Ia50e21e2f8c6b6d0ed7207625e3b5aef214396bb
2018-11-09 11:01:54 -05:00
Zimuzo
2efeeccad2 Fix location split-permission targetSdk
Ia5b3f47b73c9feea924373268a4eee142f555091 introduced a bug where the targetSdk for android.permission.ACCESS_FINE_LOCATION and android.permission.ACCESS_COARSE_LOCATION was set to 28 instead of Q (10000).

Test: CtsAppThatRequestsLocationPermission28.apk requests android.permission.ACCESS_COARSE_LOCATION and android.permission.ACCESS_BACKGROUND_LOCATION
Bug: 118882117
Bug: 111411340
Change-Id: I532379aa2c8a173a516d38e1c8568cff5dbaed33
2018-11-02 17:47:13 +00:00
TreeHugger Robot
c0f94f4189 Merge "Grant split permission from config" 2018-11-02 01:10:46 +00:00
Zimuzo
cc2932fd81 Grant split permission from config
Instead of defining split permissions in Java file, we now move them to XML allowing us define vendor specific split permissions.

Test: Activity recognition is split correctly and auto granted when below split targetSdk.
Bug: 111411340
Change-Id: Ia5b3f47b73c9feea924373268a4eee142f555091
2018-11-01 16:08:27 +00:00
Kenny Root
a5964c08bc Move AdbDebuggingManager to AdbService
Also remove the "Usb" from the AIDL function since it's not really
related to USB.

Test: make
Bug: 63820489
Change-Id: Ibf23964665a115a5bc835820dcff98aaf7ba610f
2018-10-31 16:11:02 +09:00
Phil Weaver
27beee50d3 Make performAccessibilityShortcut a SystemAPI
Also create a new MANAGE_ACCESSIBILITY permission to
perform the shortcut.

Bug: 116118615
Test: make, activate accessibility shortcut
Change-Id: Ic65a0cdf7393429e14cb98f4fb0734d20069b05a
2018-10-30 10:10:41 -07:00
Joel Galenson
13096ea738 Add a new Intent for seeing permission usages
This intent is used by the Permissions Hub.

We also give PermissionController the GET_APP_OPS_STATS permission.

Bug: 63532550
Test: Used the Permissions Hub.
Change-Id: If1254f67c12fc5052d6ad5ff8260778a7c59dccc
2018-10-19 10:56:21 -07:00
Michael Groover
2c2592052d Merge "Add READ_PRIVILEGED_PHONE_STATE to used permissions" am: 403813782f am: 25131f86fa
am: 1112ebf8ac

Change-Id: Ib377536490b186d57c59fe70a8e4f1c8403d587c
2018-10-10 19:30:36 -07:00
Michael Groover
a28ad42768 Merge "Protect Device Identifiers behind priv permission and DO/PO checks" 2018-10-10 18:05:23 +00:00
TreeHugger Robot
803a52498b Merge "Show app installed notification from PackageInstaller" 2018-10-10 15:41:38 +00:00
Michael Groover
6d20d75e9e Protect Device Identifiers behind priv permission and DO/PO checks
Bug: 110099294
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases \
      -t com.android.cts.devicepolicy.DeviceOwnerTest.testDeviceOwnerCanGetDeviceIdentifiers
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases \
      -t com.android.cts.devicepolicy.ManagedProfileTest#testGetDeviceIdentifiers
Test: cts-tradefed run cts -m CtsTelephonyTestCases -t android.telephony.cts.TelephonyManagerTest
Test: cts-tradefed run cts -m CtsPermissionTestCases -t android.permission.cts.TelephonyManagerPermissionTest

Change-Id: I3c82c53ec89cd17b34a61166ccc9e9747388efac
2018-10-09 13:44:02 -07:00
Michael Groover
1248e435a0 Add READ_PRIVILEGED_PHONE_STATE to used permissions
Bug: 110099294
Test: cts-tradefed run cts -m CtsTelephonyTestCases -t android.telephony.cts.TelephonyManagerTest
Change-Id: I13fec3d397c200ce92883883c96c07007e823efe
2018-10-08 11:29:03 -07:00
Seigo Nonaka
3328d1ce55 Introduce OEM customization XML parser
As the initial version of the OEM customization XML, support
new-named-family customization. This allows OEMs to add new named
family.

Bug: 111544833
Test: atest FrameworksCoreTests:android.graphics
Change-Id: If58711fc038898175fcad0ae095865312bd738e2
2018-09-28 15:59:15 -07:00
Stefano Tommasini
bf8b6c02f3 Merge "Move transport out of system server." 2018-09-28 03:04:05 +00:00
Ricky Wai
c5ea08b2d1 Show app installed notification from PackageInstaller
Bug: 111214100
Change-Id: If3f82bfac740f4f3cf8312f396943f2ebd447c12
Test: Notifications are showing correctly after new apps installed
2018-09-25 00:06:39 +01:00
Kim Low
819e7528ee Merge "Added mapping files for DualShock3 and DualShock4" am: 85aadab7e4 am: d050a2edd6
am: 1f6af2e769

Change-Id: I239e8e9aff10e7472fb841261df7e23466202dd2
2018-09-19 18:05:08 -07:00
Treehugger Robot
85aadab7e4 Merge "Added mapping files for DualShock3 and DualShock4" 2018-09-19 22:31:44 +00:00
Luis Hector Chavez
1db7a487b1 Merge "Whitelist com.android.proxyhandler for power" am: 6527b5bdd0 am: fce565d2e2
am: 8b62a7cfdf

Change-Id: Ie4a8acd92bedb0fe8cc72dfd2bffb0a3af28fa45
2018-09-18 08:22:43 -07:00
Treehugger Robot
6527b5bdd0 Merge "Whitelist com.android.proxyhandler for power" 2018-09-18 13:31:58 +00:00
TreeHugger Robot
96edd3aeea Merge "Add new permission for Settings Intelligence." 2018-09-17 03:16:32 +00:00
Steven Moreland
8b4ce09de4 Merge changes from topic "remove-hidl-boot-jars" am: 82e3d2f066 am: fc8de0d9e3
am: d70998a8d9

Change-Id: Iee10a8281e023c9917fb81a2e72be1475dc10772
2018-09-13 10:35:38 -07:00
Kim Low
0a5109d955 Added mapping files for DualShock3 and DualShock4
All buttons and axes on DualShock3 and DualShock4 are mapped
explicitly, because some Linux drivers do not map them correctly.
Also, the definition of BUTTON_X/Y in Linux and Android is flipped.

The most significant bit (i.e. 0x8000 and 0x8111) in the "Version"
part of the filename indicates a newer Linux hid-sony driver (>=4.10
for DualShock4 and >=4.12 for DualShock3) which complies to the
mapping in Linux gamepad specifications, and supports all DualShock4
features (i.e. motions sensors, touchpad).

Older Linux driver which does not have the correct mapping will use
the mapping files without "Version".

All files with "Version_8000" and "Version_8100" are meant for
Bluetooth connected DualShock3/DualShock4, and all files with
"Version_8111" are meant for USB connected DualShock3/DualShock4.

Test: Connect DualShock3 and DualShock4, over USB and over Bluetooth.
Test: Check that the Dpad and left analog stick can be used to
      navigate the UI.
Test: If newer Linux driver is loaded, check that the touchpad can
      be used to navigate the UI.
Bug: 38511270
Change-Id: I5630c495af16185689bbff25943b3e2d3c93e709
2018-09-13 10:28:17 -07:00
Stefanot
e66c1c32fa Move transport out of system server.
Test: atest FrameworksServicesTests
Test: atest FrameworksServicesRoboTests
Test: atest CtsBackupTestCases
Test: atest CtsBackupHostTestCases
Test: atest GtsBackupTestCases
Test: atest GtsBackupHostTestCases
Bug: 113569323
Change-Id: I9e647f73cc132ae9a685dd9a6ee2f9bb37a1d8b0
2018-09-13 12:37:05 +01:00
Steven Moreland
f36ad62907 pm: Add hidl libraries to old class paths.
These two libraries:
android.hidl.base-V1.0-java
android.hidl.manager-V1.0-java

are being removed from BOOT_JARS. This change facilitates linking to them
for libraries or prebuilts in or before P.

Test: atest android.content.pm.AndroidHidlUpdaterTest
Bug: 77307025

Change-Id: Ic0db24cc68d66f5dbfab126ce7e304eec0bfc969
2018-09-12 09:18:40 -07:00
Raff Tsai
b6a2e333ff Add new permission for Settings Intelligence.
To implement Settings contextual card. We need this permission to
use CardContentProvider in Settings app.

Test: rebuild and flash ROM
Bug: 114521742
Change-Id: If729b2597a458c26c466e87dfa9b4ddc9c3ef948
2018-09-08 22:37:42 +08:00
Treehugger Robot
f4fc71f370 Merge "Build android.test.* with java_sdk_library" 2018-09-07 01:01:59 +00: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
Siarhei Vishniakou
7b0b609beb Add comments to Asus Gamepad button mappings
Currently, the circle button on odie (Asus Gamepad) is mapped to HOME.
But it is not clear which button is which just from looking at the key
layout file.
Add some annotations here.

Bug: 111431828
Bug: 110270125
Test: atest AsusGamepadTestCase (the test is currently in development)
Change-Id: I8d1317be7f403ceaf0c2d72d756623e3cd032559
2018-08-29 10:46:23 -07:00
Sundong Ahn
e933cedf83 Build android.test.* with java_sdk_library
android.test.* are built with java_sdk_library and api files are added
by running "make update-api".

android.test.base_static is created for allowing to use
android.test.base as a static library.

Bug:77577799
Test: make -j
Test: make checkapi
Test: make checkapi fails with a random change in the txt file
Test: adb shell cmd package list libraries |\
      grep android.test.*
      And check the android.test.* libraries

Merged-In: Ia27612657532e50b077a9c55dbef59ee3ec04b8a
Change-Id: Ia27612657532e50b077a9c55dbef59ee3ec04b8a
2018-08-29 12:22:59 +09:00
Siarhei Vishniakou
0b607447b6 Fallback BUTTON_MODE to HOME
Currently, BUTTON_MODE falls back to MENU.
It is not clear which functionality relies on that. However, many
joysticks currently map their "branded" button, for example, the "XBOX"
key on the Xbox joystick, and "PS" key on the playstation joystick, to
the BUTTON_MODE. On other joysticks, the same button is mapped to
"HOME". So it would make sense to have this button to fall back to HOME
in order to make the behaviour consistent.

Also, remap the "XBOX" button on the Xbox controller to "BUTTON_MODE".
This would give apps the chance to intercept this key and actually use
it, instead of limiting it to the system.

Bug: 37115804
Bug: 77803694
Test: Made a test app to dump out joystick events in response to
dispatchKeyEvent. Then either returned true or false to ensure that the
fallback happens. If returning true, the app has handled the event, and
HOME is not dispatched. If returning false, the app does not care about
the event. Therefore, HOME is generated and the phone goes to home
screen (so the app gets closed).

Change-Id: I023620551f52d34638303db60f8a4ca37f06d4d8
Merged-In: I023620551f52d34638303db60f8a4ca37f06d4d8
2018-08-27 15:53:33 -07:00
Siarhei Vishniakou
bfb5b8b03e Remap PS key to BUTTON_MODE
In an earlier commit, ag/4071802, (Change-Id:
I33e922a2c52582f44d65f20024d7dca1f9d05a5e), this particular file was
overlooked.
Quick fix here to make everything consistent. We will add the other
variants of these devices in the future.

Test: partial cherry-pick from Sony CL on aosp
Bug: 79881694
Change-Id: I8ab46fde8650724464b1e799cd948682c56e5b52
Merged-In: I8ab46fde8650724464b1e799cd948682c56e5b52
2018-08-27 15:51:48 -07:00
Chih-hung Hsieh
f63dc857ab Merge "Use multiple patterns and/or emails in per-file syntax." am: 88e452bfe6 am: 4b189a2b23
am: 99c83c4da2

Change-Id: I45456aefced1cec7b61f2f5d69f1e249e7d3c711
2018-08-27 10:04:46 -07:00
Chih-Hung Hsieh
6a6fde006f Use multiple patterns and/or emails in per-file syntax.
Test: build/make/tools/checkowners.py -c -v OWNERS
Change-Id: Ib6c033d1306c2b1a8d6b021e87d53ba9dedfdae5
2018-08-23 15:16:55 -07:00
Siarhei Vishniakou
da16f224b7 Fallback BUTTON_MODE to HOME
Currently, BUTTON_MODE falls back to MENU.
It is not clear which functionality relies on that. However, many
joysticks currently map their "branded" button, for example, the "XBOX"
key on the Xbox joystick, and "PS" key on the playstation joystick, to
the BUTTON_MODE. On other joysticks, the same button is mapped to
"HOME". So it would make sense to have this button to fall back to HOME
in order to make the behaviour consistent.

Also, remap the "XBOX" button on the Xbox controller to "BUTTON_MODE".
This would give apps the chance to intercept this key and actually use
it, instead of limiting it to the system.

Bug: 37115804
Bug: 77803694
Test: Made a test app to dump out joystick events in response to
dispatchKeyEvent. Then either returned true or false to ensure that the
fallback happens. If returning true, the app has handled the event, and
HOME is not dispatched. If returning false, the app does not care about
the event. Therefore, HOME is generated and the phone goes to home
screen (so the app gets closed).

Change-Id: I023620551f52d34638303db60f8a4ca37f06d4d8
2018-08-21 18:30:16 -07:00
TreeHugger Robot
f4aea74d87 Merge "Build android.test.* with java_sdk_library" 2018-08-17 11:14:08 +00:00
Paul Hu
9ca6c587b6 Merge "[DMService]: Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission" 2018-08-16 06:00:27 +00:00