Commit Graph

8002 Commits

Author SHA1 Message Date
Mårten Kongstad
50c5ea184f Merge "OMS: add TEST_MAPPING" into qt-dev
am: f49c18e1a9

Change-Id: I159abb9b55a6885fcb3d28fe2fcc275cc632dd78
2019-06-06 13:54:59 -07:00
TreeHugger Robot
f49c18e1a9 Merge "OMS: add TEST_MAPPING" into qt-dev 2019-06-06 20:44:49 +00:00
Adam Bookatz
aaa16c0734 Merge "loadUnbadgedItemIcon doesn't crash from getUserIcon" into qt-dev
am: 14a34b9efb

Change-Id: I96167fe68786a5269d2178d74c3bb4ffa1afca1c
2019-06-06 11:05:58 -07:00
Tyler Gunn
755f4a8345 Merge "Update NEW_OUTGOING_CALL broadcast deprecation docs." am: f089867d9b
am: 52f65867d2

Change-Id: Ia91a950690930329bc66427af7289ec6f9fc6f42
2019-06-05 20:28:36 -07: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
f089867d9b Merge "Update NEW_OUTGOING_CALL broadcast deprecation docs." 2019-06-04 18:37:48 +00:00
Dario Freni
f1d9180e68 Merge "Verify staged APKs pre-reboot." into qt-dev
am: e5e876265c

Change-Id: Id30f05784a99abbe2a4d4d21c8fc9b04f2b61525
2019-05-31 19:16:16 -07:00
TreeHugger Robot
e5e876265c Merge "Verify staged APKs pre-reboot." into qt-dev 2019-06-01 00:25:51 +00:00
Gavin Corkery
9b87b9a6dd Merge "Perform user data back up in post install stage" into qt-dev
am: 5b9e00273b

Change-Id: I7b45401aeaf34855921f25a2c00c9af1a1a25035
2019-05-31 09:18:06 -07: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
Patrick Baumann
153d00aecd Merge "Fix install flag overlap" into qt-dev
am: 8b486b7870

Change-Id: I21fb4641dd250680de5a97d7d9fc97e01d93565d
2019-05-28 17:58:40 -07:00
TreeHugger Robot
8b486b7870 Merge "Fix install flag overlap" into qt-dev 2019-05-29 00:45:21 +00:00
Mehdi Alizadeh
8a10aa5321 Merge "Clone Persons field in ShortcutInfo only for app prediction" into qt-dev
am: f1affe0d17

Change-Id: Ib272836caee95f456ea90aa1774184ce889b6dac
2019-05-28 16:02:23 -07: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
Felipe Leme
a3e305d4fa Merge "Made Context.CONTENT_CAPTURE_MANAGER_SERVICE visible for tests." into qt-dev
am: 05ec93ebc9

Change-Id: I9f0be45afbe50ca609f62ee32238a21b7beea0ba
2019-05-28 09:29:59 -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
Gavin Corkery
2676f10410 Merge "Allow PackageManager to retrieve inactive/factory APEXs." into qt-dev
am: aef1ff0571

Change-Id: Ic9775129a2d2549861ffcaecee60ca73dfdaedbf
2019-05-28 01:38:11 -07: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
499881f1da Merge "Add CAPABILITY_EMERGENCY_PREFERRED in PhoneAccount" into qt-dev
am: a105253ea8

Change-Id: If70d917cfb3d825f375d282012b8788d69a2f144
2019-05-24 11:01:15 -07: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
8ea7627c51 Merge "Make sure to always upgrade runtime permissions" into qt-dev
am: 3fb12ba490

Change-Id: I22197831ca683c5d128bb9f695fe0b19adb3c67d
2019-05-23 19:21:34 -07:00
Hai Zhang
f531147aa8 Merge "Exclude packages that's not installed from the hash for role." into qt-dev
am: c3c75a49ea

Change-Id: Ie93cc1d841c572ff841efcd96c7bdf47ad19df25
2019-05-23 18:06:04 -07: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
cb36319306 Merge "Don't use linked mediastore uris in DownloadProvider operations." into qt-dev
am: 4344e7c721

Change-Id: Iaf52026e9d67f97b94cc0426a460f94b5fa358ec
2019-05-22 01:58:24 -07:00
Felka Chang
01fc17e00a Merge "Fix sysui's security issue of cross-user copy/paste" into qt-dev
am: 743288a029

Change-Id: I7e67f0f6f4372b62bfac875ab6ebdcfb43aef3c7
2019-05-21 21:40:49 -07:00
Eric Holk
64bd7c068c Merge "Remove obtainStyledAttribute and AssetManager2::GetBag tracing" into qt-dev
am: bdc1ba53ef

Change-Id: I664783b86275e5a6513c1d464aa0bc7d12829ad0
2019-05-21 14:36:36 -07: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
TreeHugger Robot
743288a029 Merge "Fix sysui's security issue of cross-user copy/paste" into qt-dev 2019-05-21 16:50:52 +00:00
Felka Chang
33f56060d5 Fix sysui's security issue of cross-user copy/paste
Background:
The applications with the granted INTERNAL_SYSTEM_WINDOW and
INTERACT_ACROSS_USERS_FULL means that it could show the same
window for all of users. i.e. to use user 0 presents all of
UI things to all of users.

INTERNAL_SYSTEM_WINDOW usually comes with INTERACT_ACROSS_USERS_FULL
because it will serve all of users to know the information that
comes from framework and system server.

