Commit Graph

10646 Commits

Author SHA1 Message Date
Guojing Yuan
0909b8cb66 Merge "Add Intent.ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD for privacy hub" into sc-dev am: bb12e2257d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13975861

Change-Id: Ib2f1c16b87548148daa0fb5a1be409742d00c358
2021-03-30 17:10:48 +00:00
Guojing Yuan
bb12e2257d Merge "Add Intent.ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD for privacy hub" into sc-dev 2021-03-30 16:55:09 +00:00
Svetoslav Ganov
77591d9942 Merge "Runtime permission attribution improvements" into sc-dev am: a6c3d6ad39
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13692058

Change-Id: Ibad155ee212f6e71800e288a44bbed6012d32838
2021-03-29 21:05:00 +00:00
Svet Ganov
8d2ed50604 Runtime permission attribution improvements
When an app is proxying access to runtime permission protected
data it needs to check whether the calling app has a permission
to the data it is about to proxy which leaves a trace in app ops
that the requesting app perofmed a data access. However, then the
app doing the work needs to get the protected data itself from the
OS which access gets attributed only to itself. As a result there
are two data accesses in app ops where only the first one is a
proxy one that app A got access to Foo through app B - that is the
one we want to show in the permission tracking UIs - and one
for the data access - that is the one we would want to blame on
the calling app, and in fact, these two accesses should be one -
that app A accessed Foo though B. This limitation requires fragile
one off workarounds where both accesses use the same attribution
tag and sys UI has hardcoded rules to dedupe. Since this is not
documented we cannot expect that the ecosystem would reliably
do this workaround in apps that that the workaround in the OS
would be respected by every OEM.

This change adds a mechaism to resolve this issue. It allows for
an app to create an attribution context for another app and then
any private data access thorugh this context would result in a
single app op blame that A accessed Foo though B, i.e. we no longer
have double accounting. Also this can be nested through apps, e.g.
app A asks app B which asks app C for contacts. In this case app
B creates an attribution context for app A and calls into app C
which creates an attribution context for app B. When app C gets
contacts the entire attribution chain would get a porper, single
blame: that C accessed the data, that B got the data from C, and
that A got the data form B. Furthermore, this mechanism ensures
that apps cannot forget to check permissions for the caller
before proxying private data. In our example B and C don't need
to check the permisisons for A and B, respectively, since the
permisisons for the entire attribution chain are checked before
data delivery. Attribution chains are not forgeable preventing
a bad actor to create an arbitrary one - each attribution is
created by the app it refers to and points to a chain of
attributions created by their corresponding apps.

This change also fixes a bug where all content provider accesses
were double counted in app ops due to double noting. While at
this it also fixes that apps can now access their own last ops.
There was a bug where one could not pass null getting the attributed
ops from a historical package ops while this is a valid use case
since if there is no attribution everything is mapped to the null
tag. There were some app op APIs not being piped thorough the app
ops delegate and by extension through the app ops policy. Also
now that we have nice way to express the permission chain in a
call we no longer need the special casing in activity manager to
handle content provider accesses through the OS. Fixed a bug
where we don't properly handle the android.os.shell calls with
an invlaid tag which was failing while the shell can do any tag.

Finally, to ensure the mechanims is validated and works end-to-end
we are adding support for a voice recognizer to blame the client
app for the mic access. The recognition service can create a blaming
context when opening the mic and if the mic is open, which would
do all permission checks, we would not do so again. Since changes
to PermissionChercker for handling attribution sources were made
the CL also hooks up renounced permissoins in the request permission
flow and in the permission checks.

bug:158792096
bug:180647319

Test:atest CtsPermissionsTestCases
     atest CtsPermissions2TestCases
     atest CtsPermissions3TestCases
     atest CtsPermissions4TestCases
     atest CtsPermissions5TestCases
     atest CtsAppOpsTestCases
     atest CtsAppOps2TestCases

Change-Id: Ib04585515d3dc3956966005ae9d94955b2f3ee08
2021-03-29 16:49:33 +00:00
Lucas Dupin
ad0e94debe Merge "Add luma capabilities to ColorStateList" into sc-dev am: 10c1b4f3f9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13986547

