Commit Graph

10939 Commits

Author SHA1 Message Date
Jeff Sharkey
40a2050e5c Merge "Guard against null BluetoothDevice extras." into sc-dev am: 53deb833da am: a19c83bd2c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14556719

Change-Id: I8776d128f2417a62e1221726a3924ceae4cec233
2021-05-19 22:47:55 +00:00
Jeff Sharkey
3e006db10d Merge changes from topic "may15" into sc-dev am: 63a1453832 am: b1b4de9ed7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14515460

Change-Id: I2d1036ca3b7876e5f07c267ae8b884368d60c599
2021-05-19 22:47:24 +00:00
Jeff Sharkey
e97c037d19 Apply AttributionSource during Intent delivery. am: dd6dd3b1fb am: 2d0e8e3d5d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14470318

Change-Id: Iac0646b8065a4e70ec0366db19943db33ba2e40b
2021-05-19 22:47:13 +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
15ee499549 Merge "Move boot test to postsubmit" into sc-dev am: ef36e9f960
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14514110

Change-Id: I396824d3145031836b46bae8110d418945c66439
2021-05-13 00:32:05 +00:00
TreeHugger Robot
ef36e9f960 Merge "Move boot test to postsubmit" into sc-dev 2021-05-13 00:13:07 +00:00
TreeHugger Robot
e723ade6b6 Merge "Better error message for missing job services." into sc-dev am: c562b93a11
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14443406

Change-Id: Ia5035d6e0731d2e23d9aca7357e0777c13a2b52e
2021-05-12 17:59:21 +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
TreeHugger Robot
e3fb509755 Merge "Add CtsPackageManagerBootTestCases to TEST_MAPPING" into sc-dev am: 5272316f8f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14516702

Change-Id: I24e3508c83d1d70af859cf2576dddfb5358b596e
2021-05-12 15:13:00 +00:00
satayev
ef6a4a0c7f Merge "Expose SharedLibraryInfo#getAllCodePaths as @TestApi." am: 3f955dda5c am: db47bd0c94 am: c792a3d96b am: 7e31457971
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1703011

Change-Id: I298f136c083521956d644b93631cc8718cd38445
2021-05-12 15:11:21 +00:00
TreeHugger Robot
5272316f8f Merge "Add CtsPackageManagerBootTestCases to TEST_MAPPING" into sc-dev 2021-05-12 15:07:34 +00:00
satayev
7e31457971 Merge "Expose SharedLibraryInfo#getAllCodePaths as @TestApi." am: 3f955dda5c am: db47bd0c94 am: c792a3d96b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1703011

Change-Id: I3aaaeea2b75feb91af679ee56493144b037a5f2f
2021-05-12 14:43:44 +00:00
TreeHugger Robot
ebe4ff0602 Merge "Make ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD public" into sc-dev am: 8eb397fb04
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14505697

Change-Id: I4f75d6940fdbba7c2912e771ad947a9fed7494a0
2021-05-12 10:35:08 +00:00
TreeHugger Robot
8eb397fb04 Merge "Make ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD public" into sc-dev 2021-05-12 10:26:12 +00:00
Jackal Guo
6f9142e0d9 Add CtsPackageManagerBootTestCases to TEST_MAPPING
Fix: 187383694
Test: atest
Change-Id: I88c3b7c5005550d1e043027637f7d0d6b90edab1
2021-05-12 08:55:49 +00:00
Erik Wolsheimer
7e93dab6ee Make ACTION_VIEW_PERMISSION_USAGE_FOR_PERIOD public
Bug: 176902658
Test: Manual
Change-Id: Ie5886864eb8938555ba94fcf72b7ca084681a9e9
2021-05-11 19:02:59 -07:00
Jackal Guo
84011d51fe Merge "Revert the usage of sCompatibilityModeEnabled" into sc-dev am: f849b0b75e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14484638

Change-Id: I0c83f5cccc49a10ca9240cd2095277edf872f783
2021-05-12 01:29:50 +00:00
Jackal Guo
f849b0b75e Merge "Revert the usage of sCompatibilityModeEnabled" into sc-dev 2021-05-12 01:17:31 +00:00
Pinyao Ting
5aefd78eca Merge "Remove updateShortcutVisibility" into sc-dev am: ab982fa862
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14275795

Change-Id: Ic7b36cf5df6e7c392f8f5a40691eb50950d8928c
2021-05-11 23:25:14 +00:00
Pinyao Ting
ab982fa862 Merge "Remove updateShortcutVisibility" into sc-dev 2021-05-11 23:15:25 +00:00
TreeHugger Robot
a1ad802e30 Merge "Add two new non-mandatory app intent categories" 2021-05-11 21:46:25 +00:00
Shreerag Jayakrishnan
faa439c17c Add two new non-mandatory app intent categories
android.intent.category.APP_WEATHER
android.intent.category.APP_FITNESS

