61 Commits

Author SHA1 Message Date
Bill Yi
d7cb2dd4c7 Import translations. DO NOT MERGE
Change-Id: I75d703f684d3f16328d856034db197457c6b0cd0
Auto-generated-cl: translation import
2020-02-14 01:28:06 -08:00
Svetoslav Ganov
5700611461 Merge "Whitelist all restricted permissions on sideload" into qt-dev
am: 04cb6d1ccc

Change-Id: I13556665d99450757a999d35e40d830bcbe2cf15
2019-06-12 09:28:04 -07:00
Svet Ganov
38493bd689 Whitelist all restricted permissions on sideload
Test: atest android.permission2.cts.RestrictedPermissionsTest#onSideLoadAllRestrictedPermissionsWhitelisted

Bug:134500512

Change-Id: Ia5693f6f39b30e04ad6f96f2c1f5ff7665125e52
2019-06-11 23:41:09 -07:00
Bill Yi
aba8931a53 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I69fa0a0ac28702c5c076f1233a0aa8be2d350d1e
2019-05-21 16:04:46 -07:00
Philip P. Moltmann
1b1f7a3ded Merge "Make package installer tests post submit" into qt-dev
am: fc892fe742

Change-Id: I26756f5235d715992c399a465b3274a65d5fb462
2019-04-30 03:56:12 -07:00
Philip P. Moltmann
dbcebfe14f Make package installer tests post submit
As they are UI-tests and hence to flaky for pre-submit.

Fixes: 131353722
Test: n/a
Change-Id: I7bea06bbe16717406ccd0676fb83396066959a92
2019-04-25 16:52:44 -07:00
Philip P. Moltmann
a17057536d Merge "Fix re-installation via package uri-s" into qt-dev
am: e062b5cce4

Change-Id: Iebb2e8fd5951bb9bc1145efb04603cafdd47881d
2019-04-13 07:29:58 -07:00
Philip P. Moltmann
8fc7873fc7 Merge changes Iabebe9cf,I5afbd60f into qt-dev
am: 47be500039

Change-Id: I4edab24a5e804815320f121cd473e155c991cab2
2019-04-12 13:31:50 -07:00
Philip P. Moltmann
26ac855b3c Fix re-installation via package uri-s
It is allowed to install a package via a "package" URI. This means that
if a package with the same name is already installed (for any user), please
(re-)install it for the current user.

This was broken as mPackageURI.getPath() does not work for such package
URIs. This call is only needed when we need to show UI, but for package
URIs we don't even new UI, hence we can move it for the "content" path.

Test: atest CtsPackageInstallTestCases
Bug: 117768093
Change-Id: I58d3abde22ae0a77aabe5068680fd0148d799776
2019-04-12 12:58:14 -07:00
Philip P. Moltmann
cd6dbf7e0b Automatically run Package Installer tests
Test: atest --test-mapping frameworks/base/packages/PackageInstaller
Bug: 123212933
Change-Id: Iabebe9cf91fcdacca2bc6d566a1072f1e84eb97f
2019-04-12 10:11:02 -07:00
Philip P. Moltmann
254c3e4bd6 Remove support to install apps from a file
Test: atest CtsPackageInstallTestCases
Bug: 123212933
Change-Id: I5afbd60f2c8db68858289edec0302b782677ded5
2019-04-12 10:10:55 -07:00
Suprabh Shukla
8849216021 Merge "OP_REQUEST_INSTALL_PACKAGES denied by default" into qt-dev
am: aacec3d111

Change-Id: I7e7f922a98bef65f3fd889e2389bccee93f45fb2
2019-04-09 18:37:49 -07:00
Suprabh Shukla
acc75528ff OP_REQUEST_INSTALL_PACKAGES denied by default
Some system apps may download unknown content and the user should
be explicitly asked whether they trust these files. System apps should
explicitly use the extra NOT_UNKNOWN_SOURCE to bypass this check.

Test: Builds, boots, existing tests pass:
atest CtsPackageInstallTestCases

