Commit Graph

11051 Commits

Author SHA1 Message Date
Varun Shah
2f003333d1 Update documentation for Intent#CATEGORY_DESK_DOCK.
Fixes: 190703805
Test: m
Change-Id: I8694597e93d791c8e6bfb8de5ced45ee8d79da78
2021-06-10 16:33:13 +00:00
Ryan Mitchell
1c66621efc Merge changes I2710cfea,I03fb31ee,Iec512b31 into sc-dev am: 015bca79f4 am: ae050676af
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14905166

Change-Id: I236b201f3432f18360ab63ff52ed6440b3047cf1
2021-06-09 17:20:19 +00:00
Ryan Mitchell
015bca79f4 Merge changes I2710cfea,I03fb31ee,Iec512b31 into sc-dev
* changes:
  ResourcesImpl.ThemeImpl NativeAllocationRegistry
  Rebase ThemeImpl rather than reallocate memory
  Sparse native theme representation
2021-06-09 16:35:35 +00:00
Jing Ji
c62254efc6 Merge "Log content provider authority name in traces" into sc-dev am: 57532ac939 am: d78e7a2f27
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14894402

Change-Id: Ib6e077c5904f81924fa45f2e1ac19b537b3456f6
2021-06-08 22:31:24 +00:00
Jing Ji
57532ac939 Merge "Log content provider authority name in traces" into sc-dev 2021-06-08 22:24:04 +00:00
Ryan Mitchell
7b8091ad7c ResourcesImpl.ThemeImpl NativeAllocationRegistry
Native allocations that hold theme data can be several KBs. Registering
the native allocation using NativeAllocationRegistry helps induce the GC
to free the malloced memory sooner and alleviate memory pressure.

Bug: 187883085
Bug: 141198925
Test: atest ResourcesPerfWorkloads
Change-Id: I2710cfea19565ea8aaf2b5fbd7b2c05d9cb17182
2021-06-08 14:25:20 -07:00
Ryan Mitchell
767e34fb17 Rebase ThemeImpl rather than reallocate memory
Memory churn is high when swapping the ResourcesImpl of a Resources
object. Each time Resources#setImpl is invoked, all themes based on
that Resources object are assigned new ThemeImpl objects that are
created using the new ResourcesImpl.

ThemeImpls can only belong to one Theme object, so the old
implementation is discarded and the theme takes ownership of the new
ThemeImp.

This creates performance problems when framework overlays are toggled.
Toggling overlays targeting the framework causes all themes across all
processes to recreate and reallocate all of their themes. By rebasing
the ThemeImpl on the new ResourcesImpl without deallocating the native
theme memory, we reduce churn and produce less garbage that needs to
be garbage collected.

Bug: 141198925
Test: atest libandroidfw_tests
Test: atest ResourcesPerfWorkloads
Change-Id: I03fb31ee09c9cfdbd3c41bcf0b605607dab54ed7
2021-06-08 14:25:18 -07:00
Jing Ji
b8ecbae648 Log content provider authority name in traces
It'll help to debug content provider related performance issues.

Bug: 190416935
Test: Manual - Record perfetto trace & verify auth name is logged.
Test: CtsContentTestCases:android.content.cts
Test: FrameworksCoreTests:android.content
Change-Id: Ifaa1c58135e6aa2a46ecbba92a9266e7d29d5421
2021-06-08 11:00:55 -07:00
TreeHugger Robot
3e40f57b4b Merge "Fix ApkLite parsing namespace" into sc-dev am: e054e5445b am: 399f3da374
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14888125

Change-Id: Iaa73f1deeec829762f850e66d26dd4ec0027883f
2021-06-08 16:20:49 +00:00
TreeHugger Robot
e054e5445b Merge "Fix ApkLite parsing namespace" into sc-dev 2021-06-08 15:48:20 +00:00
Winson
a1e9e63342 Fix ApkLite parsing namespace
An empty string doesn't work, needs to be null.

And configForSplit is not android namespaced.

Bug: 189988327

Test: atest android.appsecurity.cts.IsolatedSplitsTests

Change-Id: I9599c609d69ff1d8bd281975126b81fb35d06247
2021-06-07 18:25:01 -07:00
Winson Chiu
a0bf8ad300 Merge "Handle general and specific cross profile logic" into sc-dev am: 119b05e461 am: 7b4f22422f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14740492

