Commit Graph

7978 Commits

Author SHA1 Message Date
TreeHugger Robot
de21a30cda Merge "docs: Clarified behavior of TypedArray.getBoolean()" into qt-dev 2019-11-08 01:17:29 +00: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
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
98540e2a16 Merge "Revert new app installed notification doc" into qt-dev 2019-10-07 14:41:57 +00: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
Kevin Hufnagle
00537efd07 Merge "docs: Add condition for hiding synth. activities" into qt-dev 2019-09-19 00:20:47 +00: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
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
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
bdfd7d6adb Merge "Use language tags to store Configuration's locale list." into qt-dev 2019-09-10 16:51:37 +00: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
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
b14d2dede2 Merge "docs: Added desc. of launcher app criteria in Q" into qt-dev 2019-08-28 22:08:47 +00: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
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
TreeHugger Robot
e5e876265c Merge "Verify staged APKs pre-reboot." into qt-dev 2019-06-01 00:25:51 +00:00
Gavin Corkery
5b9e00273b Merge "Perform user data back up in post install stage" into qt-dev 2019-05-31 16:10:13 +00:00
Dario Freni
f141aab4ed Verify staged APKs pre-reboot.
Test: adb install --staged file.apk on taimen-eng target; adb
install-multi-package file1.apex file2.apex file3.apk file4.apk
Test: atest StagedRollbackTest
Bug: 123753157
Change-Id: I41121b73c0db8ca55bafd2f57cba73bb3b940149
2019-05-31 14:55:08 +01:00
Gavin Corkery
ab5ee411e5 Perform user data back up in post install stage
Currently the backup of user data is done in the enable rollback stage,
during which there is no guarantee that the package being backed up is
not currently running. Moving the backup to the post install stage will
guarantee that the package is not running.

Test: atest RollbackTest
Test: atest StagedRollbackTest
Bug: 124032231
Change-Id: I4b42a0c5ade1645585d1d6f698637df950d05c72
2019-05-31 10:26:56 +01:00
TreeHugger Robot
8b486b7870 Merge "Fix install flag overlap" into qt-dev 2019-05-29 00:45:21 +00:00
Mehdi Alizadeh
f1affe0d17 Merge "Clone Persons field in ShortcutInfo only for app prediction" into qt-dev 2019-05-28 22:42:19 +00:00
Patrick Baumann
72a50878fe Fix install flag overlap
When INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS was added, its value
conflicted with iINSTALL_FORCE_VOLUME_UUID. A subsequent change added
INSTALL_ALL_WHITELIST_RESTRICTED_PERMISSIONS to all adb install
requests, resulting in all adb installs being force UUID installs and
thus breaking adoptable storage CTS. This change fixes that overlap.

Fixes: 133215060
Test: atest android.appsecurity.cts.AdoptableHostTest#testPackageInstaller
Change-Id: I8fbfcc0eea4f4447e4a446fe188b6edfc9cec0f6
2019-05-28 15:20:15 -07:00
TreeHugger Robot
05ec93ebc9 Merge "Made Context.CONTENT_CAPTURE_MANAGER_SERVICE visible for tests." into qt-dev 2019-05-28 16:17:27 +00:00
Mehdi Alizadeh
c60960278d Clone Persons field in ShortcutInfo only for app prediction
Persons field in ShortcutInfo should only be accessible when caller
has the MANAGE_APP_PREDICTIONS permission.

Bug: 123959894
Test: atest com.android.server.pm.ShortcutManagerTest1 \
  com.android.server.pm.ShortcutManagerTest2 \
  com.android.server.pm.ShortcutManagerTest3 \
  com.android.server.pm.ShortcutManagerTest4 \
  com.android.server.pm.ShortcutManagerTest5 \
  com.android.server.pm.ShortcutManagerTest6 \
  com.android.server.pm.ShortcutManagerTest7 \
  com.android.server.pm.ShortcutManagerTest8 \
  com.android.server.pm.ShortcutManagerTest9 \
  com.android.server.pm.ShortcutManagerTest10