Locally verified they pass if CtsPackageInstallTestCases.apk was signed by
the platform cert.

Bug: 123700348
Change-Id: I2578251906f6656b83464d1c4fc4db99165841c9
2019-04-09 21:00:10 +00:00
TreeHugger Robot
7581837e06 Merge "Import translations. DO NOT MERGE" into qt-dev 2019-04-08 18:26:46 +00:00
Svet Ganov
d8eb8b2690 Restricted permission mechanism - framework
This change adds a mechanism for restricting permissions (only runtime
for now), so that an app cannot hold the permission if it is not white
listed. The whitelisting can happen at install or at any later point.

There are three whitelists: system: OS managed with default grants
and role holders being on it; upgrade: only OS puts on this list
apps when upgrading from a pre to post restriction permission database
version and OS and installer on record can remove; installer: only
the installer on record can add and remove (and the system of course).

Added a permission policy service that sits on top of permissions
and app ops and is responsible to sync between permissions and app
ops when there is an interdependecy in any direction.

Added versioning to the runtime permissions database to allow operations
that need to be done once on upgrade such as adding all permissions held
by apps pre upgrade to the upgrade whitelist if the new permisison version
inctroduces a new restricted permission. The upgrade logic is in the
permission controller and we will eventually put the default grants there.

NOTE: This change is reacting to a VP feedback for how we would handle
SMS/CallLog restriction as we pivoted from role based approach to roles
for things the user would understand plus whitelist for everything else.
This would also help us roll out softly the storage permisison as there
is too much churm coming from developer feedback.

Exempt-From-Owner-Approval: trivial change due to APi adjustment

Test: atest CtsAppSecurityHostTestCases:android.appsecurity.cts.PermissionsHostTest
Test: atest CtsPermissionTestCases
Test: atest CtsPermission2TestCases
Test: atest RoleManagerTestCases

bug:124769181

Change-Id: Ic48e3c728387ecf02f89d517ba1fe785ab9c75fd
2019-04-07 22:39:54 -07:00
Bill Yi
aefa3bd0d9 Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: I0176cd37f38f90705e335409fc3f02b3ff88bc63
2019-04-07 21:06:55 -07:00
Jeff Sharkey
57f6dbc578 Remove support for file:// items.
We've messaged since the N release that file:// Uris are going away,
and we've been crashing those apps via StrictMode for many years.

The broader storage changes in Q mean it's finally a good time to say
we only handle content:// items.

Bug: 123212933
Test: none
Change-Id: I69a791468c4bcf45b0022cf52264e78f94bfdeae
2019-03-31 10:40:22 -06:00
TreeHugger Robot
5659644ebf Merge "Show correct restriction enforcement info for unknown apps installs." 2019-03-29 15:22:18 +00:00
Jaewoong Jung
edfa8e90a1 Convert Android.mk to Android.bp
Bug: 122332340
Test: full build & flash on a Pixel + manual inspection + TreeHugger
Change-Id: I80688006411dcf32f8f329556044d25ad12af1ac
2019-03-28 20:57:51 +00:00
Bill Yi
5b64af19ee Import translations. DO NOT MERGE
Change-Id: Ibb415cc9cf3f1f0f4750e783ef0af46cb2a3a018
Auto-generated-cl: translation import
2019-03-23 09:28:17 -07:00
Irina Dumitrescu
edc3e6a7e5 Show correct restriction enforcement info for unknown apps installs.
Obtain the correct admin and dialog information when a restriction prevents the
user from installing apps from unknown sources.

Bug: 118881180
Test: atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: I8112aaca64f85d421ee1029edc5c47909e31f12f
2019-03-22 17:22:57 +00:00
TreeHugger Robot
db053d1949 Merge "Revert "Checkbox for removing contributes files"" 2019-03-22 01:15:20 +00:00
Evan Severson
95358d8b7b Revert "Checkbox for removing contributes files"
This reverts commit 38ea50c63e8a031a6430d26b1f5b561402007243.

