Commit Graph

7996 Commits

Author SHA1 Message Date
Andrew Solovay
8e351a1c14 Merge "docs: Clarified behavior of TypedArray.getBoolean()" into qt-dev am: de21a30cda
am: c5f06a08c8

Change-Id: Ic61f305c81ebeaa0e4002c4f23007f2edacc6e4a
2019-11-07 17:35:10 -08:00
TreeHugger Robot
de21a30cda Merge "docs: Clarified behavior of TypedArray.getBoolean()" into qt-dev 2019-11-08 01:17:29 +00:00
Joshua Baxter
ffbebe1fde Merge "docs: fix typo" into qt-dev am: 4fa49b4541
am: 5cc0a67503

Change-Id: I1558247d9dfdb621288b3f419447985ca0dbf88f
2019-11-06 13:46:35 -08:00
Joshua Baxter
f4d07d459c docs: fix typo
Change-Id: I843a3d94e48335babffdf8a226fa9e3d00c5bbf1
test: make ds-docs
bug: 144041941
2019-11-06 21:02:33 +00:00
Andrew Solovay
ee07a8cadb docs: Clarified behavior of TypedArray.getBoolean()
Doc currently says "The method will return whether [the attribute] is equal to zero", which could be read as "returns true if the attribute is zero", which is incorrect. Rephrased as: "...returns false if the attribute is equal to zero, and true otherwise."

Change-Id: Ie7d763ac2784ecc3a7fb522b4fa583ec8d2644d4
BUG: 143049875
Test: make ds-docs
2019-11-01 16:07:39 -07:00
Kevin Hufnagle
d6105c8316 Merge "docs: App doesn't receive "first launch" broadcast" into qt-dev am: 0823f1b508
am: e7832d514b

Change-Id: Ib2590dc07f3aa284c993bd4c65772277ea457727
2019-10-21 15:51:06 -07:00
Felipe Leme
5284336dec 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
Merged-In: I4502e901ff2aac977c584fa8c5a3d1263be33572
Change-Id: I4502e901ff2aac977c584fa8c5a3d1263be33572
(cherry picked from commit e80af14d33)
2019-10-18 13:07:13 -07:00
Felipe Leme
7ad2f6bdad 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

Merged-In: I81de1b5376dc9c42b63be8853d7204c88826401f
Change-Id: I81de1b5376dc9c42b63be8853d7204c88826401f
(cherry picked from commit c1ca4410e1)
2019-10-18 11:05:06 -07:00
Kevin Hufnagle
49d171d595 docs: App doesn't receive "first launch" broadcast
Test: make ds-docs -j32

Bug: 116543817
Change-Id: I9aa1f1851ce236397ad2e1a36ea487b96daa55c5
2019-10-15 19:47:38 +00:00
Alan Stokes
9ed11c9dea Merge "Revert new app installed notification doc" into qt-dev am: 98540e2a16
am: 24e18b415f

Change-Id: I2675329bb8a87beb1e8c221f35e12f0fa675445a
2019-10-07 08:30:38 -07:00
Alan Stokes
98540e2a16 Merge "Revert new app installed notification doc" into qt-dev 2019-10-07 14:41:57 +00:00
Philip P. Moltmann
7cd4256dde Merge "Update PermissionChecker usages to avoid unnecessary attribution." into qt-dev am: 0a71df1f7e
am: 43f6144e21

Change-Id: Ib8548cbfc7531a5f5e9100ae26cf9b6c8f97760f
2019-10-04 12:05:17 -07:00
Ricky Wai
5f5bacfda0 Revert new app installed notification doc
Bug: 111214100
Test: Able to compile
Change-Id: Id4fdabf0e8c69074eb8cb5838ab11d9d5f030093
2019-10-04 16:10:17 +01:00
Svet Ganov
7fe065eb66 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
Merged-In: I65c71569d0dd8a40bc6fecabb22c5373dd6e806e
Change-Id: I65c71569d0dd8a40bc6fecabb22c5373dd6e806e
2019-10-03 21:58:13 +00:00
wangmingming1
4a4ceeeb79 notify netd about uid internet permission changes when package replaced
1. If a previous version of an app doesn't declare internet permission;
2. The User upgraded it to a new version and the new one does declare the
internet permission;
3. The new app are not allowed to access the internet until next boot