Change-Id: I9ce70358bc3a4f8185e61545d6815d10988dd72a
2021-06-08 00:03:11 +00:00
Winson Chiu
119b05e461 Merge "Handle general and specific cross profile logic" into sc-dev 2021-06-07 23:38:27 +00:00
TreeHugger Robot
4662093318 Merge "Fix ApkLite attribute parsing" into sc-dev 2021-06-07 21:42:17 +00:00
Jackal Guo
fd853cc52f Merge "Refactor PackageParser (11/n)" 2021-06-07 01:00:33 +00:00
Treehugger Robot
29102277cb Merge "Do not canonicalize overlay config test paths" am: e2ddd9d277 am: 4c656c86bb am: f22f8c702d am: 63480e3b79
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1725991

Change-Id: I368cb0a913ac53919d4d02c7c08a978d9b89c74c
2021-06-04 18:34:40 +00:00
Treehugger Robot
f22f8c702d Merge "Do not canonicalize overlay config test paths" am: e2ddd9d277 am: 4c656c86bb
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1725991

Change-Id: I5806544243cc7e849e2612c217d73a659e40412b
2021-06-04 17:50:31 +00:00
Treehugger Robot
e2ddd9d277 Merge "Do not canonicalize overlay config test paths" 2021-06-04 17:04:49 +00:00
TreeHugger Robot
c8eecb8052 Merge "Add SharedLibraryInfo#isNative to @TestApi surface." into sc-dev am: cf28c48575 am: f926ac837d am: 5b1d9c7ac8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14807579

Change-Id: I90c8cddc0c5abdf3430b3d6dce93a6821d81abd1
2021-06-04 13:25:56 +00:00
TreeHugger Robot
f926ac837d Merge "Add SharedLibraryInfo#isNative to @TestApi surface." into sc-dev am: cf28c48575
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14807579

Change-Id: I12ff34945d438e5d6bb0ab838b460f65afc5529f
2021-06-04 12:55:20 +00:00
TreeHugger Robot
cf28c48575 Merge "Add SharedLibraryInfo#isNative to @TestApi surface." into sc-dev 2021-06-04 12:37:02 +00:00
Jeff Sharkey
966d028fee Merge "More Binder call AttributionSource assignment." into sc-dev am: fde28483d7 am: ecff705a7c am: e5c43727f1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14825079

Change-Id: I5e3cdddb613ea72cdb755b72325eba561accf821
2021-06-04 11:17:15 +00:00
Jeff Sharkey
a4d6f265bd Merge "Clarify 'phoneCall' foreground service type" into sc-dev am: de39a2b610 am: 8aac75a7f9 am: e6b84f1efe
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14801156

Change-Id: Id273afa8318df353a162ace54c073715bd7c5a1b
2021-06-04 11:02:01 +00:00
Jeff Sharkey
ecff705a7c Merge "More Binder call AttributionSource assignment." into sc-dev am: fde28483d7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14825079

Change-Id: Id643f0b156ea68980f9b9e99d623c9ff36e08a60
2021-06-04 05:37:45 +00:00
Jeff Sharkey
fde28483d7 Merge "More Binder call AttributionSource assignment." into sc-dev 2021-06-04 04:07:17 +00:00
Jeff Sharkey
8aac75a7f9 Merge "Clarify 'phoneCall' foreground service type" into sc-dev am: de39a2b610
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14801156

Change-Id: Iebd5581e77d38c698571e268e7337257f26cd959
2021-06-03 20:49:45 +00:00
Jeff Sharkey
de39a2b610 Merge "Clarify 'phoneCall' foreground service type" into sc-dev 2021-06-03 20:30:28 +00:00
Jeff Sharkey
22ca72a675 More Binder call AttributionSource assignment.
Since developers can use a BluetoothDevice object can make remote
calls, it needs to have an accurate AttributionSource.  Previous CLs
had updated many places where these BluetoothDevice instances were
passed across Binder interfaces, but this change updates several
remaining locations which had been missed.

Introduces new "Attributable" marker interface to offer consistent
tooling when applying AttributionSource updates.

Bug: 187097694
Test: atest BluetoothInstrumentationTests
Change-Id: Icad3b9726591f0fbad58a493cefa5a0af7648280
2021-06-03 12:14:17 -06:00
satayev
749427e8b7 Add SharedLibraryInfo#isNative to @TestApi surface.
The method is used in ClasspathDeviceTest to filter out native .so
files, as it only cares about java classes.

Bug: 189347015
Bug: 187823488
Test: m
Change-Id: Id4d41ddef1cddbecd7f7028e28da4040cdfd5c26
2021-06-03 14:09:36 +01:00
Svetoslav Ganov
94893b35e0 Merge "Switch media fw permissions checks to AttributionSource" into sc-dev am: 1028eb2f62
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14664152

