Commit Graph

10909 Commits

Author SHA1 Message Date
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
Florian Mayer
0f7d78bfe7 Merge changes from topic "playprofileable" into sc-dev am: 748c3a8040
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14328127

Change-Id: I26cbadace6a71fe9195eb0271224514ae5f73332
2021-04-30 20:50:12 +00:00
Florian Mayer
748c3a8040 Merge changes from topic "playprofileable" into sc-dev
* changes:
  Add packageInstaller to packages.list.
  Add profileable opt-out to packages.list.
2021-04-30 20:42:16 +00:00
Oli Lan
c580952131 Merge "Call OnPrimaryClipChanged when classification status changes." into sc-dev am: b74c7adf8e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14327544

Change-Id: I4360da193722d42bbe635a23aa5d997c7c323a2f
2021-04-30 17:30:44 +00:00
Oli Lan
b74c7adf8e Merge "Call OnPrimaryClipChanged when classification status changes." into sc-dev 2021-04-30 17:20:04 +00:00
Winson Chiu
55bd899358 Merge "Implement domain verification backup and restore" into sc-dev am: 1b8610d9a9
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14058688

Change-Id: I787ebecf9a70b0debff5f634e411f06f79e4c0f1
2021-04-30 16:22:33 +00:00
Winson Chiu
1b8610d9a9 Merge "Implement domain verification backup and restore" into sc-dev 2021-04-30 16:17:30 +00:00
Florian Mayer
6ea939f3bf Add profileable opt-out to packages.list.
We now have two notions of profileable:
 * profileable from shell: the user can profile the app using ADB-based
   tools (e.g. Android Studio or shell) . This is off unless the app
   opts in.
 * profileable from platform services: trusted platform services can,
   in accordance to the app installer's Terms Of Service profile the
   app. This is the default unless the app opts out. This is enforced
   by the profilers with information provided by the framework.

A new flag <profileable android:enable="false"/> can be used to opt out
of profiling in general. If this is not given, the app is considered
profilable by the platform, but the data will *not* be exposed to the
user via shell or adb. If profiles of the app should be given to the
user (e.g. for using Android Studio), <profileable
android:shell="true"/> can can still be used.

We write whether the app opted out or not to packages.list, to be
consumed by the profilers.

CTS-Coverage-Bug: 186720347

Test: m
Test: on userdebug: /data/system/packages.list for preinstalled, Play
      Store installed app and sideloaded app.
Test: on user: atest CtsPerfettoTestCases.
Bug: 170284829

Change-Id: I8d4bbedc043976fd11a95a511bd95a05c7ced7b9
2021-04-30 11:52:31 +00:00
Jay Sullivan
08c22ba817 Merge "Make REVOKE_WHEN_REQUESTED a SystemApi field" into sc-dev am: a26bf49927
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14297593

Change-Id: Ife64ac3f5cab9cacd333a83dc19925ed4793b3ca
2021-04-29 20:04:49 +00:00
Jay Sullivan
a26bf49927 Merge "Make REVOKE_WHEN_REQUESTED a SystemApi field" into sc-dev 2021-04-29 19:52:33 +00:00
Jeff Sharkey
deacbdbb7d Merge "Restore file truncation where expected." into sc-dev am: 02b741f883
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14266167

Change-Id: I5270dddb6f3daa79f4dbff6101497a8303f2c482
2021-04-29 15:36:49 +00:00
Jeff Sharkey
02b741f883 Merge "Restore file truncation where expected." into sc-dev 2021-04-29 15:31:16 +00:00
TreeHugger Robot
e31344c371 Merge "Update documentation for activity flags." into sc-dev am: 51cac482f5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14308715

Change-Id: I75c53fb20d3c3a0443441dd4629cf44714e27954
2021-04-29 08:51:05 +00:00
TreeHugger Robot
51cac482f5 Merge "Update documentation for activity flags." into sc-dev 2021-04-29 08:48:15 +00:00
Jay Thomas Sullivan
7a7834230e Make REVOKE_WHEN_REQUESTED a SystemApi field
We have a reason to reference this flag from the base framework.  Mark
the flag as @SystemApi so it can be referenced.

Bug: 184962595
Test: atest AutoRevokeTest
Change-Id: Id9cb5d32b4afc9c49b8f97996fdfde2d4c239ca4
2021-04-28 20:33:48 -04:00
Todd Kennedy
449bcb0da9 Merge "PackageParser OWNERS noparent" am: 26a5186ab1 am: 159886625a am: 2678377c4b am: 229773b648
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1688565

Change-Id: I211fa81fc83caf97aa322559d3f8e1e1d22aa3c6
2021-04-28 22:47:35 +00:00
Todd Kennedy
229773b648 Merge "PackageParser OWNERS noparent" am: 26a5186ab1 am: 159886625a am: 2678377c4b
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1688565

