Commit Graph

10716 Commits

Author SHA1 Message Date
Jing Ji
57532ac939 Merge "Log content provider authority name in traces" into sc-dev 2021-06-08 22:24:04 +00: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
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
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
TreeHugger Robot
cf28c48575 Merge "Add SharedLibraryInfo#isNative to @TestApi surface." into sc-dev 2021-06-04 12:37:02 +00:00
Jeff Sharkey
fde28483d7 Merge "More Binder call AttributionSource assignment." into sc-dev 2021-06-04 04:07:17 +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
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
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
bf8849c1ef Merge "Update permission group mapping API doc according to API review." into sc-dev 2021-05-26 22:10:04 +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
Makoto Onuki
91a1e64991 Remove BIND_ALLOW_BACKGROUND_ACTIVITY_STARTS
We ended up defaulting to this behavior, so we no longer need this flag.

Bug: 189235490
Bug: 188057823
Test: Build
Change-Id: I62e383978d9b168657f2eac2e6bf4337a91b909b
2021-05-25 12:51:04 -07:00
TreeHugger Robot
09a4771708 Merge "Update javadoc for ACTION_VIEW_PERMISSION_USAGE" into sc-dev 2021-05-25 03:17:56 +00:00
Guojing Yuan
5a67ef6b76 Update javadoc for ACTION_VIEW_PERMISSION_USAGE
Bug: 176902658

Test: N/A
Change-Id: Ic4928fed75ad986c13af704d13985602ba972553
2021-05-25 00:27:01 +00:00
Erik Wolsheimer
350fa3e8b0 Describe time base/units on ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD
Bug: 188084977
Test: NA
Change-Id: I25aa1d6419cdec8f0a9508948451be9edbffa964
2021-05-24 17:20:06 -07:00
Tom Natan
c4cf09baa4 Merge "Add support for switching off sandboxing via device config flags" into sc-dev 2021-05-24 15:23:35 +00:00
Calin Juravle
dd8b94557d Merge "Update the use of registerAppInfo" into sc-dev 2021-05-21 20:29:17 +00:00
Hai Zhang
5044308999 Merge "Expose platform permission group mapping as public API." into sc-dev 2021-05-21 17:26:10 +00:00
Calin Juravle
2d2bd54bd5 Update the use of registerAppInfo
Pass additional parameters to ART to assist with better profiling
and debuggability.

(cherry picked from commit 3e308c6270)

Test: m
Bug: 182793486
Bug: 185979271

Merged-In: Iae0beab92194d75f191147578922c760f04470b9
Change-Id: Iae0beab92194d75f191147578922c760f04470b9
2021-05-21 14:13:03 +00:00
Hai Zhang
8bda34c493 Expose platform permission group mapping as public API.
The API is moved from PermissionControllerManager (only a System API)
to PackageManager to expose it as public API.

Bug: 182094776
Test: atest GetPermissionGroupInfoTest
Change-Id: I175afb2e37bf2651b91765029645f7940f58f39c
2021-05-21 03:03:56 +00:00
Rhed Jao
6dc12d80fa Merge "Throttle the repeated silent installation requests" into sc-dev 2021-05-21 01:35:58 +00:00
Erik Wolsheimer
afbc4fee9d Add application-level 'attributionsAreUserVisible' attribute
Bug: 176902658
Test: Manual
Change-Id: I56dc9caa6d98b75bc6732bbca0e5adc67bb745e5
2021-05-20 21:07:14 +00:00
Winson Chiu
17eb3ba04e Merge "Reset target sdk version of ParseTypeImpl" into sc-dev 2021-05-20 17:53:20 +00:00
liulvping
177a7200ab Reset target sdk version of ParseTypeImpl
In device booting, PackageParser2 uses a thread
local ParseTypeImpl obj as shared result and reset
it before parsing everty time. But it doesn't reset
the target sdk version, which could make deferError
returned unexpected error, cause apk scaned failed
and deleted by the system.

Bug: 188523844

Test: atest com.android.server.pm.parsing

Signed-off-by: liulvping <liulvping@xiaomi.com>