Change-Id: I1403b08f25c663715fd0a99a40f484a4e7ecf410
2021-06-02 23:19:16 +00:00
Ryan Mitchell
2c9685573f Do not canonicalize overlay config test paths
Some devices may not have certain partitions available and the
OverlayConfigTests use hardcoded paths to test OverlayConfig
functionality. This change ensures that the temporary directory
created to test OverlayConfig has all of the partitions defined in
PackagePartitions#SYSTEM_PARTITIONS within it.

Bug: 187020117
Bug: 187020675
Test: atest OverlayConfigTest
Change-Id: I511e24b7ccfe82e6e89ceea7107457439793ef77
2021-06-02 21:12:18 +00:00
TreeHugger Robot
25c26c0ca5 Merge "Fix ApkLite attribute parsing" 2021-06-02 20:14:13 +00:00
Christopher Tate
a7768ad4a1 Clarify 'phoneCall' foreground service type
Bug: 182543747
Test: m offline-sdk-docs
Change-Id: I25a7140722699870f4d9c440252c64daa7bed62d
2021-06-02 10:10:15 -07:00
Svet Ganov
2eebf92965 Switch media fw permissions checks to AttributionSource
Attribution source is the abstraction to capture the data
flows for private data across apps. Checking permissions
for an attribution source does this for all apps in the
chain that would receive the data as well as the relevant
app ops are checked/noted/started as needed.

Teach speech recognition service about attribution
chains. If an implementation does nothing the OS
would enforce permisisons and do blame as always.
This apporach leads to double blaming and doesn't
support attribition chains where app calls into
the default recognizer which calls into the on
device recognizer (this nests recursively). If the
implementer takes advantage of the attribution chain
mechanims the permissions for the entire chain are
checked at mic access time and all apps are blamed
only once.

Fixed a few bugs around finishing ops for attribution
chains. Also ensured that any app death in a started
attribution chain would lead to finishing the op for
this app

bug: 158792096

Test: (added tests for speech reco)
      atest CtsMediaTestCases
      atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsPermission3TestCases
      atest CtsPermission4TestCases
      atest CtsPermission5TestCases
      atest CtsAppOpsTestCases
      atest CtsAppOps2TestCases

Merged-In: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4

Change-Id: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4
2021-06-01 23:43:29 +00:00
Svetoslav Ganov
757486cde6 Merge "Switch media fw permissions checks to AttributionSource" 2021-06-01 21:31:30 +00:00
Svet Ganov
b033da4e3a Switch media fw permissions checks to AttributionSource
Attribution source is the abstraction to capture the data
flows for private data across apps. Checking permissions
for an attribution source does this for all apps in the
chain that would receive the data as well as the relevant
app ops are checked/noted/started as needed.

Teach speech recognition service about attribution
chains. If an implementation does nothing the OS
would enforce permisisons and do blame as always.
This apporach leads to double blaming and doesn't
support attribition chains where app calls into
the default recognizer which calls into the on
device recognizer (this nests recursively). If the
implementer takes advantage of the attribution chain
mechanims the permissions for the entire chain are
checked at mic access time and all apps are blamed
only once.

Fixed a few bugs around finishing ops for attribution
chains. Also ensured that any app death in a started
attribution chain would lead to finishing the op for
this app

bug: 158792096

Test: ((added tests for speech reco))
      atest CtsMediaTestCases
      atest CtsPermissionTestCases
      atest CtsPermission2TestCases
      atest CtsPermission3TestCases
      atest CtsPermission4TestCases
      atest CtsPermission5TestCases
      atest CtsAppOpsTestCases
      atest CtsAppOps2TestCases

Change-Id: Ic92c7adc14bd2d135ac13b96f17a1b393dd562e4
2021-06-01 15:12:57 +00:00
Jackal Guo
bb8fb09eb9 Refactor PackageParser (11/n)
Replace PackageParser.NewPermissionInfo by the independent one in
order to move away from PackageParser.

Bug: 174723245
Test: atest -p core/java/android/content/pm/parsing \
      services/core/java/com/android/server/pm/permission \
      services/tests/servicestests/src/com/android/server/pm/permission
Change-Id: I2398ee87516c813a86f5e9308ae43434b841fae5
2021-05-31 09:23:00 +08:00
Ryan Mitchell
e72a6bcfc3 Merge changes from topic "inc-dis" into sc-dev am: 488522c9c5 am: a1cb15f54e am: 1e7576afd4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14505818