Bug: 137864893
Test: Manual, just make sure the onPackageChanged would be executed on package changes
Change-Id: I69cdbb16a027a9c4e974b32371b1f64a23a51a23
Signed-off-by: wangmingming1 <wangmingming1@xiaomi.com>
2019-09-20 03:23:23 +00: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
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
Varun Shah
667db1bea5 Merge "Use language tags to store Configuration's locale list." into qt-dev am: 6dfa267f91
am: 6947f255e4

Change-Id: Ic1954896252b758e8360c7fdf7cdeddb184bab03
2019-09-10 23:36:07 -07:00
Varun Shah
5e67462971 Use language tags to store Configuration's locale list.
Instead of storing each Locale within a Configuration object's locale
list by its language, country, variant, and script to proto, store the
entire locale list by its language tags representation which accurately
describes each locale.

Bug: 140197723
Test: atest ConfigurationTest
Test: atest UsageStatsDatabaseTest
Test: manually with bad data
Merged-In: I53946ed4e31de0ffe9c84875c391a7dec6f5375a
Change-Id: Idaae690f79a5c680ad0059a52be62160d9dfb5e7
2019-09-10 19:53:57 +00:00
Colin Cross
c09f17d559 Merge "Revert "Use language tags to store Configuration's locale list."" into qt-dev am: dd67a548b2
am: 18bf694f3c

Change-Id: I9481fb2063b8a38a86dd52867c4c9ad52e9b8c7a
2019-09-10 12:36:03 -07:00
Colin Cross
dd67a548b2 Merge "Revert "Use language tags to store Configuration's locale list."" into qt-dev 2019-09-10 19:18:48 +00:00
Varun Shah
68cdb74d91 Revert "Use language tags to store Configuration's locale list."
This reverts commit ff43f4e6a6.

Reason for revert: b/140813780

Change-Id: Id5988b9ec959ca9b294f6bd5caa30c8156238d0a
2019-09-10 18:30:47 +00:00
Varun Shah
6540f10816 Merge "Use language tags to store Configuration's locale list." into qt-dev am: bdfd7d6adb
am: ec466c0a8e

Change-Id: If5fbf5869ebed425d2df0d5472d7bbe859fb6505
2019-09-10 10:17:23 -07:00
Varun Shah
bdfd7d6adb Merge "Use language tags to store Configuration's locale list." into qt-dev 2019-09-10 16:51:37 +00:00
Anthony Hugh
6f5eadc0d3 Refactor PermissionManager.SPLIT_PERMISSIONS
Creating a SystemConfig from a non-system process is taking 500+ ms.
This CL instead exposes the needed split permissions from system_server
to optimize performance.

Tested locally and creating PermissionManager / retrieving SystemConfig
is now less than 1 ms.

Bug: 139828734
Bug: 139485700
Fixes: 139828734
Test: Added systrace / logs to PermissionController app and traced
runtime of onGrantDefaultRoles().

Merged-In: I111403e8dae3bc2b0acafc32e61aa5cd890fea29
Change-Id: I111403e8dae3bc2b0acafc32e61aa5cd890fea29
(cherry picked from commit f69c71e25889d8a9d66da05ee0f386d7fb626c6c)
2019-09-09 15:49:04 -07:00
Varun Shah
ff43f4e6a6 Use language tags to store Configuration's locale list.
Instead of storing each Locale within a Configuration object's locale
list by its language, country, variant, and script to proto, store the
entire locale list by its language tags representation which accurately
describes each locale.

Bug: 140197723
Test: atest ConfigurationTest
Test: atest UsageStatsDatabaseTest
Test: manually with bad data
Change-Id: Id0e63ae4a7be578d1e93838b371320f86a787e0e
2019-09-09 22:41:54 +00:00
Varun Shah
669d886cdc Fix bootloop issue with UsageStatsService.
When the configurations are being read from the proto file, if a
duplicate locale is found in the list, an exception is thrown from
LocaleList which causes the UsageStatsService to crash. Instead, we'll
now log a WTF if duplicate locales are found when parsing the
configuration proto and not add the duplicate locale to the list.