Change-Id: Iacc17024700bdb7ac9c7d044288bd35b0dfb0054
2021-04-28 22:41:50 +00:00
Jeff Sharkey
fe738fbd0d Restore file truncation where expected.
Several years ago ParcelFileDescriptor.parseMode() was fixed to match
the behavior of fopen(), since developers expect consistent behavior
between managed and native code.  FileUtilsTest.testTranslateMode()
verifies that all these modes are correctly translated.

However, this unintentionally changed the behavior of
ContentResolver.openOutputStream(), which only sends the 'w' mode
to the remote process.  Developers expect this API to behave like
the FileOutputStream constructor, which always truncates the file
unless opened with the append mode.

Since some remote providers may not be prepared to handle the 't'
mode, this change carefully uses Os.ftruncate() to restore this
expected behavior in all cases.

For other APIs that return opened files, this strategy is applied
to restore the original behavior, but only when the target SDK of
the app is expecting this truncation to take place.  The reason for
this is that moving forward our goal should always enable
ContentInterface APIs to be a transparent conversation between apps
without attempting to alter the behavior.  Apps talking with older
providers can apply the Os.ftruncate() logic themselves, if
desired, once they target Android Q or higher.

Bug: 157888856, 180680924
Test: atest CtsContentTestCases:ContentResolverTest
Change-Id: Iacec49164c4ce3891db0270635e9f458dea7becd
2021-04-28 14:25:46 -06:00
Guliz Tuncay
9550d2f640 Merge "Migrate |documenter to |role" 2021-04-28 16:30:28 +00:00
TreeHugger Robot
5fa89103e8 Merge "Move new changes to ParsingPackageUtils" into sc-dev am: 9ccd991dac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14319867

Change-Id: I5e21edbb688c0412a3c4e1c6875683dad3903544
2021-04-28 08:05:34 +00:00
TreeHugger Robot
9ccd991dac Merge "Move new changes to ParsingPackageUtils" into sc-dev 2021-04-28 07:36:36 +00:00
Jackal Guo
ed537a2acf Move new changes to ParsingPackageUtils
PackageParsers is marked as Deprecated so any new change should be
in the alternative. Moving the new activity launch mode definition
to ParsingPackageUtils.

Bug: 174723245
Test: atest IntentTests
Change-Id: I841f9d9d5d5555a78902cc3c126ed811dd2ccfc6
2021-04-28 09:30:14 +08:00
Winson Chiu
7edfb41f13 PackageParser OWNERS noparent
Remove other OWNERS from PackageParser.java to disallow future changes.
No new code should go into PackageParser.java except in extreme outlier
circumstances.

Change-Id: I2f663d2ae527beccbd47402492aa51d0cc6f6c13
2021-04-27 16:14:50 +00:00
Oli Lan
7461b08f9f Call OnPrimaryClipChanged when classification status changes.
To allow apps to know when text classification has been completed
on clipboard clips, ClipboardService will now call any
OnPrimaryClipChangedListeners when the classification status
of the primary clip changes.

This change is made as per API council suggestion.

This CL also ensures that the classification status is set on
any related profiles.

Bug: 185177537
Test: atest ClipboardManagerListenerTest
Test: atest ClipDescriptionTest
Test: atest atest ManagedProfileCrossProfileTest#testCrossProfileCopyPaste

Change-Id: I63c44a051d1e8029b6d56b9af5d1e506355a8466
2021-04-27 17:08:06 +01:00
Svetoslav Ganov
180f5ab24e Merge "Revert "Prepare AttributionSource to expose to native"" into sc-dev am: b9b8524f38
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14315965

Change-Id: Ie3634408b2393594a914c582140f69b9c665ac20
2021-04-27 02:25:16 +00:00
Svetoslav Ganov
b9b8524f38 Merge "Revert "Prepare AttributionSource to expose to native"" into sc-dev 2021-04-27 02:12:30 +00:00
Adam Bookatz
33e17a9933 Revert "Prepare AttributionSource to expose to native"
Revert "Prepare AttributionSource to expose to native - native"

Revert submission 14225527-bug-158792096-04/16/21-1

Reason for revert: b/186467053
Reverted Changes:
I16740cc2d:Prepare AttributionSource to expose to native - na...
I4e050e78b:Prepare AttributionSource to expose to native

Change-Id: I83e4091231241c2211edf5745735f4ee993c6680
2021-04-26 23:20:46 +00:00
TreeHugger Robot
1973485504 Merge "Add examples for EXTRA_PERMISSION_GROUP_NAME and EXTRA_ATTRIBUTION_TAGS" into sc-dev am: de1232b368
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14313156

Change-Id: I2195ac60354f9bc086918c7ace0da79b25a219be
2021-04-26 22:46:52 +00:00
TreeHugger Robot
de1232b368 Merge "Add examples for EXTRA_PERMISSION_GROUP_NAME and EXTRA_ATTRIBUTION_TAGS" into sc-dev 2021-04-26 22:39:10 +00:00
Vadim Caen
98a00d7a76 Merge "API to override the splashscreen theme" into sc-dev am: 8773bbe881
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/13996772

Change-Id: I6130f6a5dcabfb37074f6fbb914a7a27bad1057a
2021-04-26 19:24:08 +00:00