Change-Id: Ie2f775bf589806c4d4982f78d3acd2291cf6472b
2021-05-28 03:19:30 +00:00
Ryan Mitchell
a1cb15f54e Merge changes from topic "inc-dis" into sc-dev am: 488522c9c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14505818

Change-Id: I5ae5007659172d8a247b8613646d72a68a7dd06a
2021-05-28 02:49:33 +00:00
Ryan Mitchell
488522c9c5 Merge changes from topic "inc-dis" into sc-dev
* changes:
  Disable incremental hardening on own resources
  StringBlock incremental hardening default values
2021-05-27 21:31:04 +00:00
Ryan Mitchell
c0416698db Disable incremental hardening on own resources
When an application is incrementally installed, and a resources
operation fails due to the resources not being fully present,
the app should crash instead of swallowing the error and
returning default values to not alter the experience of
using the application.

Disable IncFsFileMap protections on ApkAssets that are a part of the
application that is running (base and splits).

Bug: 187220960
Test: atest ResourcesHardeningTest
Change-Id: Ibc67aca688720f983c7c656f404593285a54999b
2021-05-27 09:50:36 -07:00
Winson
54d82637ac Handle general and specific cross profile logic
Previous resolve had a weird behavior where a specific IntentFilter
configured cross profile filter configuration (as opposed to a general
configuration requiring allow_parent_profile_app_linking to be toggled)
would be added into the candidate set, which the code assumed was only
for the user ID being queried.

Instead, this specific cross profile resolution needs to be kept
separate as a different user, and applied if when the general
resolution is unavailable.

This makes both specific and general branchs assign the same
CrossProfileDomainInfo that domain verification was already checking,
and so should allow the logic to work in cases where the specific info
was previously dropped.

Bug: 189222753

Test: CtsDomainVerificationDeviceMultiUserTestCases

Change-Id: I0ac12d7125a7c5a9d4b9b35692d13928cbeb84e3
2021-05-26 17:03:42 -07:00
Ryan Mitchell
bef47a3577 StringBlock incremental hardening default values
When a string cannot be retrieved from a StringBlock due to pages of
the StringPool missing, rather than throwing an
IndexOutOfBoundsException, compute a default value rather that
abides by the API contacts of the functions that use the StringBlock.

IndexOutOfBoundsExceptions are not really documented as a possible
exception that can be thrown from APIs that use StringBlock because
it indicates that the binary resource table was built incorrectly.

Returning default values is much less likely to break applications
that fetch the resources of incrementally installed applications than
throwing IndexOutOfBoundsExceptions where they would normally not be
expected.

Bug: 188174746
Test: atest ResourcesHardeningTest
Change-Id: I58fe754fb446fefc031ddba19e290830fdd6d015
2021-05-26 16:01:38 -07:00
Hai Zhang
61ece97e71 Merge "Update permission group mapping API doc according to API review." into sc-dev am: bf8849c1ef am: 8e14d06296 am: 467c45061c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14737737

Change-Id: I01374b467200a92ab18dd43d24c3f673ed3b7678
2021-05-26 23:01:05 +00:00
Hai Zhang
8e14d06296 Merge "Update permission group mapping API doc according to API review." into sc-dev am: bf8849c1ef
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14737737

Change-Id: If9282d57b80e770d0a6322b42f2fbd7170c0f451
2021-05-26 22:20:56 +00:00
Hai Zhang
bf8849c1ef Merge "Update permission group mapping API doc according to API review." into sc-dev 2021-05-26 22:10:04 +00:00
Makoto Onuki
75135a7d38 Merge "Remove BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS" into sc-dev am: d55565dcb8 am: 4f26b43620 am: a559eaf3cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14721953

Change-Id: Ia19d099400535bdd875d3dd5b2ea98d0ef423bb3
2021-05-26 20:52:48 +00:00
Makoto Onuki
4f26b43620 Merge "Remove BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS" into sc-dev am: d55565dcb8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14721953

Change-Id: I82a29fe136e81a885deee6224184880e1731ab85
2021-05-26 20:45:49 +00:00
Hai Zhang
0f64fa7228 Update permission group mapping API doc according to API review.
Fixes: 189189426
Test: presubmit
Change-Id: I8bd910d035d1cd5d772c6535887a09432ece12f9
2021-05-26 19:38:18 +00:00
TreeHugger Robot
b3bf17d44e Merge "Update javadoc for ACTION_VIEW_PERMISSION_USAGE" into sc-dev am: 09a4771708
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14704249

Change-Id: Idc6613e0d5d5ce859e09b123df81534855fe75b7
2021-05-26 10:49:31 +00:00