Commit Graph

10687 Commits

Author SHA1 Message Date
TreeHugger Robot
1fe874c10f Merge "Remove a module-lib API" into sc-dev am: 20d6212568
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14049946

Change-Id: I69e6ab1e2dbd4cf779ae8d4acfa3b5b398c6ece2
2021-04-06 10:39:34 +00:00
TreeHugger Robot
20d6212568 Merge "Remove a module-lib API" into sc-dev 2021-04-06 10:09:50 +00:00
Aaron Huang
94b4c46e05 Merge "Expose Context#PAC_PROXY_SERVICE as module lib API" into sc-dev am: 6b759b7c04
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14097767

Change-Id: Ie387d1fab39e3a6ca778eb41bbf0bd56fda50ed4
2021-04-06 07:50:45 +00:00
Aaron Huang
6b759b7c04 Merge "Expose Context#PAC_PROXY_SERVICE as module lib API" into sc-dev 2021-04-06 07:26:01 +00:00
Aaron Huang
62718c2bbf Expose Context#PAC_PROXY_SERVICE as module lib API
Bug: 183938000
Test: make update-api
Change-Id: I4341e177b61df0311f0a3234f8814a0ae2cf9a1b
2021-04-06 11:50:21 +08:00
Todd Kennedy
98a0276231 Merge "Use the correct method to unparcel the property map" into sc-dev am: 25cca35d93
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13437708

Change-Id: Iee20786f6f22a923f0673a285827cc64b5a82d3c
2021-04-05 21:36:48 +00:00
Todd Kennedy
25cca35d93 Merge "Use the correct method to unparcel the property map" into sc-dev 2021-04-05 21:10:15 +00:00
Svetoslav Ganov
4e52f3ee88 Merge "Hookup renounced permissions" into sc-dev am: 6f7e03244d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14064838

Change-Id: I1fd9ab25722a66dab908a1e1bcbad82945026741
2021-04-05 18:42:57 +00:00
Todd Kennedy
a939273859 Use the correct method to unparcel the property map
We were writing the map as a generic Map, but reading it as an
ArrayMap. There's a subtle difference between the two methods.
The generic Map creator reads the map's key using readValue(),
which first reads an integer datatype and then the data. Whereas
the ArrayMap creator knows the keys are Strings and thus calls
readString() directly without consuming the datatype. This
throws the parcel reading logic out of whack.

Fixes: 176295431
Test: manual
Change-Id: I2d32488e3339e2d838e680be1ed9476b9e15cd69
2021-04-05 10:19:31 -07:00
Svet Ganov
48801b0bbd Hookup renounced permissions
Propagate renounced permissions from context params
to the context attribution source. Throw if one
tries to request at runtime a renounced permission.

Also make the AttributionSource take null for the
setters to ease usage, otherwise folks should always
check for null before calling a builder method.

Additionally, we allow apps that have UPDATE_APP_OPS_STATS
to register arbitrary trusted AttributionSource for
testing. Note that this permission allows abritrary app
op operations, thus we are not relaxing the security
model.

bug: 158792096

Test: atest CtsPermission5TestCases

Change-Id: I4330684bb8695fb998cf31e9363b94ad981ba2cc
2021-04-02 17:30:10 +00:00
TreeHugger Robot
90c9d6c2eb Merge "Revert "Avoid running RegisteredServicesCache tasks on main thread"" into sc-dev am: bfe78e7308
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14068906

Change-Id: If870c656cc611624460939dd442f52399a83b979
2021-04-02 02:14:55 +00:00
TreeHugger Robot
bfe78e7308 Merge "Revert "Avoid running RegisteredServicesCache tasks on main thread"" into sc-dev 2021-04-02 01:55:01 +00:00
Todd Kennedy
968b2db0f4 Revert "Avoid running RegisteredServicesCache tasks on main thread"
This reverts commit 8f35d505ba.

Reason for revert: possibly b/184141588

Change-Id: I8c6262ec8ce5561f8d398a81492b6f5217dba834
2021-04-01 21:08:54 +00:00
Chris Li
efc0472295 Merge "Update javadoc for FORCE_RESIZE_APP" into sc-dev am: 212351e022
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13979849

Change-Id: I4593806b9b4b9f5af2b26e2d19e01a55ef008297
2021-04-01 20:37:39 +00:00
Chris Li
212351e022 Merge "Update javadoc for FORCE_RESIZE_APP" into sc-dev 2021-04-01 20:28:56 +00:00
Tom Natan
3d722a0917 Merge "Mark force resize/non-resize changes as @Overridable" into sc-dev am: b539e01c8b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13996768