Merged-In: Ie6fbc4b79e94943c9282206b1ef6d20b4129fa0b
Change-Id: Ie6fbc4b79e94943c9282206b1ef6d20b4129fa0b
2021-05-20 15:58:39 +00:00
Corina Grigoras
b84e828974 Merge "Clarify javadocs about mode to parse file." into sc-dev 2021-05-20 14:10:22 +00:00
tomnatan
021a43c4be Add support for switching off sandboxing via device config flags
Bug: 187408243
Test: atest WmTests:SizeCompatTests
Test: atest FrameworksCoreTests:ConstrainDisplayApisConfigTest
Change-Id: I3ec02f3b2ba5c1825cdc530fd0f6f71abbe5bd10
2021-05-20 11:35:14 +00:00
Rhed Jao
ec065a8333 Throttle the repeated silent installation requests
To avoid a non-system installer repeatedly silent updates and
'denial-of-service' against another app on the device. This CL
tracks for all the silent updated installs where the
`requireUserAction' is not required. And fall back to user
action required if a repeated silent update is requested within
the throttle time.

Bug: 185878964
Test: atest SilentUpdateHostsideTests
Test: atest StagingManagerTest
Test: atest PackageInstallerSessionTest
Change-Id: I4ea287bf66d8661eec2676b604f9109f6f9add28
Merged-In: I4ea287bf66d8661eec2676b604f9109f6f9add28
2021-05-20 11:02:36 +08:00
Winson
e319e3acb5 Fix ApkLite attribute parsing
Reads properly namespaced attributes only, and always assigns
regardless of presence to ensure that last tag is taken, mirroring
full parsing.

Also fixes targetSdkVersion parsing so that it mirrors the logic used
by the full parser.

Bug: 184942889

Merged-In: I6c7014e5dae0f6f15268f0271c133879a89f5bc7
Change-Id: I6c7014e5dae0f6f15268f0271c133879a89f5bc7
2021-05-19 20:16:15 +00:00
TreeHugger Robot
ee438f960a Merge "Deprecate Context#createApplicationContext" into sc-dev 2021-05-19 15:35:09 +00:00
James O'Leary
671019f95c Merge "Connect ColorStateList to CAM" into sc-dev 2021-05-18 23:44:22 +00:00
Corina
8cd8c9901d Clarify javadocs about mode to parse file.
Bug: 185900460
Test: atest
Change-Id: I72b743affd9c1c47650c4249e855676203033f5e
2021-05-18 17:17:27 +00:00
Ryan Mitchell
c54ebba25b Deprecate Context#createApplicationContext
If an application caches an ApplicationInfo and uses it to call
Context#createApplicationContext, the app will not get the most recent
version of the overlays for that application. To make things worse, the
LoadedApk stored in ActivityThread#mResourcePackages is updated using
the old ApplicationInfo causing further uses of the cached LoadedApk to
return outdated information.

Deprecate Context#createApplicationContext, convert all internal uses
to Context#createPackageContext(String packageName, ...) and log
whenever any one calls Context#createApplicationContext with an
outdated ApplicationInfo to detect debug issues in using old infos.

Bug: 188059515
Test: change wallpaper and observe widgets get reloaded with most
      recent overlays
Change-Id: I2aeefa8c0e66264859109975a54c4f73f76ad710
2021-05-18 09:07:58 -07:00
Alexander Dorokhine
72ac81f5df Merge "Update framework from jetpack" into sc-dev 2021-05-18 01:17:30 +00:00
TreeHugger Robot
8a6ffdc597 Merge "Revert "Temporary stop-gap for Chrome target SDK issue."" into sc-dev 2021-05-17 23:32:25 +00:00
Alexander Dorokhine
a6d8d8e66c Update framework from jetpack
Included changes:
* b692f37: Rename `Int64` in annotation processor to `Long`.
* 05fe08c: Get QueryLength from Native
* 8f46606: Logging stats for remove (1)
* 237c134: Alter inheritance of LongProperty for backwards compatibility.

Bug: 187820569
Bug: 173532925
Bug: 173532925
Bug: 187820569
Test: Presubmit
Change-Id: Ia27e00250e7aa7c7a1acc974f24c63cc456739be
2021-05-17 15:13:40 -07:00
Winson Chiu
32b756cfae Revert "Temporary stop-gap for Chrome target SDK issue."
This reverts commit c6be9fe470.

Reason for revert: No longer needed, Chrome targets 30

Bug: 183905675

Change-Id: I7db4fda4f233414330c4daa38a96d088bd56ee09
2021-05-17 19:08:40 +00:00
Jeff Sharkey
804cb8801d Guard against null BluetoothDevice extras.
Bug: 188364781
Change-Id: If976318763fac7e5cb4b59300f104c9cd9392eaf
2021-05-16 20:45:20 -06:00
Jeff Sharkey
5014fbd644 Apply "attributionTags" to all component types.
Components within an application are often a good boundary for
developers to declare "attribution" information, such as an Activity
or Service used to offer a specific sub-feature.

This change expands the "android:attributionTags" manifest attribute
to apply to all component types, and it then automatically configures
the associated Context with Context.createAttributionContext() with
no additional developer action required.  Developers can still
manually use Context.createAttributionContext() to adjust the
attribution tag again if desired.

Bug: 187097694
Test: atest CtsAppOpsTestCases:AttributionTest
Test: atest CtsAppTestCases:android.app.cts.AttributionTagsTest
Change-Id: Ia16c66e7b63bcbfb8c0d7348e9b5d4adb2a1f45d
2021-05-15 12:11:03 -06:00
Jeff Sharkey
dd6dd3b1fb Apply AttributionSource during Intent delivery.
There are some Parcelables which offer to perform Binder calls, and
when these are delivered via Intent extras they fallback to
ActivityThread.currentAttributionSource(), instead of being tagged
based on the relevant app component.

This change begins using Intent.prepareToEnterProcess() as a hook to
fix-up AttributionSource when those extras finally land in the
destination process.  It uses the relevant AttributionSource based
on the Activity or Service the Intent is delivered to, which
developers have control over via AppComponentFactory.

In the case of <receiver> manifest elements, this change applies the
first android:attributionTags value to the Context used for that
BroadcastReceiver.

Bug: 187097694
Test: atest AttributionTest
Change-Id: I8f5197db7e8d7277d34f0ef2bb90bfdf1871186a
2021-05-15 09:48:14 -06:00
TreeHugger Robot
ef36e9f960 Merge "Move boot test to postsubmit" into sc-dev 2021-05-13 00:13:07 +00:00
Alex Buynytskyy
8e1f1debde Better error message for missing job services.
Bug: 141645789
Test: presubmit
Change-Id: I334639d624f08ae2ec5ee235d609c780a09a1338
2021-05-12 16:01:53 +00:00
Jackal Guo
0a55e2c85f Move boot test to postsubmit
Bug: 187383694
Test: atest
Change-Id: I1611e4bb3bfc99f2bdef14357d09f4d0cf5a3a33
2021-05-12 15:39:19 +00:00