Change-Id: I1908496dfbf9b11624b0746154bb5ea6f2d30c38
2019-05-27 13:36:42 -07:00
Gavin Corkery
ef441722c8 Allow PackageManager to retrieve inactive/factory APEXs.
Add functionality to ApexManager to filter the list of all APEX
packages in order to obtain lists of inactive or factory APEXs.
Expose this information to dumpsys.

Test: adb shell dumpsys package
Test: adb shell pm list packages -a --apex-only
Test: atest PackageParserTest
Bug: 123680735
Bug: 119767311
Change-Id: Id8ffe6320b55f647cdf550abfd6703cd868565ff
2019-05-25 19:03:51 +01:00
Brad Ebinger
a105253ea8 Merge "Add CAPABILITY_EMERGENCY_PREFERRED in PhoneAccount" into qt-dev 2019-05-24 17:45:47 +00:00
Philip P. Moltmann
3fb12ba490 Merge "Make sure to always upgrade runtime permissions" into qt-dev 2019-05-23 23:10:49 +00:00
Hai Zhang
c3c75a49ea Merge "Exclude packages that's not installed from the hash for role." into qt-dev 2019-05-23 20:38:36 +00:00
Felipe Leme
a7e4ca6a42 Made Context.CONTENT_CAPTURE_MANAGER_SERVICE visible for tests.
Test: m update-api
Fixes: 133438104

Change-Id: I5d10acdd79d1460736eaface8f6fc5b5014a1560
2019-05-23 13:36:26 -07:00
Philip P. Moltmann
5f5783e1fd Make sure to always upgrade runtime permissions
- For users running when the PermissionPolicyService is initialized we
  are not running onStartUser. Hence we have force to do this in
  onBootPhase
- Only write the runtime-permission fingerprint after all permission
  upgrade steps are done
  - This also means that if a user was not started in the first boot
    after an OTA we do not upgrade the fingerprint until the user was
    eventually started

Fixes: 132737426
Test: - Started a fresh build
      - Rebooted
      - Simulated an OTA
      - Added a second user
      - Simulated an OTA with a second user, rebooted and only then
        started the second user
Change-Id: I0758e8bdfefc16139bde2444f126adc3b0a17526
2019-05-23 11:47:22 -07:00
Hai Zhang
eb8b460c8f Exclude packages that's not installed from the hash for role.
Otherwise we won't detect the change when a package is set to
installed for an user.

Also added the number of enabled components to the hash so that when
an enabled component get disabled but the order didn't change, we can
still detect the change.

Fixes: 129004850
Test: follow the repro step in b/129004850 and confirm it's fixed
Change-Id: I87d62daf0f6a4d34939ee03ee783e9bdb19bf558
2019-05-22 19:36:30 -07:00
Brad Ebinger
3636d74ead Add CAPABILITY_EMERGENCY_PREFERRED in PhoneAccount
Allow Telephony to mark a SIM PhoneAccount as
emergency preferred, meaning that Telecom will
override a user's PhoneAccount preference for
emergency calls if the PhoneAccount has the
CAPABILITY_EMERGENCY_PREFERRED capability.

Bug: 131203278
Test: Manual testing, Telecom/Telephony unit testing
Change-Id: I88b8bbfa444f5445b2f0d6a1542c6406a19b240f
2019-05-22 19:52:01 +00:00
Sudheer Shanka
1b817f65db Don't use linked mediastore uris in DownloadProvider operations.
When MediaProvider db gets recreated, all the media content ids
get renumbered. It's possible that when DownloadProvider is
trying to delete an entry, it is holding onto a invalid mediastore
uri. So, don't use linked mediastore uris in DownloadProvider
operations. Also, revoke any prior uri grants of media content from
DownloadStorageProvider.

Bug: 132087334
Test: manual
Test: atest DownloadProviderTests
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/app/DownloadManagerLegacyTest/src/android/app/cts/DownloadManagerLegacyTest.java
Test: atest cts/tests/app/DownloadManagerApi28Test/src/android/app/cts/DownloadManagerApi28Test.java
Test: atest cts/hostsidetests/appsecurity/src/android/appsecurity/cts/AppSecurityTests.java
Change-Id: I4885f5a0ae0b3ab660426605a8a43b8c1d66a4c7
2019-05-21 10:21:43 -07:00