Commit Graph

8315 Commits

Author SHA1 Message Date
Jeff Sharkey
cd5db63e06 Merge "New argument to hint at locale to use for sorting." 2019-10-05 18:48:39 +00:00
Jeff Sharkey
85e90d09e1 New argument to hint at locale to use for sorting.
We've heard that some developers want more detailed influence over
the sort order applied internally inside of a ContentProvider.  For
example, when the locale is "zh", the caller may want to sort using
either "pinyin" or "zhuyin" style collations.

Thankfully ICU already supports this type of collation control when
creating a ULocale object, and it also supports other useful types
such as "de@collation=phonebook".  Thus this CL adds a new
QUERY_ARG_SORT_LOCALE that can be used to pass an ICU locale string
into a ContentProvider.

Similar to the other existing query arguments, we know that only
certain providers may support this new option, so we document that
it should be included in EXTRA_HONORED_ARGS when applied.

Bug: 140248907
Test: atest cts/tests/tests/content/src/android/content/cts/ContentResolverTest.java
Change-Id: I3277725ecd21a58680f2b8a5cc62514184d9e179
2019-10-05 10:26:24 -06:00
TreeHugger Robot
f25b446cae Merge "Add Resources Perf Tests" 2019-10-04 21:54:30 +00:00
Philip P. Moltmann
e653663037 Merge "Update PermissionChecker usages to avoid unnecessary attribution." 2019-10-04 19:26:54 +00:00
Svet Ganov
249810df2e Update PermissionChecker usages to avoid unnecessary attribution.
We had accidental usages of the PermissionChecker for cases where no
private data was provided to the app but the checkPermission API on
the latter also did blame data access on the app. The PermissionChecker
was designed to handle IPC calls and not for generic API checks.

To avoid future accidental incorrect PermissionChecker usages this
change renames the existing APIs of the latter to clearly indicate
that they should be used for data delivery and also adds sibling
methods for doing the same permission checks for preflight purposes.
Also the documentation is improved to furhter assist developers.

In addition, this change fixes accidental permission checker usages
that blame when they should not by using the new preflight flavor
of the permission check APIs.

Test:
    atest com.android.settingslib.location.RecentLocationAppsTest
    atest CtsPermissionTestCases
    added: LocationAccessCheckTest#notificationOnlyForAccessesSinceFeatureWasEnabled
    added: LocationAccessCheckTest#noNotificationIfFeatureDisabled
    added: LocationAccessCheckTest#noNotificationIfBlamerNotSystemOrLocationProvider
    added: LocationAccessCheckTest#testOpeningLocationSettingsDoesNotTriggerAccess

bug:141028068
Exempt-From-Owner-Approval: merge
Change-Id: I65c71569d0dd8a40bc6fecabb22c5373dd6e806e
2019-10-04 19:25:54 +00:00
TreeHugger Robot
2bb20ce423 Merge "Fix UserInfo Parcel" 2019-10-04 03:30:02 +00:00
TreeHugger Robot
62296e3ddf Merge "Fix CONNECTIVITY_SERVICE value in the doc." 2019-10-04 01:04:07 +00:00
Bookatz
e80af14d33 Fix UserInfo Parcel
ag/9372503 put the order of reading preCreated from a UserInfo parcel
in the wrong spot. We fix it here.

Test: none
Change-Id: I4502e901ff2aac977c584fa8c5a3d1263be33572
2019-10-03 17:36:30 -07:00
Sudheer Shanka
09b0ee6315 Fix CONNECTIVITY_SERVICE value in the doc.
Fixes: 120119768
Test: n/a
Change-Id: Id20e183e0952cd938a0415b7124bac1642e500ae
2019-10-03 14:45:15 -07:00
TreeHugger Robot
16660951c8 Merge "Added option to pre-create user templates to optimize first user creation time." 2019-10-03 17:44:02 +00:00
Felipe Leme
c1ca4410e1 Added option to pre-create user templates to optimize first user creation time.
Initial user creation is slow because the system must prepare per-user data (like storage and
permissions) whose cost is proportional to the number of pre-installed apps. On automovive's
reference implementation, it can take more than 10s, which is a bad user experience.