Bug: 140197723
Test: atest UsageStatsDatabaseTest
Change-Id: Ie178b3cfdd45e6771a7c0e4bb42e47f79b5c30cc
(cherry picked from commit 5d9031dbee)
2019-09-09 22:41:22 +00:00
Varun Shah
5d9031dbee Fix bootloop issue with UsageStatsService.
When the configurations are being read from the proto file, if a
duplicate locale is found in the list, an exception is thrown from
LocaleList which causes the UsageStatsService to crash. Instead, we'll
now log a WTF if duplicate locales are found when parsing the
configuration proto and not add the duplicate locale to the list.

Bug: 140197723
Test: atest UsageStatsDatabaseTest
Change-Id: Ie178b3cfdd45e6771a7c0e4bb42e47f79b5c30cc
2019-09-04 19:12:08 +00:00
Kevin Hufnagle
fbfe223a44 docs: Fixed contradictory info in IntentFilter
The docs now (correctly) state that, if an intent filter specifies no
actions, then it only matches intents that don't specify/contain an
action.

Test: make ds-docs -j32

Bug: 140435265
Change-Id: I8931c6540cb22edd15e8caa1be984ca70efcdc96
2019-09-03 21:54:31 +00:00
Kevin Hufnagle
5e1a48a660 Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev am: b14d2dede2
am: 13e2b970ec

Change-Id: I393ec53ecf097e5ebe4ce2878e149fbf653df622
2019-08-28 17:39:34 -07:00
Kevin Hufnagle
b14d2dede2 Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev 2019-08-28 22:08:47 +00:00
Andrew Solovay
676ef1a61c Merge "Docs: clarify getSharedPreferences behavior" into qt-dev am: 3791f9b071
am: 73a66dc100

Change-Id: Ie94b91be0696090bc1bcce4a787873886a268396
2019-08-28 13:45:51 -07:00
Kevin Hufnagle
25266af6f3 docs: Added desc. of launcher app criteria in Q
As of Android Q, an app is included in the return value of
LauncherApps#getActivityList() unless it fulfills specific criteria.
This CL describes the conditions necessary for an app's activities
to *not* appear in the list.

Test: make ds-docs -j32

Bug: 130352392
Change-Id: I6a6e17351a6c1234229d1d7eb8147ee2c24ee2c9
2019-08-28 17:55:59 +00:00
Nate Fischer
5272c3776d Docs: clarify getSharedPreferences behavior
No change to logic, only documentation.

This updates Context#getSharedPreferences docs:

 * Fix a typo ("thead" -> "thread")
 * Formatting: use <p> when appropriate, {@link} to other APIs, limit
   the @param to only a single sentence
 * Mention getSharedPreferences() may actually perform disk IO (this was
   undocumented)
 * Mention Editor#apply() as well as #commit()

Fixes: 140137651
Test: make docs
Change-Id: I245371d13d4f317c6c522debcdf7938ab783f897
2019-08-28 00:45:08 +00:00
Felipe Leme
87c5855e17 Fixed SystemServiceRegistry to return a null AppPredictionManager when the service is not defined.
Test: manual verification
Test: atest CtsAssistTestCases

Fixes: 139416391

Change-Id: Ieb2ae3f39bd42dc077ed3db1c6acdf429a39d519
2019-08-15 06:03:24 +00:00
Kevin Hufnagle
7ae4cbeeda Revert "docs: Added desc. of launcher app criteria in Q"
This reverts commit 786f22e416.

Reason for revert: Need further feedback from SMEs

Bug: 130352392

Change-Id: I51b3bd19e27d28fe3aea300893da50bbf889ec73
2019-08-14 19:35:23 +00:00
Kevin Hufnagle
786f22e416 docs: Added desc. of launcher app criteria in Q
As of Android Q, an app is included in the return value of
LauncherApps#getActivityList() unless it fulfills specific criteria.
This CL describes the conditions necessary for an app's activities
to *not* appear in the list.

Test: make ds-docs -j32

