Commit Graph

7956 Commits

Author SHA1 Message Date
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
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
Ian Pedowitz
3bd719b534 Merge "Revert "Revert "Remove deprecated System APIs added in Q.""" into qt-dev 2019-05-15 16:28:54 +00:00
Svet Ganov
a320ff0763 Merge "Add an API for launching intent to view permission usage." into qt-dev
am: 13e4ff16c4

Change-Id: I28e47d8e7209785f6841631763b88610ecc9e830
2019-05-14 06:48:15 -07:00
TreeHugger Robot
13e4ff16c4 Merge "Add an API for launching intent to view permission usage." into qt-dev 2019-05-14 13:24:56 +00:00
Suprabh Shukla
169bed7b7a Revert "Revert "Remove deprecated System APIs added in Q.""
This reverts commit 79a19effee.

Bug: 129975435
Change-Id: I113c87f8c0b7ab225e4b99ef2462ae12e199b816
2019-05-13 21:04:39 +00:00
Varun Shah
e9b4b14804 Merge "Clarify ContentResolver docs." into qt-dev
am: 81f5007d5f

Change-Id: Id76a05f4782d23a699c971077d391199c48a6173
2019-05-13 13:54:43 -07:00
TreeHugger Robot
81f5007d5f Merge "Clarify ContentResolver docs." into qt-dev 2019-05-13 20:38:54 +00:00
Svet Ganov
810d48445b Add an API for launching intent to view permission usage.
Adding a new intent acttion for the permission controller to ask an
app to show its permission usage to help the user understand what
and why is being used. We are adding a permission to protect this
action to prevent apps trampolining into other apps when asked to
show their permission usge.

Test: compiles

bug:131760942

Change-Id: I5217d6319fd98d40c8879bdd7af5fe466bf9143e
2019-05-13 03:40:13 +00:00
Amith Yamasani
a873befec5 Merge "Fix the constant value for hidden BIND flag" into qt-dev
am: 22f9d7ea44

Change-Id: I0bc38f605d9396102f8d02be9f28b08149183a69
2019-05-10 16:13:49 -07:00
TreeHugger Robot
22f9d7ea44 Merge "Fix the constant value for hidden BIND flag" into qt-dev 2019-05-10 21:45:42 +00:00
Varun Shah
c4fdfa3a3f Clarify ContentResolver docs.
Explain under what conditions #query and #insert may return null.

Bug: 31043947
Test: n/a (docs update only)
Change-Id: I8880f80bfa2efff296a0a07c0bf28e9606d6db65
2019-05-10 14:10:08 -07:00
Amith Yamasani
0b3ae0eb81 Fix the constant value for hidden BIND flag
The hidden flags should use higher values so as to not
interleave with public flags.

Bug: 132438913
Test: CtsAppTestCases
Change-Id: Ic1dad21c2da5e5e60dc0401ee163f2188cc0f5dc
2019-05-10 10:51:15 -07:00
Shafik Nassar
d4e1307573 Merge "Fail to enable rollback if enable rollback times out" into qt-dev
am: b273078adf

Change-Id: I70d3646dcef80e0bc9ba1034a3103808f1079d99
2019-05-10 05:16:19 -07:00
Shafik Nassar
b273078adf Merge "Fail to enable rollback if enable rollback times out" into qt-dev 2019-05-10 10:23:53 +00:00
Hai Zhang
8cf15c3323 Merge "Remove hasIsolatedStorage() related logic from PackageParser." into qt-dev
am: 1fca828af3

Change-Id: Ia539e71c6636bf5ed05e83a10bc46c889745671f
2019-05-09 22:37:52 -07:00
TreeHugger Robot
1fca828af3 Merge "Remove hasIsolatedStorage() related logic from PackageParser." into qt-dev 2019-05-09 20:44:26 +00:00
Dario Freni
f1200c18f0 Merge "Allow persistent APKs updates using PM flags." into qt-dev
am: fca6e42895