This change lets OEMs pre-create some users , so that high initial-creation cost is "paid" during
the initial boot. On automotive, it improves the creation of an additional user (or guest user)
in about 7s (from ~17s to 9s).

Bug: 111451156
Bug: 132111956
Bug: 140750212
Bug: 140868593

Test: manual verification
Test: atest FrameworksServicesTests:UserControllerTest#testStartTemplateUser_background

Change-Id: I81de1b5376dc9c42b63be8853d7204c88826401f
2019-10-02 08:35:42 -07:00
Julius D'souza
92dbd38d18 Add SYNCHRONOUS to EnabledFlags for PackageManager
SYNCHRONOUS is a flag for setComponentEnabledSetting()
which will serialise the given user's package restrictions
state (including enabled + disabled packages) after the
specified component state has been updated.

Test: manual
Bug: 130044763
Change-Id: I615e5af6361718b5f3c355ca4424d1f8c4fb078f
Signed-off-by: Julius D'souza <jdsouza@google.com>
2019-10-01 09:52:21 -07:00
Mårten Kongstad
77b53b2c56 Remove the FEATURE_FLAG_IDMAP2 flag
Test: atest OverlayDeviceTests OverlayHostTests FrameworksServicesTests:com.android.server.om CtsAppSecurityHostTestCases:OverlayHostTest

Change-Id: Ib68eaf7f721c5d440fe7185777e88e23cb9840a4
2019-10-01 00:08:48 -07:00
Winson Chiu
29f3a0b63d Merge "Revert "Deprecate PackageParser#Package"" 2019-10-01 00:31:40 +00:00
Winson Chiu
8e18a0ab89 Revert "Deprecate PackageParser#Package"
This reverts commit 243e7ea14b.

Reason for revert: b/141854898

Exempt-From-Owner-Approval: Revert for failure to boot

Change-Id: Id6812e5ecf7d88504706b2c4110d83f1034ab85c
2019-10-01 00:23:30 +00:00
TreeHugger Robot
0617359e5a Merge "Allowing more than one app to suspend apps" 2019-09-30 22:43:18 +00:00
Winson Chiu
7267e3ef6b Merge "Deprecate PackageParser#Package" 2019-09-27 18:02:56 +00:00
Ryan Mitchell
346594121a Merge "Enable CTS verification of overlayable API" 2019-09-26 21:48:13 +00:00
Ryan Mitchell
4043ca78ea Add Resources Perf Tests
This changes adds benchamrks for Resources, ResourcesManager,
OverlayManager, and Resources.Theme.

Bug: 136085555
Test: atest OverlayManagerPerfTest
Test: atest ResourcesManagerPerfTest
Test: atest ResourcesPerfTest
Test: atest ResourcesThemePerfTest

Change-Id: I6a3b3275399c161e55ff6ce34e7bc2ae5556edf1
2019-09-26 14:15:26 -07:00
Winson
243e7ea14b Deprecate PackageParser#Package
Replaces PackageParser#Package and it's related structures with
ParsingPackage, ParsedPackage, and AndroidPackage.

This is a large scoped CL, the first step in an eventual goal
to refactor how data is handled in the package parsing and install
process. It introduces as few logic changes as necessary. Mostly
migrating to interfaces and renaming, moving parsing data calls into
3 separate interfaces that outline the intended flow for parsing.

ParsingPackage is built and used during what was PackageParser, now
replaced by ApkParseUtils and it's related classes. This is almost
exactly what was parsed from the XML/files on disk.

ParsedPackage is used when the object exits PackageParser and is
adjusted by PackageManagerService to what is considered the final
"parsed" state, adjusted from literal values, but consistent given
the same APK on disk. This should eventually be moved out of PMS
and possibly collapsed into the previous interface entirely.

AndroidPackage is the final state of the package after parsing and
adjustment has completed and no more mutations should be expected.
There are a few exceptions to this, included in AndroidPackageWrite,
which will eventually be refactored into PackageSetting or another
state class.