Change-Id: I7b1ebde3422193aea6b12a677e8f75175ac1afc8
2021-04-01 20:14:26 +00:00
Tom Natan
b539e01c8b Merge "Mark force resize/non-resize changes as @Overridable" into sc-dev 2021-04-01 19:54:26 +00:00
Ryan Mitchell
8bd9bf4f7e Merge "Use staging-public-group in framework SDK" into sc-dev am: d4f0220d29
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14021315

Change-Id: Id2b353a9d717daa7648f274d93198e7004a4a054
2021-04-01 18:47:36 +00:00
Ryan Mitchell
d4f0220d29 Merge "Use staging-public-group in framework SDK" into sc-dev 2021-04-01 18:36:33 +00:00
Ryan Mitchell
ca3b4f7633 Use staging-public-group in framework SDK
To make S finalization easier, this changes the framework SDK so that
apps linking against it will be able to continue working as expected
after the first phase of SDK finalization.

During the first phase of SDK finalization, the resource ids of
resources that have not been removed are finalized.
staging-public-group tags are converted to staging-public-group-final
tags in order to encode into the framework what the staged resource id
of a finalized resource was. When an app recompiles, it will use the
finalized resource id. Then after all apps recompile, phase 2 of
finalization begins, in which the staging-public-group-final tags are
removed so apps can no longer use the staged resource ids.

Apps that link against the SDK (provided they are using a recent
version of aapt) will encode references to staged resources as
TYPE_DYNAMIC_REFERENCE and TYPE_DYNAMIC_ATTRIBUTE. The values of R
fields for staged resources are defined out-of-line to prevent them
from being inlined into apps linking agsint the SDK. This allows the
resource ids to change during phase 1 of API finalization.

Bug: 183413192
Test: `aapt2 diff` and resource ids stayed the same
Test: `aapt2 dump` of framework-res.apk and observe staged resources
Change-Id: Ie2275c608297a5f63dde8b1cf795415112cbcc24
2021-03-31 23:04:57 -07:00
Jeff Sharkey
52e0776880 Merge "Continue populating legacy data structures." into sc-dev am: 3076233c8a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14019345

Change-Id: If27dd4de29471c8aec4874421fd33c1a8a519c7b
2021-03-31 19:51:29 +00:00
Jeff Sharkey
3076233c8a Merge "Continue populating legacy data structures." into sc-dev 2021-03-31 19:35:27 +00:00
Ryan Mitchell
5ceb628745 Merge "Remove ApkAssets access in finalizer" into sc-dev am: b1e62648bf
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14053246

Change-Id: Ice3cefe484022f41b2c596a0eb9d803df96021cd
2021-03-31 19:31:16 +00:00
Ryan Mitchell
b1e62648bf Merge "Remove ApkAssets access in finalizer" into sc-dev 2021-03-31 19:21:57 +00:00
Ryan Mitchell
9ff600f60a Remove ApkAssets access in finalizer
ResourcesProvider#finalize called ApkAssets#close. ApkAssets#close is
called during ApkAssets#finalize. If a ResourcesProvider and its
corresponding ApkAssets are finalized concurrently, there may be a
chance that the ApkAsset could be finalized first and then
ResourcesProvider calls ApkAssets#close on the object that has already
been finalized.

This may not fix the bug, but there is no reason to close the ApkAsset
during finalization of the ResourcesProvider.

Bug: 159041693
Test: none
Change-Id: I317ca982df2e11a18ccd6c95c74565dbac417bd6
2021-03-31 09:59:34 -07:00
Jeff Sharkey
2d9355bc44 Continue populating legacy data structures.
Previous work implemented getRequestedPermissions() by dynamically
constructing the legacy list of requested permissions, along with a
deprecation message to migrate to ParsedUsesPermission, but there
are too many callers to migrate at this stage of the release.

For now, to mitigate performance issues that arose, this change
builds a parallel list of requested permissions to avoid the
overhead of dynamically building the legacy list.

Bug: 183223056
Test: atest FrameworksServicesTests:PackageParserTest
Test: atest com.android.server.pm.parsing
Test: atest -p core/java/android/content/pm \
            core/java/com/android/internal/content \
            services/core/java/com/android/server/pm \
            services/tests/servicestests/src/com/android/server/pm