Change-Id: I1f2ac8ffd6406c42dcc207558d7fb144598ee561
2021-03-29 15:52:39 +00:00
Lucas Dupin
10c1b4f3f9 Merge "Add luma capabilities to ColorStateList" into sc-dev 2021-03-29 15:47:05 +00:00
Jackal Guo
20a3ee74d0 Merge "Migrate the usage of sUseRoundIcon to PackageParserUtils" into sc-dev am: a62a68dba7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13975111

Change-Id: I7cb00d2e4304a06415c88a226e86ad1fb4d7e3a0
2021-03-26 08:22:31 +00:00
Sudheer Shanka
af627231b3 Merge "Rename Context.BIND_ALLOW_NETWORK_ACCESS." into sc-dev am: ef688bbdf5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13993358

Change-Id: I49db94dcc037221e0a4e529ec2a733d90310fcfb
2021-03-26 08:22:05 +00:00
Jackal Guo
a62a68dba7 Merge "Migrate the usage of sUseRoundIcon to PackageParserUtils" into sc-dev 2021-03-26 08:01:07 +00:00
Sudheer Shanka
ef688bbdf5 Merge "Rename Context.BIND_ALLOW_NETWORK_ACCESS." into sc-dev 2021-03-26 07:56:19 +00:00
Jackal Guo
755cecda8d Migrate the usage of sUseRoundIcon to PackageParserUtils
PackageParser is deprecated, but system still references its
sUseRoundIcon. We should move that to PackageParserUtils.

Bug: 180603085
Test: manually check if the icon has the white border
Change-Id: Idb2ccc2be9006237244aabfe9c45814e9c7c27b5
2021-03-26 08:31:02 +08:00
Alex Buynytskyy
e0a7ab9b69 Merge "Making the rest of Streaming installation API public." into sc-dev am: f8d0c5584e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13991021

Change-Id: I44c8f524796805e4572fafa56a3d178b8a39c83c
2021-03-26 00:21:37 +00:00
Alex Buynytskyy
f8d0c5584e Merge "Making the rest of Streaming installation API public." into sc-dev 2021-03-25 23:58:06 +00:00
Sudheer Shanka
53cea237e4 Rename Context.BIND_ALLOW_NETWORK_ACCESS.
Bug: 177641226
Test: treehugger
Change-Id: I12796e19e3d18450f332a410ec04bc1486727709
2021-03-25 15:02:39 -07:00
Alex Buynytskyy
8e3eeb507a Making the rest of Streaming installation API public.
Something was left behind when we opened the installation API.

Bug: 152310230
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: Ia2d4c3f3e97c8432fcca094d6e0f4e97dcc048d4
2021-03-25 14:52:33 -07:00
David Zeuthen
cacc81b903 Merge "PackageManager: Add FEATURE_HARDWARE_KEYSTORE, modify FEATURE_STRONGBOX_KEYSTORE." am: b0a08c82bc am: a911b5da56 am: d91def89c0 am: 0b2f572eda
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626660

Change-Id: I38132e54c3ede5dc72303863ca822d3148340104
2021-03-25 20:11:36 +00:00
Patrick Baumann
47c338bf1c Merge "Exposes way to bypass user action on update" into sc-dev 2021-03-25 20:00:53 +00:00
Lucas Dupin
7a597bb5a0 Add luma capabilities to ColorStateList
It's now possible to define an lStar attribute.
This attribute will modify the base color in a way that its chroma will
be conserved, but perceptive luminance will change.

Fixes: 183609373
Test: atest ColorStateListTest
Change-Id: I341a0a532bd9c030e8f52185bacda0db55486216
2021-03-25 12:55:51 -07:00
David Zeuthen
0b2f572eda Merge "PackageManager: Add FEATURE_HARDWARE_KEYSTORE, modify FEATURE_STRONGBOX_KEYSTORE." am: b0a08c82bc am: a911b5da56 am: d91def89c0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1626660

Change-Id: I15a899ef7ddb405a953203e38337d2e7674f4429
2021-03-25 19:45:13 +00:00
TreeHugger Robot
98fc7cade1 Merge "Include LauncherApps#getShortcutIntents" into sc-dev am: cf4b4e4d3c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13960145

Change-Id: I5a6a01400616c6990c93605b2938047e1ede18aa
2021-03-25 17:44:28 +00:00
TreeHugger Robot
cf4b4e4d3c Merge "Include LauncherApps#getShortcutIntents" into sc-dev 2021-03-25 17:28:26 +00:00
Guojing Yuan
6f95b3626f Add Intent.ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD for privacy hub
BUG: 176902658