This marks PackageParser#Package and all the old infrastructure with
@Deprecated, as none of them are used internally. All usages were
converted, and the legacy Package is only built for un-converted tests
and @UnsupportedAppUsage methods.

There are numerous TODOs still outstanding, but addressing them
in this initial CL would introduce several logic changes. They've been
marked with the bug number and will be handled in follow ups.

This is being merged with caution thrown to the wind because
testing this on devices and in development will be the best way
to debug differences introduced by the migration. Getting it merged
as early as possible gives the most amount of time to fix regressions.

Waiting for tests of all the functionality could take literal years
before covering enough to merge this with all regressions verified.

Given a sample size of 4 heap dumps and the caveat it was taken very
early in the migration, there is a memory overhead of about 200 KB
versus the legacy implementation. This should be verified more
accurately and addressed in follow ups.

This CL also kills child/parent package support, since that's
broken already, and difficult to support with the new interface
structure.

Bug: 135203078

Test: booted an emulator, works generally as expected

Specific tests which failed / failed to build were fixed, but because
not all tests are currently passing before this change, not all were
verified.

Change-Id: I4ba050c228e6c60b8f63a9e3347b1f9a57ef794a
2019-09-26 13:27:17 -07:00
Ryan Mitchell
2e3942246d Enable CTS verification of overlayable API
Allows retrieval of a string representation of overlayable resources
that can be compared during CTS testing to verify that the overlayable
resources on device match the expected overlayable API.

Bug: 135052616
Test: libandroidfw_tests
Test: atest OverlayHostTest
Change-Id: I613f28c202a0904a917577f932d072111c1aa7bd
2019-09-26 17:53:20 +00:00
Chen Xu
8dcf873d9a Merge "Revert "remove symbols from greylist"" 2019-09-26 03:45:27 +00:00
TreeHugger Robot
85ce7cb0fd Merge "Do not check package if package-equivalent components have set" 2019-09-26 02:48:42 +00:00
Suprabh Shukla
d3278449d7 Allowing more than one app to suspend apps
We want to allow wellbeing apps to suspend in managed profiles.
This requires changing the internal data design of package-suspend
state to allow more than one suspending package, each with their
own parameters, namely - dialog info, app extras and launcher extras.

Also, removed the restriction of using setPackagesSuspendedAsUser when a
PO/DO exists

Test: atest com.android.server.pm.PackageUserStateTest
atest com.android.server.pm.PackageManagerSettingsTests
atest com.android.server.wm.ActivityStartInterceptorTest
atest GtsSuspendAppsTestCases

Bug: 138812320
Change-Id: If1263142fc9e6687e95af9b8d71ba8eff0c0fae9
2019-09-25 17:11:17 -07:00
Eran Messeri
3acf4a3e2d Merge "API for individual attestation" 2019-09-25 22:02:31 +00:00
TreeHugger Robot
be0f335f5a Merge "Whitelist packages for user types" 2019-09-25 18:45:13 +00:00
Chen Xu
a56786981e Merge "new TelephonyRegistryManager" 2019-09-24 18:32:48 +00:00
Patrick Baumann
572143fbaa Merge "Breaks isInstantApp into public and internal" 2019-09-24 18:24:11 +00:00
Eran Messeri
da05c80d6b API for individual attestation
Introduce a new API to request use of individual attestation
certificate for attesting keys generated by the
DevicePolicyManager.generateKeyPair method.

It builds on existing device ID attestation capabilities in two ways:
(1) Eligibility check: Assuming similar privacy requirements for the use
    of individual attestation certificates, enforce the same conditions
    for using them as the conditions for requesting device identifiers
    in the attestation record.
(2) Keymaster interaction: Passing the right Keymaster tag to the
    attestKey call, which is easily done in AttestationUtils.

Bug: 136494773
Test: CTS test to be added.
Change-Id: Idb5cee66d986a521c17e1955532d0bfae66c035d
2019-09-24 18:14:05 +01:00
Bookatz
04d7ae5c6f Whitelist packages for user types
Creates a new SystemConfig xml entry which allows a device to whitelist
system packages to be installed on users when they are created, based on
the type of user.