Bug: 185978640
Change-Id: I6c5a6ec9617994187dca476c810975412147b1f6
2021-05-11 17:38:57 +00:00
satayev
a8e4e5dcc3 Expose SharedLibraryInfo#getAllCodePaths as @TestApi.
The method is called by CTS helper app to list all java shared libraries
present on the device. All classes present in the reported jar/apk files
are then collected by a CTS/GTS EDI collector.

Bug: 187823488
Test: m
Change-Id: I750065112d70bc3ab45c8b6c6cc8aa4d429488a8
2021-05-11 17:26:47 +01:00
Makoto Onuki
f5a8ef7c9e Merge "Implement requestForegroundServiceExemption, without enabling it" into sc-dev am: 987f904072
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14456061

Change-Id: I03bb71e94a871a5b39cc553f69972ec1689d8fd4
2021-05-11 16:10:07 +00:00
Makoto Onuki
619c5a46d8 Implement requestForegroundServiceExemption, without enabling it
Bug: 187429663
Test: Checked ApplicationInfo.hasRequestForegroundServiceExemption()
  of a test app, with and without the new attribute set.

Change-Id: I98342a35a82e44327db896c9820806eb3eda5b4c
2021-05-10 11:50:32 -07:00
Jackal Guo
254edef2cf Revert the usage of sCompatibilityModeEnabled
Change the usage of global compatibility mode enabled state back to
PackageParser first until the tests are ready to ensure the behavior
is consistent.

Bug: 186592266
Test: atest CtsCompatibilityModeTestCases
Change-Id: Ib57886c095a7b2f6e797ccdaa2890f3ad60f5482
2021-05-10 10:25:12 +08:00
Stanislav Zholnin
d7887a529c Merge "Fix bug in BaseParceledListSlice implementation." into sc-dev am: 93f4ae674d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14440240

Change-Id: Icc8028beeb49b8a3fec8b22883de84a798f0c11f
2021-05-07 14:28:01 +00:00
Stanislav Zholnin
4762e7e8db Fix bug in BaseParceledListSlice implementation.
Under specific conditions, parceled list can be written in such a
way that writing of new list starts when destination parcel is
just above MAX_IPC_SIZE. In that case "0" is written to parcel to
indicate that there will be no inline items written and writing of
the list will start with extra items.

When unparcelling such list, listElementClass is not determined and
stays equal to null, because it only can be determined if there
were some inline items read first, before switching to extra.

This leads to random unparcelling failures with the following
error message:

Can't unparcel type <typename> in list of type null.

Test: manually verified
Bug: 186193371
Fix: 151481291
Bug: 156514418
Fix: 169191099
Change-Id: I849bf46158b6d9b109139b19b93a6a1ba16ecc77
2021-05-07 08:12:30 +01:00
TreeHugger Robot
6503d72f68 Merge "Revert "Migrate the usage of sCompatibilityModeEnabled"" into sc-dev am: e39067a6e1
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14443645

Change-Id: I73b3225aebec341d01b2d49ee490b59171e2f8f4
2021-05-06 05:34:58 +00:00
TreeHugger Robot
e39067a6e1 Merge "Revert "Migrate the usage of sCompatibilityModeEnabled"" into sc-dev 2021-05-06 05:14:37 +00:00
Svetoslav Ganov
8fb897acef Merge "Prepare AttributionSource to expose to native" into sc-dev am: 720add59c7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14381260

Change-Id: I14f40269541872bf807f669283da9a6f3d722f97
2021-05-05 23:44:49 +00:00
Svetoslav Ganov
720add59c7 Merge "Prepare AttributionSource to expose to native" into sc-dev 2021-05-05 23:23:54 +00:00
Todd Kennedy
a02ce471be Revert "Migrate the usage of sCompatibilityModeEnabled"
This reverts commit 0a98d27b04.

Reason for revert: b/187301322

Change-Id: Iae9acc88841f214a5e3a14f83c3d5ee8b9ffd422
Bug: 187301322
2021-05-05 20:51:46 +00:00
Corina Grigoras
74007b883e Merge "Revert "Restore file truncation where expected."" into sc-dev am: df2e7b8839
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14425891

Change-Id: I01155a267163a02d09ea8232b4fce5e0bcbc8dc4
2021-05-04 20:03:14 +00:00
Corina Grigoras
df2e7b8839 Merge "Revert "Restore file truncation where expected."" into sc-dev 2021-05-04 19:53:57 +00:00
Sahana Rao
8f6f6fa721 Merge "Change hasRequestRawExternalStorageAccess() to return integer" into sc-dev am: 8f28e57780
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14327548

Change-Id: I6bb834eb44bdb0faccfebb0d981718fb8395f2d2
2021-05-04 19:21:38 +00:00
Sahana Rao
8f28e57780 Merge "Change hasRequestRawExternalStorageAccess() to return integer" into sc-dev 2021-05-04 19:19:17 +00:00
Alex Buynytskyy
3e43b9f2ff Merge "Customer API feedback." into sc-dev am: 915f8bdaba
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14377096