Test: N/A
Change-Id: I81cb4c186b2e283e878bc73d4a27af85408ce5eb
2021-03-25 17:14:12 +00:00
Patrick Baumann
43972a262c Merge "Exposes way to bypass user action on update" 2021-03-25 14:29:42 +00:00
David Zeuthen
d9cbeba041 PackageManager: Add FEATURE_HARDWARE_KEYSTORE, modify FEATURE_STRONGBOX_KEYSTORE.
These feature flags will hold the KeyMint version for the default and
StrongBox HALs. They can be used by apps to convey that they'll only
work on devices which have a recent enough version of KeyMint.

For example, if an application requires ECDH to be implemented in
Secure Hardware it can convey this requirement by indicated that it
needs FEATURE_HARDWARE_KEYSTORE >= 100. Or if it needs this in the
StrongBox it can use FEATURE_STRONGBOX_KEYSTORE >= 100. As with other
feature flags, this can be used to only show the app on devices which
satisfy such requirements.

Test: Compiles
Bug: 160616951
Change-Id: I582e50fba92de0d598d7e86fcc3b1b2b4a91b103
2021-03-25 09:38:42 -04:00
TreeHugger Robot
36d4ce393f Merge "Make TypedArray implement AutoCloseable" into sc-dev am: 230fac1c9c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13985052

Change-Id: Idd83ba3c157be0dc5b0d1117ff9ab6973f35de23
2021-03-25 07:27:56 +00:00
TreeHugger Robot
230fac1c9c Merge "Make TypedArray implement AutoCloseable" into sc-dev 2021-03-25 07:10:52 +00:00
Pinyao Ting
4750fe5036 Include LauncherApps#getShortcutIntents
Add new api to retrieve pending intents from specified shortcut.

Bug: 151359749
CTS-Coverage-Bug: 13975407
Test: atest ShortcutManagerTest12
Change-Id: I6c413615d1392805f601561550dcb85bfe242b37
2021-03-25 06:30:42 +00:00
Alexander Dorokhine
b477d23181 Merge "Remove deprecated methods from AppSearch APIs." into sc-dev am: 30ccdcd621
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13880672

Change-Id: Ic824bd043b7814898dd5e25048a67d640448ee73
2021-03-25 05:49:33 +00:00
Alexander Dorokhine
30ccdcd621 Merge "Remove deprecated methods from AppSearch APIs." into sc-dev 2021-03-25 05:34:38 +00:00
Alexander Dorokhine
65c4fd881e Remove deprecated methods from AppSearch APIs.
These methods were only available for dogfooder transition.
None of these methods shipped in a stable SDK.

Bug: 181887768
Bug: 183395357
Test: Build, presubmit
Change-Id: I74feebd2721208c97475df9b74f734a17a41d5e2
2021-03-24 22:14:38 -07:00
Evgenii Stepanov
905454283b Merge "Cleanup nativeHeapZeroInit and memtagMode implementation." into sc-dev am: 9c1d00870e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13830729

Change-Id: I519a2f1c7195472ec195d33ce252e3ac5413939b
2021-03-25 05:09:06 +00:00
Evgenii Stepanov
9c1d00870e Merge "Cleanup nativeHeapZeroInit and memtagMode implementation." into sc-dev 2021-03-25 05:02:08 +00:00
TreeHugger Robot
1e605a6f67 Merge "Accept strings for more parameters in Suspend Dialog" into sc-dev am: aeb2ba8da6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13988109

Change-Id: Ieb2e905795764367f1495bb87dab626409308c14
2021-03-25 04:47:56 +00:00
TreeHugger Robot
aeb2ba8da6 Merge "Accept strings for more parameters in Suspend Dialog" into sc-dev 2021-03-25 04:38:58 +00:00
Jeff DeCew
d4d3b821be Make TypedArray implement AutoCloseable
Fixes: 170316676
Test: atest TypedArrayTest
Change-Id: If3af1c1402156e43f29b166bfcaabc16ee0c0330
2021-03-24 19:51:47 -04:00
Evgenii Stepanov
0aa606cc5a Cleanup nativeHeapZeroInit and memtagMode implementation.
* Rename nativeHeapZeroInit to nativeHeapZeroInitialized.
* nativeHeapZeroInitialized is a tri-state, so make it an @IntDef.
* Add documentation to some accessor methods, and missing @type
  annotations.