System packages will be installed on users when they are created, or
during OTAs, based on this whitelist. The whitelist can be
enabled/disabled via a Config resource.

For any user type, system packages can be whitelisted or blacklisted.
If it is both (for the same user type), the blacklist takes priority.
If it is neither, it won't be installed (since it isn't whitelisted).

If a system package isn't mentioned in the whitelist file at all, for
any user, then its behaviour depends on the Config resource value, which
can optionally implicitly whitelist all such apps on all users.

For now, the list is mostly empty and the default config is set to be
enabled but implicitly whitelist all system packages that are not
mentioned.

Test: atest FrameworksServicesTests:SystemConfigTest
Test: atest com.android.server.pm.UserManagerServicePackageWhitelistTest
Test: manually test user 0 by flashall -w and checking packages
Test: manually test OTA by setting setprop persist.pm.mock-upgrade 1
Bug: 134605778

Change-Id: Ia098c1f597f66a1c946cfcc9b7771c25e8ceabf7
2019-09-24 09:38:58 -07:00
Louis Chang
9c5a3300a5 Do not check package if package-equivalent components have set
Two intents that can be resolved to the same component were
evaluated as different intent filters, because one had the package
name set while the other one did not(null).

Skip performing package check if both two intents have components which
equals to its set package.

Bug: 64108432
Test: manual
Change-Id: I8163cbb6b56366ebbecaede7fa04ab3eab7cfe9f
2019-09-24 17:41:28 +08:00
Chen Xu
6155eb9663 Revert "remove symbols from greylist"
This reverts commit 27c4e658b3.

Reason for revert: <potential performance regression. revert for now and looking for possible optimization from ART team>

Change-Id: I5bf728e4f6789d7e6398cf90f22fbf3a24d481c2
2019-09-23 18:51:02 -07:00
Hai Zhang
a4322fa166 Merge "Add FLAG_PERMISSION_REVOKED_COMPAT." 2019-09-23 22:46:42 +00:00
Hai Zhang
50a5a9bb64 Add FLAG_PERMISSION_REVOKED_COMPAT.
We used to store the actual permission state for pre-M apps in app
ops, which creates two different sources of permission state and is
hard to handle correctly. This change will allow us to store the
permission state for pre-M apps within permission as
FLAG_PERMISSION_REVOKED_COMPAT (and syncing app op state based on it),
and is part of the effort to support rollback of runtime permission
state managed by PermissionController.

Actually, we do set a REVOKE_ON_UPGRADE flag properly when user
grants/revokes a runtime permission for pre-M apps, so it can be used
for computing app op state. In the case where app ops are incorrectly
set to denied without setting this flag, the app won't get the
permission revoked upon upgrade to support runtime permissions, and is
stuck with the denied app op, so overriding the app op state in this
case is arguably fixing a bad state.

Since the proposed new flag will cover whatever REVOKE_ON_UPGRADE does
currently, and REVOKE_ON_UPGRADE did imply denying app op in its
javadoc, this change is simply adding our new flag by renaming
REVOKE_ON_UPGRADE.

Bug: 136503238
Test: manual
Change-Id: Ib910f4df543d2fd8de259a6675f043d870a6f4c1
2019-09-23 10:57:00 -07:00
Chen Xu
288b71c8c1 new TelephonyRegistryManager
today telephonyRegistry lives in system process
this is intended to persists all telephony listeners when
phone process crash. Telephony today notify system server by
using AIDL APIs directly. Instead, we are exposing a proper API
surface: telephonyRegistryManager where only phone app and
carrier privileged apps are allowed to use APIs in
TelephonyRegistryManger to notify telephony related status update.

Bug: 140908357
Test: Build & Manaul
Change-Id: I1b750751148925b4a7bd94553318907654012fc1
2019-09-22 19:56:39 -07:00
Patrick Baumann
b6e729783e Breaks isInstantApp into public and internal
This change breaks isInstantApp up into a public and internal
implementation so that internal interfaces have a means of calling
without any permission checks that only apply to public callers.