Solution:
Because SystemUI never restarts after the user changing,
ClipboardService can't tell if the callingUid has the the same userId
with the current user or not.  The solution is to use the permission
check. Especially, INTERACT_ACROSS_USERS_FULL and
INTERNAL_SYSTEM_WINDOW. To check INTERACT_ACROSS_USERS_FULL by using
ActivityManagerInternal.handleIncomingUser.

Caution:
The application with INTERNAL_SYSTEM_WINDOW usually use user 0
to show the window. But, the current user is user 10, WindowManager
know the focus windows is belong to user 0 rather user 10. That's
why user 10 can't copy the the text from systemui directly reply to
the other applications.

Readability:
ClipboardService use callingUid everywhere but actaully it is not
appropriated to fix this kind of bug. This patch refactor the naming
to produce two name. i.e. intendingUid and intentdingUserId that are
validated by ActivityManagerInternal.handleIncomingUser.

Test: manual test
Test: atest android.widget.cts.TextViewTest
Test: atest CtsTextTestCases
Test: atest CtsContentTestCases

Bug: 123232892
Bug: 117768051
Change-Id: Ie3daecd1e8fc2f7fdf37baeb5979da9f2e0b3937
2019-05-21 14:16:59 +08:00
Eric Holk
4487398e0d Remove obtainStyledAttribute and AssetManager2::GetBag tracing
These traces are small and noisy, so they hurt performance more than they help.

This reverts commit c37457799b.

Test: m
Bug: 132721345
Change-Id: I9ef719f54f2bc8a54f23e88f46d74e35417a6519
(cherry picked from commit 3509b624fe)
2019-05-21 00:31:03 +00:00
Philip P. Moltmann
cb9eac87e3 Merge "Whitelist all perms on installExistingPackage" into qt-dev
am: 4f09b09f62

Change-Id: I4846eb0e9ea4697d033000b46aa744a8ce70e2e6
2019-05-17 13:28:47 -07:00
Philip P. Moltmann
4f09b09f62 Merge "Whitelist all perms on installExistingPackage" into qt-dev 2019-05-17 19:56:19 +00:00
Mohammad Samiul Islam
01662793cf Merge "Add support for returning installed apex modules in getInstalledModules" into qt-dev
am: 141e7b0395

Change-Id: I3cf4cbecbd8e3a7e136978b36f62ad287d94f209
2019-05-17 05:31:03 -07:00
TreeHugger Robot
141e7b0395 Merge "Add support for returning installed apex modules in getInstalledModules" into qt-dev 2019-05-17 12:13:32 +00:00
Jeff Sharkey
c29469ed59 Merge "Cache resolved details about remote callers." into qt-dev
am: 04e5f7acff

Change-Id: I95ccdf88de9564f44b845463802efc6d92bc8545
2019-05-15 23:59:10 -07:00
Jeff Sharkey
04e5f7acff Merge "Cache resolved details about remote callers." into qt-dev 2019-05-16 03:29:16 +00:00
Jeff Sharkey
951f99ba02 Cache resolved details about remote callers.
The logic in MediaProvider is technically correct, but it's sometimes
inefficient in calling into the OS multiple times with the same
questions, such as validating getCallingPackage().

To mitigate this overhead, and start paving the way for more dynamic
delegation of permission checks, collect these details into a
LocalCallingIdentity object.  We carefully perform all permissions
checking against this new object, and avoid using any other
thread-local values from ContentProvider or Binder.

Local tests show this CL improves performance of a test app that
takes 100 rapid shots by 37%.

This change is a no-op refactoring.

Bug: 130758409, 115619667
Test: atest --test-mapping packages/providers/MediaProvider
Change-Id: If250a7675f2246cd10881acf615619d6d6061f3d
2019-05-15 19:20:01 -06:00
Ian Pedowitz
8eebd293e5 Merge "Revert "Revert "Remove deprecated System APIs added in Q.""" into qt-dev
am: 3bd719b534

Change-Id: I3a55fc232cef2d22052d3b1faf2ef08047e2f7c2
2019-05-15 13:55:07 -07:00
Xin Li
c76d117d2a DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master
Bug: 132622481
Change-Id: I7ba1a9999b3a9bac8031dd086fa2632e45404f32
2019-05-15 11:31:45 -07:00
Mohammad Samiul Islam
c15221e354 Add support for returning installed apex modules in getInstalledModules
Bug: 131929295
Test: atest ModuleMetadataTests
Change-Id: I40be703f9844521342761f5af671823514a93d88
2019-05-15 19:22:20 +01:00
Philip P. Moltmann
a4bd150588 Whitelist all perms on installExistingPackage
The code allows to also whitelist only a select set of permissions, but
this is not yet exposed in the API.

Also: Fix up shell commands for restricted permissions

Fixes: 132368462
Test: - Enabled app via device admin in secondary profile
        -> verified that permissions were whitelisted
      - Installed existing and new app using --restrictpermissions and
        not
	-> verified that permissions were whitelisted or not
      atest AppRestrictionsHelperTest
            RestrictedPermissionsTest
Change-Id: I9cd76c555b40663f2e25ad86e8a54991baae346c
Merged-In: I9787e63d8beb8f6b1ba2d15532d4c0f69dbdf863
2019-05-15 11:09:45 -07:00