Revert and clean up merge conflicts. The checkbox which asks
to remove app data is still here

Fixes:112002130
Test: Build and check that the correct box is gone
      atest CtsPackageUninstallTestCases

Change-Id: I47d8632d2fca360c02151ad54a4b927a5c2801f1
2019-03-20 17:42:57 -07:00
Evan Severson
eb89202e2d Hide the title of the uninstall alert dialog
Fixes: 126376004
Test: Observation
Change-Id: Id76477b3dee11613dd6d39d48a322746f6cd5a97
2019-03-19 16:34:09 -07:00
Bill Yi
8e8a9b7222 Import translations. DO NOT MERGE
Change-Id: I1403e72dca3bae01052d55eca57f4af4194cb87a
Auto-generated-cl: translation import
2019-02-02 12:02:52 -08:00
Bill Yi
45e4113745 Import translations. DO NOT MERGE
Change-Id: Id1da55371ad5dd71198f714ef7e70481a8a13351
Auto-generated-cl: translation import
2019-01-12 00:11:27 -08:00
Bill Yi
79e550e596 Import translations. DO NOT MERGE
Change-Id: I283329c66908440e4ae11fbb1ef2f2207c818a27
Auto-generated-cl: translation import
2018-12-25 04:32:41 -08:00
Philip P. Moltmann
49499f999d Uninstall: Clarify what the keep_data checkbox is for
Test: none
Bug: 121212015
Change-Id: I2a2dca82f2a4112b0b51a4a5ce5bd2829855accd
2018-12-19 10:55:31 -08:00
Philip P. Moltmann
ae4a4b987b fragileUserData-apps might keep data on uninstall
If an app declares that is has flagile user data, all the user to choose
to keep the app-data on uninstall.

Test: Unistalled apps that set the new flag and app that did not.
      Verified that the KEEP_DATA flag was set when checkbox was
      clicked.
Change-Id: I032fb21854352bbc175934ae5eb68a1430b1d403
Fixes: 117578306
2018-12-12 13:37:44 -08:00
TreeHugger Robot
05b3b033be Merge "Import translations. DO NOT MERGE" 2018-12-12 01:23:16 +00:00
Philip P. Moltmann
38ea50c63e Checkbox for removing contributes files
Apps might have contributed files. During uninstall the files are
usually left on the system. To avoid filling up the storage we allow the
user to delete the files during uninstall.

Bug: 112002130
Test: Uninstalled an app that contributed files
Change-Id: I7e71ed524055bdda91ce9e66f995540363ceb229
2018-12-11 21:06:03 +00:00
Bill Yi
a32b8c9b09 Import translations. DO NOT MERGE
Change-Id: Id368c551541a91e481b8a7d3c3fbdd53a26113b3
Auto-generated-cl: translation import
2018-12-11 01:19:10 -08:00
Bill Yi
7a5d70cc17 Import translations. DO NOT MERGE
Change-Id: I20f925fd3865cd7865a3756552a15a4da559721a
Auto-generated-cl: translation import
2018-12-06 01:45:51 -08:00
Philip P. Moltmann
d26ef690a4 Prepare PackageInstaller to be signed with google cert
I am not sure if .bp files already allow creating google-signed variations, hence go back to .mk file.

Test: Built + Booted on taimen-eng
Change-Id: I4b413d18eec07a1f84050693a7b8a97b51fa3270
2018-11-19 16:35:58 +00:00
Bill Yi
384180f3d8 Import translations. DO NOT MERGE
Change-Id: I256979e07626fc574837b30af030a0fb34841554
Auto-generated-cl: translation import
2018-11-12 05:29:05 -08:00
Ricky Wai
13b0abe1bc Add feature flag for "show hidden launcher icon apps"
and "install app notification"