Fixes: 141288362
Test: Work profile setup
Change-Id: I2cb8338c2a68bc9c4a61c075398d767980c504ed
2019-09-20 11:46:19 -07:00
Kevin Hufnagle
e6e4c980c3 Merge "docs: Add condition for hiding synth. activities" into qt-dev am: 00537efd07 am: 12298403b0 am: c67e4da871
am: 84b5194c1c

Change-Id: I67b9b3b317dd6543330615f78b0adbff81eb79a7
2019-09-18 18:05:58 -07:00
Kevin Hufnagle
84b5194c1c Merge "docs: Add condition for hiding synth. activities" into qt-dev am: 00537efd07 am: 12298403b0
am: c67e4da871

Change-Id: I7d478b8c7a1071961d8e2b365e9bd2c25c62e450
2019-09-18 17:45:34 -07:00
Kevin Hufnagle
c67e4da871 Merge "docs: Add condition for hiding synth. activities" into qt-dev am: 00537efd07
am: 12298403b0

Change-Id: I7a71cdb8fd5ecfd008d0e8257185cdd8c5366ce0
2019-09-18 17:39:27 -07:00
Kevin Hufnagle
00537efd07 Merge "docs: Add condition for hiding synth. activities" into qt-dev 2019-09-19 00:20:47 +00:00
TreeHugger Robot
895fd76955 Merge "Rely on PlatformCompat instead of DeviceConfig" 2019-09-18 16:18:11 +00:00
TreeHugger Robot
e02001e298 Merge "Marks app filtering interactions correctly" 2019-09-18 11:30:56 +00:00
Kevin Hufnagle
4581566521 Merge "docs: Fixed contradictory info in IntentFilter" into qt-dev am: 1fe99017eb am: 1e8492c744 am: 85bd2c62cb
am: 4d53ea94c7

Change-Id: I734924789d8e8b6eac3270f857eadd0752904493
2019-09-17 12:44:44 -07:00
Kevin Hufnagle
4d53ea94c7 Merge "docs: Fixed contradictory info in IntentFilter" into qt-dev am: 1fe99017eb am: 1e8492c744
am: 85bd2c62cb

Change-Id: Ic7beb1eabce4ce8b241a11163b637000c4df4270
2019-09-17 12:37:20 -07:00
Kevin Hufnagle
85bd2c62cb Merge "docs: Fixed contradictory info in IntentFilter" into qt-dev am: 1fe99017eb
am: 1e8492c744

Change-Id: Idbc73307a0c3f4a937a2a964667f01b28aa274ce
2019-09-17 12:32:20 -07:00
Kevin Hufnagle
1fe99017eb Merge "docs: Fixed contradictory info in IntentFilter" into qt-dev 2019-09-17 18:54:20 +00:00
Kevin Hufnagle
b8779b82bb docs: Add condition for hiding synth. activities
If an app doesn't have a launcher activity enabled by default, a
synthesized activity isn't created for that app.

Test: make ds-docs -j32

Bug: 140968734
Change-Id: I2fe8666ee8cde479f404e43c622f03891d96c38f
2019-09-17 18:48:39 +00:00
Patrick Baumann
a94cbc12cd Rely on PlatformCompat instead of DeviceConfig
This change turns off the kill switch for App Enumeration by default
and sets the PlatformCompat feature to @Disabled until we're ready to
turn it on by default for beta.

Bug: 136675067
Test: atest AppsFilterTest
Test: atest AppEnumerationTests
Change-Id: I7f3c1995318838cda5d7025de8ae366cde75930f
2019-09-17 10:38:26 -07:00
Patrick Baumann
de37e43871 Marks app filtering interactions correctly
Bug: 136675067
Test: atest AppsFilterTest
Test: adb shell device_config put package_manager_service package_query_filtering_enabled true && atest AppEnumerationTests
Change-Id: Idce07d200e472fe56da0bae3aba4e61dc27997fe
2019-09-17 09:52:53 -07:00
TreeHugger Robot
c48da41993 Merge "Adds app enumeration support for all components" 2019-09-16 20:16:46 +00:00