Change-Id: I538fbc12a9fd34f5ad5d63177ac5a2cb9a1ff3ce
2021-03-31 14:19:33 +00:00
JW Wang
9fcfccbcc0 Remove a module-lib API
Per b/150347230#comment18, remove the API since
RollbackManager will not be a module in S.

Bug: 150347230
Test: m
Change-Id: I1f356d0f5097da340986182314e47e3b6b6d9223
2021-03-31 18:17:05 +08:00
Paul Hu
695cf2c363 Merge "Add documents for isOem/Vendor/Product" am: 67b816def6 am: 1593239f22 am: 055f044724 am: dbb6403a1a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1657399

Change-Id: I068e0abd2c9a190e682b84eb4e628cefb8fb6060
2021-03-31 08:59:29 +00:00
Paul Hu
dbb6403a1a Merge "Add documents for isOem/Vendor/Product" am: 67b816def6 am: 1593239f22 am: 055f044724
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1657399

Change-Id: I919cb5686b00247e8b3f158b2a881fb21f87651b
2021-03-31 08:42:31 +00:00
TreeHugger Robot
c2b5754aae Merge "Refactor PackageParser (5/n)" 2021-03-31 07:08:48 +00:00
Svetoslav Ganov
cf7acf5a8e Merge "Fix NPE in PermsissionChecker" into sc-dev am: de698775ad
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14036202

Change-Id: Iab0278e58270a82db40b7489b465033a9027a2d0
2021-03-31 06:54:00 +00:00
Svet Ganov
623ff43bda Fix NPE in PermsissionChecker
Also added some logging for runtime permissions with no app op

bug: 184093962

Test: Setting up device with work account

Change-Id: I85787367b11d57ed1240fcf484ad7d2efa13d406
2021-03-31 03:27:51 +00:00
Chris Li
f37505f273 Update javadoc for FORCE_RESIZE_APP
As we allow non-resizable app in multi-windowing mode, the previous
comment can be confusing.

Bug: 176061101
Test: udpate comment
Change-Id: Iba51ca4158940bbda761fe3b7977d338ee1f3327
2021-03-30 19:33:55 -07:00
Svet Ganov
2434b922a4 Addressing comments from commit:8d2ed5 am: 7d058d62e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14037325

Change-Id: Icdd2a654130cd7d0d12c0bc30d4e654078a14b69
2021-03-31 02:18:32 +00:00
Svet Ganov
7d058d62e5 Addressing comments from commit:8d2ed5
bug:158792096
bug:180647319
bug:184051153
bug:184027531

Test:atest CtsPermissionTestCases
     atest CtsPermission2TestCases
     atest CtsPermission3TestCases
     atest CtsPermission4TestCases
     atest CtsPermission5TestCases
     atest CtsAppOpsTestCases
     atest CtsAppOps2TestCases
     atest CtsAlarmManagerTestCases

Change-Id: Id324ed0e2a653dface6ba273bba27e92bea14f99
2021-03-31 02:11:46 +00:00
Patrick Baumann
99b32b48b0 Merge "Addresses unresolved comments for silent updates" into sc-dev am: b50914c524
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13987640

Change-Id: Ib73c871dcfce0a97de279cfe446e4728ad4b6d7d
2021-03-30 20:10:46 +00:00
Patrick Baumann
b50914c524 Merge "Addresses unresolved comments for silent updates" into sc-dev 2021-03-30 19:58:28 +00:00
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
paulhu
63691d5ec8 Add documents for isOem/Vendor/Product
Bug: 182793544
Bug: 182285645
Test: m
Change-Id: I3b0353c38f74143e40540617fbaf2e247f152918
2021-03-30 11:36:50 +08: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
tomnatan
319253aa57 Mark force resize/non-resize changes as @Overridable
This is done so that these changes can be overridden in CTS tests and
later via the phonesky installer.

Bug: 183406442
Test: atest WmTests:SizeCompatTests
Change-Id: Idd09349dddbffb8a026d334d1687007b439b87af
2021-03-29 11:10:41 +00:00
Jackal Guo
71983cdf1b Refactor PackageParser (5/n)
The PackageParser is deprecated, but the inner class SigningDetails
is still used widely. To move away from PackageParser, we need to
have an alternatives of theis inner classes.

Bug: 174723245
Test: make
Change-Id: I6ad52b6fb7f4a846713e738f3e64d4642ebbc5ac
2021-03-29 13:02:42 +08: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