Change-Id: I923a79acf57ef760bdd2172c8d2ebdb2326dc7b3
2021-05-04 18:38:43 +00:00
Corina Grigoras
3fcb12e221 Revert "Restore file truncation where expected."
Revert "Restore file truncation where expected."

Revert submission 14173486-rwt

Reason for revert: b/186862362 - breaks ContentResolverWrapTest
Reverted Changes:
I41bc298af:Restore file truncation where expected.
Iacec49164:Restore file truncation where expected.

Bug: 186862362
Change-Id: I2afe5e2334cff60c4e7220267095042a60909185
2021-05-04 15:39:40 +00:00
Alex Buynytskyy
1e5cf8f1ff Customer API feedback.
Use two separate interfaces for flags and single value. This produces
correct API documentation.

Bug: 160605420
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageManagerServiceTest ChecksumsTest
Change-Id: I9a7eaf86af558d8dcfd1636a4baf6a28e2ee79b1
2021-05-04 15:24:02 +00:00
Svet Ganov
4bf102ae26 Prepare AttributionSource to expose to native
Separate the internal state of AttributionSource from the
class to make it a simple AIDL we can translate automatically
to native - keeping Java and native parts in sync. This
would allow writing a thin native lib for checking attribution
source permissions which would be used to teach camera and
audio about attributions.

Deinfe an AIDL interface for passing around an attribution
source and opr performing permission checker oprations allowing
native and Java permission checks on attribution chains to be
handled. The Java side permission checker functions are in a dedicated
permisison checker service on top of which sits the PermissionChecker.
We expose similar PermissionChecker native APIs sitting on top
of the same remote interface. The nice thing is that we have
native and Java permisison checkers in sync sharing remoting
code and being close in shape.

For now the PermissionChecker in Java is divorced from the
PermissionManager but in T we will consider how to unify them,
either by an extension object on the PermmissionManager or
APIs on the PermissionManager, or another approach, and then
migrate clients off the PermissionChecker APIs.

Sync app ops were not tracked across multiple binder calls which
prevents moving the permission checks in the system server as
this adds one more hop. Now sync ops are propagated backed the
call stack and only the ops for the package are dispatched to
it and the rest are propagated back to the caller, recursively.

bug: 158792096

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

Change-Id: Ia5cbd2eb20a2da172a5960afdddd7e467f4bcb0d
2021-05-04 07:42:45 +00:00
Jackal Guo
b4bbc08b9e Merge "Migrate the usage of sCompatibilityModeEnabled" into sc-dev am: e3e92e26c5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14326774

Change-Id: Ife164dd92c998a1d110078baecf85386f9e192d3
2021-05-04 01:39:00 +00:00
Jackal Guo
e3e92e26c5 Merge "Migrate the usage of sCompatibilityModeEnabled" into sc-dev 2021-05-04 01:18:58 +00:00
Sahana Rao
d559e78253 Change hasRequestRawExternalStorageAccess() to return integer
Previously, hasRequestRawExternalStorageAccess would return null if the
app doesn't have requestRawExternalStorageAccess attribute in the
manifest. And, return true/false based on the value specified in
manifest.

Based on API review comments, changed the method to
getRequestRawExternalStorageAccess which returns
* RAW_EXTERNAL_STORAGE_ACCESS_DEFAULT if app didn't specify
requestRawExternalStorageAccess attribute in the manifest.
* RAW_EXTERNAL_STORAGE_ACCESS_REQUESTED if the app requested raw
external storage access.
* RAW_EXTERNAL_STORAGE_ACCESS_NOT_REQUESTED if the app requests to
disable raw external storage access

The API is not guarded with any system level API permissions, hence
changing the API to public API instead of system API. Also added
documentation to ensure apps don't misunderstand this API

Bug: 185484514
Test: atest packages/providers/MediaProvider
Change-Id: Ib7e41ab8ee38389bf44a360e4288d03e58ef44cf
2021-05-03 22:16:56 +01:00
TreeHugger Robot
9d1a948f97 Merge "Fix nullability of the group name parameter in queryPermissionsByGroup()." into sc-dev am: 1d92fd8123
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14391263

Change-Id: I8dbf83e4aac805eeb6f567cedf61d904adc972e8
2021-05-03 15:20:48 +00:00
Jackal Guo
0a98d27b04 Migrate the usage of sCompatibilityModeEnabled
PackageManagerService still set global compatibility mode to the
Deprecated PackageParser. We should migrate the usage to the new
ParingPackageUtils.

Also replacing the usage of PackageParser#generateApplicationInfo
in PackageManagerService since we no longer set the compatibility
mode to PackageParser.

Bug: 186592266
Bug: 174723245
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: I3f377273e06bd4adbd9311dd3bdc584af0028c77
2021-05-03 14:30:52 +08:00
Hai Zhang
8f6290db77 Fix nullability of the group name parameter in queryPermissionsByGroup().
Change-Id: Id503da0fe4f16a92997634089fc052d58e78f9df
Fixes: 141452667
Test: presubmit
2021-04-30 21:43:05 +00:00