Change-Id: Ifec9c6c328c4d61d327f5ee349c7fd4918c78e87
2019-05-09 12:47:08 -07:00
Dario Freni
fca6e42895 Merge "Allow persistent APKs updates using PM flags." into qt-dev 2019-05-09 18:49:13 +00:00
Hai Zhang
e7e00bdaca Remove hasIsolatedStorage() related logic from PackageParser.
The ACCESS_MEDIA_LOCATION and WRITE_OBB permissions will always be
available.

Bug: 112545973
Fixes: 132226317
Test: presubmit
Change-Id: Ie61eba427b48f347438522bc11cfa748ad5ba1f1
2019-05-09 11:29:50 -07:00
Hai Zhang
fcc7e14d24 Merge "Remove default app permission granting from DefaultPermissionGrantPolicy." into qt-dev
am: 8e1c4a0916

Change-Id: Ic7b066451cd77f4196309709980dec9de06896ad
2019-05-09 10:56:30 -07:00
Hai Zhang
8e1c4a0916 Merge "Remove default app permission granting from DefaultPermissionGrantPolicy." into qt-dev 2019-05-09 17:33:50 +00:00
shafik
4831ad7039 Fail to enable rollback if enable rollback times out
Make PackageManager send a ACTION_CANCEL_ENABLE_ROLLBACK intent to
RollbackManager. RollbackManager marks the relevant rollback as invalid.
Allow enable rollback to continue as usual, before making the rollback
available, RollbackManager checks whether it's valid. If it's not, the
rollback data is deleted.

Add a test case for expired rollback enabling attempt in RollbackTest.

Test: atest RollbackTest#testEnableRollbackTimeoutFailsRollback
Test: manual -
      * Set ENABLE_ROLLBACK_TIMEOUT_MILLIS to 1 ms using DeviceConfig
      * Install a mainline module with rollback enabled
      * adb shell dumpsys rollback
      * observe that no rollback was made available
Fixes: 131679409

Change-Id: Iaa4dbff002b820aff1fc3e1b985f129cf5ebe2e6
2019-05-09 12:38:04 +01:00
Svetoslav Ganov
a8a430670e Merge "Restricted permission whitelisted by default" into qt-dev
am: 650cb05202

Change-Id: Idcdec83acae25d83014b829e9d714f92462b3cac
2019-05-07 20:35:37 -07:00
Svetoslav Ganov
650cb05202 Merge "Restricted permission whitelisted by default" into qt-dev 2019-05-08 02:17:24 +00:00
Hai Zhang
c139927c0a Remove default app permission granting from DefaultPermissionGrantPolicy.
This change removes the permission granting for non-system dialer and
SMS apps in DefaultPermissionGrantPolicy. Permission granting to
system apps is left unchanged. Package manager is also made to query
role manager for the current default dialer instead of maintaining its
own storage.

Bug: 124452117
Bug: 129211673
Test: presubmit
Change-Id: I3c5c122802c3ecf15984a24c24c69a9e2f310bb7
2019-05-07 16:03:54 -07:00
Svet Ganov
83a3a4a9db Restricted permission whitelisted by default
To ensure existing installers would work without a change the
default state of installing a package is now that all restricted
permissions are whitelisted. If the installer specifies another
whitelist at install time, it determines the install state. In
addition to this we now enable the restricted permission checks
as a prebuilt installer is no longer required.

Test: atest CtsPermission2TestCases
Test: atest CtsPermissionTestCases
Test: atest CtsAppSecurityTestCases:android.appsecurity.cts.PermissionsHostTest

bug:132160728

Change-Id: I705e341faebe62fc2d88fd37ad8870b98e1b71b1
2019-05-07 12:25:39 -07:00
Tim Murray
9f0fd8c1ce Revert "Add optional reasons why permissions were denied"
am: d06c6d2932