Bug: 130352392
Change-Id: Iad888a7a7f47d090da1b143ac152705577144d20
2019-08-12 16:52:41 -07:00
Dmitry Dementyev
40431ae1bc Revert "Do not load xml metadata for unchanged packages in RegisteredServicesCache"
This reverts commit 8094880025.

Reason for revert: changed services order
Test: manual
Bug: 136261465

Change-Id: I2f78f0dbbace212309b87f779efad020cf255196
2019-07-02 03:59:17 +00:00
Andrew Sapperstein
9dd0c5628b Merge "Allow granting URI permissions to com.android.settings.module_licenses." into qt-dev 2019-06-28 16:56:04 +00:00
Mathew Inwood
3a75f264a8 Restore some greylist entries.
In Q, these APIs were either:
- removed from the greylist entirely without good reason
- Moved to the restricted greylist without any public alternative
  information added

So they are being moved back to the greylist for Q.

Test: Treehugger
Bug: 136102585
Change-Id: I5ac8b8b9b23c3789d80239cf456072cc7dfa1203
2019-06-28 10:15:37 +01:00
Andrew Sapperstein
93f5ed6c18 Allow granting URI permissions to com.android.settings.module_licenses.
Exempts this new ContentProvider for providing mainline module licenses.

Also sets ApplicationInfo.publicSourceDir for APEXes.

Bug: 135183006
Test: open module licenses, click app, verify file opens
Change-Id: Iec4f1de198525f7cd176a52d8448a2c71b6aabc0
2019-06-24 18:24:52 -07:00
Amith Yamasani
5016a7891a Expose BIND_NOT_PERCEPTIBLE service flag
Using this flag when binding to a service will
allow the bound process to be held at a low
oom_adj of 250, so that it can be expunged to
reclaim memory if a more user-visible app needs
it.

Use for bindings such as job services and other
connections that the caller can easily recover
from and restart if necessary.

Adjust the lmk thresholds to use this oom_adj
as one of the levels, so they're killed before
perceptible apps (such as foreground services).

Bug: 135219821
Test: CtsAppTestCases
      Manually check notification listener oom_adj
      and dumpsys activity services output

Change-Id: I9f6d0891d842e4d12f7995b9b1a8f57b0903a16d
2019-06-19 14:40:57 -07:00
Narayan Kamath
157dd1dc40 Move legacy obb data migration to a handler thread.
The operation can potentially take a long time to complete
depending on the volume of data to be copied, so move it off
the ActivityManager handler thread that needs to be available
for other operations.

Bug: 134570017
Test: manual; set a 1 minute sleep in migrate_legacy_obb_data.sh

Change-Id: I3d2c52e8b012ed71c53810e6919d11be9a97cc6c
2019-06-12 13:40:15 +01:00
TreeHugger Robot
d703395fcb Merge "Expose PermissionManager as TestApi and fix SplitPermissionInfo equality" into qt-dev 2019-06-10 20:12:57 +00:00
Winson
f27394ee70 Expose PermissionManager as TestApi and fix SplitPermissionInfo equality
Bug: 129200416
Bug: 129200610

Test: atest SplitPermissionsTest

Change-Id: I98795944e6440e5b7ebba134bd7735a6f78ebc4f
2019-06-07 15:09:06 -07:00
TreeHugger Robot
f49c18e1a9 Merge "OMS: add TEST_MAPPING" into qt-dev 2019-06-06 20:44:49 +00:00
Bookatz
9313af68c2 loadUnbadgedItemIcon doesn't crash from getUserIcon
AppicationPackageManager.loadUnbadgedItemIcon would call
UserManager.getUserIcon if the icon was supposed to represent
switching to another the parent user (from a work profile).
However, that call requires extra permissions which may not be
available, which would cause a crash. The work profile doesn't
generally have permission to see the parent's icon, so rather
than showing the actual icon, a generic user icon is shown instead.

Bug: 134177607
Test: Manual confirmation: create a work profile and try to share a
picture (from Photos) to the personal profile.

Change-Id: Id79ca50b8e0a26593addbacf1a0ea709a2bc4da2
2019-06-05 03:03:24 +00:00