* Add attrs_manifest.xml document for the new attributes.

Bug: 182165383
Bug: 182370211
Test: com.android.cts.tagging
Change-Id: Iad46a1da9bc040baf4c438afbc5fd8cd128e99f1
2021-03-24 16:16:56 -07:00
Suprabh Shukla
241955129a Accept strings for more parameters in Suspend Dialog
Allowing passing raw texts offers more flexibility to callers in some
cases. However, in this case, the callers must handle locale changes on
their own.

Test: atest FrameworksServicesTests:SuspendDialogInfoTest
atest FrameworksServicesTests:PackageManagerSettingsTest
atest CtsSuspendAppsTestCases:DialogTests

Fixes: 170653551
Bug: 170653208
Change-Id: Iaa51e1d3f260ad553db8b33fddc935c478a40c9c
2021-03-24 16:14:47 -07:00
TreeHugger Robot
d4de953dea Merge "Disallow domain user selector from querying autoVerify domains" into sc-dev am: ddd5bd8318
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13975048

Change-Id: Ic8590cd16fb156c60ba371b12611f53316b02985
2021-03-24 21:18:52 +00:00
TreeHugger Robot
ddd5bd8318 Merge "Disallow domain user selector from querying autoVerify domains" into sc-dev 2021-03-24 21:15:41 +00:00
Philip Junker
3d123a82e8 Define private manifest flag for home sound exception and add permission am: 0b6eaf12b1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13699631

Change-Id: I4015710fb9e2c8e8d50513fc5a78dbb7b3218eeb
2021-03-24 16:24:25 +00:00
Philip Junker
2e998fc497 Merge changes from topic "home_sound_exceptions" into sc-dev
* changes:
  Check if package matches home package and allow exceptions.
  Define private manifest flag for home sound exception and add permission
2021-03-24 16:11:32 +00:00
Patrick Baumann
697c419d65 Exposes way to bypass user action on update
Bug: 182487678
Test: atest CtsSilentUpdateHostTestCases
Change-Id: Idb56472544da378c95346329ddc2664400db37a6
2021-03-24 09:02:45 -07:00
Yuncheol Heo
7e6698ef53 Merge "Add Theme.setNewResourcesImpl() method." into sc-dev am: fef662cdcc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13926147

Change-Id: Id9c4ba9a2816f63827046df5327dec257e3a2d88
2021-03-24 15:46:10 +00:00
Yuncheol Heo
fef662cdcc Merge "Add Theme.setNewResourcesImpl() method." into sc-dev 2021-03-24 15:36:17 +00:00
Charles Chen
6287cc3c3b Merge "Add OWNERS for ComponentCallbacksController" am: 4eca6d0c5c am: 06b102a70d am: 0d35481d52 am: b26733e23a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1642179

Change-Id: I9690e5ebaa34a83c39f06f9d488fb05d3936f14c
2021-03-24 12:09:27 +00:00
Charles Chen
b26733e23a Merge "Add OWNERS for ComponentCallbacksController" am: 4eca6d0c5c am: 06b102a70d am: 0d35481d52
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1642179

Change-Id: Ie69644a729f2f535366f5e9997bff2c9d58ec782
2021-03-24 11:55:37 +00:00
Philip Junker
0b6eaf12b1 Define private manifest flag for home sound exception and add permission
Test: manual
Test: atest HomeSoundEffectControllerTest
Bug: 167946828
Bug: 157407957
Change-Id: If8278013a7b558e837f3e831fabe8ca3a737aa6e
2021-03-24 11:38:00 +01:00
Charles Chen
4eca6d0c5c Merge "Add OWNERS for ComponentCallbacksController" 2021-03-24 10:05:52 +00:00
Charles Chen
cb0ca7fb0e Merge "Move WindowContext module to window package" into sc-dev am: 1e76f995bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13435723

Change-Id: Ibbd935039dd34ab0b507f6fcf59d572d3eafd2d7
2021-03-24 08:26:42 +00:00
Charles Chen
1e76f995bf Merge "Move WindowContext module to window package" into sc-dev 2021-03-24 07:45:41 +00:00