Bug: 111214100
Test: CTS test will be submitted with flag enabling commit
Change-Id: I604d75dc48e09039619f571d418a700106cbdd5d
2018-11-07 11:28:49 +00:00
Bill Yi
212995a1b0 Import translations. DO NOT MERGE
Change-Id: I0642ea9b4ed22a2ecad7c4e73fb99e0a238d0d92
Auto-generated-cl: translation import
2018-10-31 09:29:20 -07:00
Hyunyoung Song
6fa61bbb04 Fix PackageInstaller icon resizing issue
Bug: 114719061
Test: builds, installed the app and verified visually

TL;DR;; when main icon is rendered, there's no guarantee that the icon
will be rendered in 48dp view. For the inset to be applied proportionally,
percentage should be used instead of static dp unit.

Change-Id: Iacfcf7a5a2aa430c70c5db7c803267cf7eb5ad45
2018-10-25 22:34:44 -07:00
TreeHugger Robot
94d3f53237 Merge "Trust session id only if started with ACTION_CONFIRM_INSTALL" 2018-10-16 19:46:21 +00:00
Suprabh Shukla
21b1310297 Trust session id only if started with ACTION_CONFIRM_INSTALL
InstallStart was reading sessionInfo whenever the starting intent had
the extra EXTRA_SESSION_ID. This could happen even if an external app
inserted a valid session id into its own REQUEST_INSTALL_PACKAGE intent.
This allows apps to potentially spoof the calling package.

Test: Existing tests pass:
atest GtsPackageInstallTestCases GtsNoPermissionTestCases \
GtsNoPermissionTestCases25

Bug: 112031362
Change-Id: Icdab1deeaf6b0afe7a61709cd87305336c467e33
2018-10-16 19:46:01 +00:00
Philip P. Moltmann
3e0f1b46e4 Merge "Rename system-api wm flags to SYSTEM_..." 2018-10-15 16:28:39 +00:00
TreeHugger Robot
803a52498b Merge "Show app installed notification from PackageInstaller" 2018-10-10 15:41:38 +00:00
Philip P. Moltmann
66ce2386a3 Rename system-api wm flags to SYSTEM_...
Also add a special API to set them. Internally they are still just
regular private flags

Test: Built
Bug: 116798569
Change-Id: I687b751fa18c7fbcc9bf95aa44d94d8a5614a88f
2018-10-09 14:08:22 -07:00
Philip P. Moltmann
ae15e11ddd Merge "Deprecate Intent based installation/uninstallation" 2018-10-09 16:15:50 +00:00
Philip P. Moltmann
20dd431f20 Do not allow to revert setForceSafeLabel
Test: Built
Bug: 116798569
Change-Id: I3f26d4466c84d3decb1c4962fb45e900ba35f68e
2018-10-08 16:56:49 -07:00
Philip P. Moltmann
fe460100e7 Deprecate Intent based installation/uninstallation
The android.content.pm.PackageInstaller install + uninstall APIs are
fully functional. No need to try to keep the intent based APIs
feature compatible.

In the future we will be able to restrict app targeting old targetSDK
levels from using the intent-based API. Even further in the future we
can radically simplify the package installer app.

Fixes: 116616700
Test: Built
Change-Id: Ia225d70fbee3fa31a3c1de388dcb05ff1063dccd
2018-10-08 09:03:21 -07:00
Bill Yi
9811f7f98f Import translations. DO NOT MERGE
Change-Id: I6dc612c6234521fc88f3776c01af3b24ad235768
Auto-generated-cl: translation import
2018-10-07 09:31:24 -07:00
TreeHugger Robot
e1251df8eb Merge "Device-wide unknown sources block option for DPC." 2018-10-02 13:07:25 +00:00
Irina Dumitrescu
4638edd79f Device-wide unknown sources block option for DPC.
This adds a new framework user restriction that can be used by the DPC
to block installs from unknown sources on all profiles of a device.

Test: Manual test, disallowing installs in TestDPC disables installing
unknown sources apps.
Bug: 111335021
Change-Id: Ib9fb672c5e5dea2ac63bf8cbd1b04484b12b4056
2018-10-01 21:45:00 +01: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