Change-Id: I5f0d60ebdea3170f0c0769c8909e91b56b2848d9
2019-05-07 02:36:00 -07:00
Tim Murray
d06c6d2932 Revert "Add optional reasons why permissions were denied"
This reverts commit 3623f3219e.

Reason for revert: 40% startup perf regression

Test: revert
Bug 132129453
Exempt-From-Owner-Approval: critical revert

Change-Id: I19dc33e6a71c9254b4096154f4089c059fe408dd
2019-05-07 07:10:30 +00:00
Varun Shah
8a17c84a83 Merge "Add Locale#script to Configuration proto." into qt-dev
am: cc1159a166

Change-Id: I449f02fa3dcef56e4ff681f3919065bc94d2fddc
2019-05-06 12:12:44 -07:00
TreeHugger Robot
cc1159a166 Merge "Add Locale#script to Configuration proto." into qt-dev 2019-05-06 18:29:30 +00:00
Philip P. Moltmann
104cf9c862 Merge "Add optional reasons why permissions were denied" into qt-dev
am: dd82c4513b

Change-Id: Iba294f338743c86d126eb4c4d92eb4c3d1c31cf0
2019-05-05 23:40:52 -07:00
TreeHugger Robot
dd82c4513b Merge "Add optional reasons why permissions were denied" into qt-dev 2019-05-06 06:21:23 +00:00
Philip P. Moltmann
3623f3219e Add optional reasons why permissions were denied
Currently only for the ContextImpl.enforcePermission code paths and only
when 'secure debug_package_permission_check' is set.

This feature is disabled on user-builds.

Test: Enabled permission checking for my app and
      - checked runtime permision denial
      - permission denial because app is instant
Bug: 111075456
Change-Id: Ib85777db69ee490608e9dac32a3b97971c0ba215
2019-05-05 21:05:13 -07:00
Philip P. Moltmann
34541a6c06 Merge "Add new permission flags to @Flags int-def" into qt-dev
am: 94c556a2aa

Change-Id: I743a3d30814f32838c3e14a065956dada0881103
2019-05-03 20:11:21 -07:00
Richard Uhler
0153a1747c Merge "Ensure race between rollback and roll forward is properly handled" into qt-dev
am: 07a9e9f9f9

Change-Id: I19044b9fae99ef63956505937a0a5c95ba0f3dde
2019-05-03 12:18:43 -07:00
Philip P. Moltmann
55ecaac312 Add new permission flags to @Flags int-def
also expose all flags for being tested.

Test: built
Bug: 131188279
Change-Id: I2874298d87a76ee2bc95f18346d8ae597a3152ad
2019-05-03 08:33:27 -07:00
Svet Ganov
3367c62bc2 Merge "Address some comments for the soft restriction CL" into qt-dev
am: 2cf92e602a

Change-Id: I4fc612636cf9168166ccccb85086e5bab171ad54
2019-05-03 05:25:06 -07:00
Richard Uhler
07a9e9f9f9 Merge "Ensure race between rollback and roll forward is properly handled" into qt-dev 2019-05-03 08:09:17 +00:00
Ivan Chiang
2f18936449 Merge "Fix can't create thumbnail and wrong orientation issue" into qt-dev
am: b037feb130

Change-Id: Ie794dc44746df5a023a0af1832a0dfc6a904ec07
2019-05-02 16:14:14 -07:00
Ian Pedowitz
81320d1253 Merge "Revert "RESTRICT AUTOMERGE Remove deprecated System APIs added in Q."" into qt-dev
am: 8b3b7771c1

Change-Id: Id0a6dbf04d575a644017c69c15a85189d6e13ff2
2019-05-02 15:11:28 -07:00
Ian Pedowitz
a266df5220 Merge "RESTRICT AUTOMERGE Remove deprecated System APIs added in Q." into qt-dev
am: 3f38719b74

Change-Id: Iccd685618d79b3357944fc5278e072448a58376d
2019-05-02 14:28:52 -07:00