Commit Graph

12339 Commits

Author SHA1 Message Date
Matt Gilbride
8e7404af95 Merge "Add parameters to @PermissionMethod" 2022-11-28 20:07:34 +00:00
Nikita Ioffe
d063f91638 Merge "Register managers provided by the com.android.virt APEX" 2022-11-25 14:51:56 +00:00
Nikita Ioffe
167b913ad4 Register managers provided by the com.android.virt APEX
This allows apps to retrieve an instance of VirtualMachineManager via
Context.getSystemService() API.

Bug: 249093790
Test: builds
Test: atest --test-mapping packages/modules/Virtualization:avf-presubmit
Change-Id: I488c275343753f2a3af6270cbad2ab02f33f203f
2022-11-24 16:39:13 +00:00
Jing Ji
3d3659bc1d Rename android.app.ForegroundServiceTypeNotAllowedException to
..android.app.InvalidForegroundServiceTypeException.

And also add MissingForegroundServiceTypeException.

Bug: 254662240
Bug: 246792057
Test: atest CtsAppFgsTestCases
Change-Id: I9d39cb7fa75a14eb1b8cc97af13b612491803b61
2022-11-23 21:31:12 -08:00
TreeHugger Robot
2064ae92ad Merge "AudioDeviceVolumeManager and VolumeInfo API changes" 2022-11-24 03:07:56 +00:00
Charlie Wang
bf720fc448 Merge "WearableSensing framework API for wearables." 2022-11-24 02:18:37 +00:00
Almaz Mingaleev
b799b6cf59 Merge "Clean-up after TZUvA feature removal." am: 06b9abf013 am: ac0cf4e9ae am: fe16fe6f8c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2300422

Change-Id: Ifd1e49c1611ed2d55337609e5d07d43761f3e44d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 18:37:04 +00:00
Jean-Michel Trivi
283a4c7153 AudioDeviceVolumeManager and VolumeInfo API changes
Context service name for accessing AudioDeviceVolume manager.
Address API comments on VolumeInfo and AudioDeviceVolumeManager.
Add support in VolumeInfo to know whether it carries an explicit
  mute/unmute information (vs just default value of isMuted()).

Bug: 244326361
Test: atest android.media.audio.cts.AudioDeviceVolumeManagerTest
Test: atest android.media.audio.cts.VolumeInfoTest
Change-Id: Id718fbd7e0d5795ac480d9188faad4a70fba9808
2022-11-23 18:14:47 +00:00
Almaz Mingaleev
fe16fe6f8c Merge "Clean-up after TZUvA feature removal." am: 06b9abf013 am: ac0cf4e9ae
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2300422

Change-Id: Id8a86a06c500d6e58571ec903a4238613597eae8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 11:28:16 +00:00
Almaz Mingaleev
ac0cf4e9ae Merge "Clean-up after TZUvA feature removal." am: 06b9abf013
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2300422

Change-Id: I1d9b114c135f7e3c80613ae1f7b32346cd0b258f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-23 11:02:13 +00:00
Almaz Mingaleev
06b9abf013 Merge "Clean-up after TZUvA feature removal." 2022-11-23 10:16:21 +00:00
mattgilbride
8e806dd2b1 Add parameters to @PermissionMethod
- orSelf: signifies that this method checks if the calling process OR
  the current process has the permission
- anyOf: signifies that if this method checks multiple permissions,
  the check passes if ANY ONE of the permissions is granted
- value (default parameter): a hard coded list of permissions that this method checks.
  This parameter is useful for static analysis, where the implementation
  of some @PermissionMethod may not be visible across library
  boundaries.  A good example of this is
  NetworkStack#checkNetworkStackPermission, which is a source in
  framework-minus-apex, but is used from services.core.unboosted.  Since
  it passes straight into a helper which checks the actual permissions,
  it's not possible for lint running on services.core.unboosted to see
  which permissions are checked.

Bug: 247537842
Test: TH
Change-Id: Ia5d92149763766576602f5d84a86c67f6fb7e96d
2022-11-22 19:04:17 +00:00
Sudheer Shanka
6fe293bbae Merge "Allow senders to specify the delivery group via matching filters." 2022-11-22 12:01:06 +00:00
Sudheer Shanka
7645452cd1 Allow senders to specify the delivery group via matching filters.
Senders can specify an IntentFilter object that should match
against another broadcast intent to be considered in the same
delivery group.

Bug: 249160234
Test: atest services/tests/mockingservicestests/src/com/android/server/am/BroadcastRecordTest.java
Test: atest services/tests/mockingservicestests/src/com/android/server/am/BroadcastQueueModernImplTest.java
Test: atest tests/app/src/android/app/cts/BroadcastOptionsTest.java
Test: atest tests/tests/content/src/android/content/cts/IntentFilterTest.java

Change-Id: I36f1e3ffab8e30371a9968cb23c7b345c3301682
2022-11-22 01:04:29 +00:00
Ömer Yaveroğlu
e9a45e095b Fix the bug where the added field into the toString implementation does
not have a corresponding %s formatting.

Bug: 239134974
Test: atest frameworks/base/core/tests/coretests/src/android/content/integrity
Test: atest services/tests/servicestests/src/com/android/server/integrity
Change-Id: Ib9c3ecadfc5a823cd4fcd44237b25900f86b4e5c
2022-11-18 22:34:54 -08:00
Patrick Baumann
3daff41c2c Merge "Expanding owners for /pm/" am: 43023f5f04 am: 199e2ed6ba am: 419935579f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2305613

Change-Id: I3225b15bc6295b5977f5f71602552f66075aa9c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-18 05:35:04 +00:00
Patrick Baumann
419935579f Merge "Expanding owners for /pm/" am: 43023f5f04 am: 199e2ed6ba
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2305613

Change-Id: I67c520ee2249c63455d0754c4979fb611a5fb39e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-18 05:00:24 +00:00
Patrick Baumann
199e2ed6ba Merge "Expanding owners for /pm/" am: 43023f5f04
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2305613

Change-Id: I22a8a053aa15ac48b53d4bb8ddfab394291f9ffd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-18 04:33:51 +00:00
Hai Zhang
9ed9b9a5e7 Merge "Expose PermissionInfo.PROTECTION_FLAG_VENDOR_PRIVILEGED as system API." 2022-11-18 00:04:47 +00:00
Patrick Baumann
e0fe83be5c Expanding owners for /pm/
Change-Id: If9e5553ef34004c20ed628c89ba74ae82120c15f
2022-11-17 23:24:19 +00:00
TreeHugger Robot
e27a387a63 Merge "Add constants "short service" foreground service" 2022-11-17 18:24:41 +00:00
Charlie Wang
6908f1db77 WearableSensing framework API for wearables.
WearableSensing framework APIs are intended to be used to interact and
manage the WearableSensingService. The WearableSensingService provides
an isolated service environment for an application to provide a remote
data stream to and run sensing workloads on the data stream. Clients
that want to use this API must hold the permission
MANAGE_WEARABLE_SENSING_SERVICE. The permission protection level is signature|privledged.

API overview: go/wearable-sensing-api
Design doc: go/trusted-glasses

A follow up CL will implement the integration between
WearableSensingService and AmbientContextManager. A subsequent follow up
will also add unit and cts testing.

Bug: 244181656, 249135378
Test: Builds.
Ignore-AOSP-First: to prevent new feature leak.
CTS-Coverage-Bug: 259453662
Change-Id: I0c5e3c5aa01dda9d3289733abd22abfcccc15f96
2022-11-17 08:47:47 -08:00
Makoto Onuki
f36f22de3e Add constants "short service" foreground service
Aslo add the timeout callback.

All APIs are still hidden.

Bug: 257270313
Test: Build
Change-Id: I9868de22a343e97c83cc2524cf81aec159aa62ab
2022-11-16 14:51:40 -08:00
Cintia Martins
9931f45e39 Merge "Fixed Attribution Source’s calling Uid check for multiuser." am: ec48cfcfcd am: 8e151a5245
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2301147

Change-Id: Icadd7fed74b27fdd82248d0f47027d9547d334e8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 21:16:04 +00:00
Cintia Martins
8e151a5245 Merge "Fixed Attribution Source’s calling Uid check for multiuser." am: ec48cfcfcd
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2301147

Change-Id: I8885ae1fbf8bfdd7b5f67f95ad3cad6c81d11b2d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 20:53:25 +00:00
Cintia Martins
ec48cfcfcd Merge "Fixed Attribution Source’s calling Uid check for multiuser." 2022-11-16 20:32:00 +00:00
Nikita Ioffe
4d8c487969 Add FEATURE_VIRTUALIZATION_FRAMEWORK system feature am: bebc71b9e5 am: f58c9ae327 am: 857add4f0a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2255337

Change-Id: I4ab50a9f757b6323b5e2a69e6692a68cfe4bf0c7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 19:09:52 +00:00
Nikita Ioffe
857add4f0a Add FEATURE_VIRTUALIZATION_FRAMEWORK system feature am: bebc71b9e5 am: f58c9ae327
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2255337

Change-Id: I26a7d77afdeab7326ba6f60837cee82afdbfab36
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 09:40:01 +00:00
Nikita Ioffe
f58c9ae327 Add FEATURE_VIRTUALIZATION_FRAMEWORK system feature am: bebc71b9e5
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2255337

Change-Id: I451c598213b1135ee4c979bdd42b7e6c777dfe32
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 09:08:04 +00:00
Nikita Ioffe
757c168f12 Merge changes from topics "avf-sys-feature", "move-avf-jar-to-bcp"
* changes:
  Add com.android.virt-bootclasspath-fragment
  Add FEATURE_VIRTUALIZATION_FRAMEWORK system feature
2022-11-16 08:49:36 +00:00
TreeHugger Robot
9cf31e7381 Merge "Ensure the resource name is validated" 2022-11-16 06:49:46 +00:00
TreeHugger Robot
1abfc04d67 Merge "package-manager: Unhide FEATURE_UWB" 2022-11-16 04:10:26 +00:00
Cole Faust
22deef8d08 Merge "[conflict] Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c am: d3c499dabc" 2022-11-16 03:17:38 +00:00
Jing Ji
cba1edbc25 Merge changes from topic "fgs_246792057_type"
* changes:
  Implement the foreground service type enforcement
  Introduce foreground service type enforcement
2022-11-16 02:03:28 +00:00
Cole Faust
e4abcbec1d [conflict] Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c am: d3c499dabc
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I84d67fdfcc99f9f6fca218d4264ab8e0bc1f1653
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:47:41 +00:00
Cole Faust
d3c499dabc Merge "Fix errorprone warnings that should be errors" am: 677d6cd780 am: f9df26ae3c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I8090e254f06a3b5fc7e9b23fdae6c5bd3db230c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:37:15 +00:00
Cole Faust
f9df26ae3c Merge "Fix errorprone warnings that should be errors" am: 677d6cd780
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2256563

Change-Id: I0e9c5077610407a117ee34ff688b40b52e161a03
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-15 19:11:55 +00:00
Oli Lan
327a277684 Merge "Add isMainUser system API." 2022-11-15 18:05:57 +00:00
Roshan Pius
51c5f7ba66 package-manager: Unhide FEATURE_UWB
UWB now has a 3p facing API surface via androidx. Unhiding the feature
for 3p apps to use.

Bug: 257326947
Test: Compiles
Change-Id: I7071385c509585349bab169797e3d6e32ab425cd
2022-11-15 17:28:56 +00:00
Almaz Mingaleev
69a5f7df1a Clean-up after TZUvA feature removal.
Bug: 148144561
Bug: 198740173
Test: atest FrameworksServicesTest
Test: m
Change-Id: I207cb367209a18df318573c95cd18cd9e3a49c18
2022-11-15 15:19:28 +00:00
Jing Ji
8e4ffc82c2 Introduce foreground service type enforcement
All foreground services are required to declare a type now, or
it'll get a ForegroundServiceTypeNotAllowedException if the app's
target SDK level is Android U or later.

Upon starting the foreground service, the app is required to
have been granted with the proper permissions which are required
by the foreground service types it's starting with.

Deprecated the type "none" and "dataSync", introduced new types:
"heath", "remoteMessaging", "systemExempted" and "specialUse".

The implementation of the enforcement will be in a follow up CL.

Bug: 246792057
Bug: 254662338
Test: atest CtsAppFgsTestCases
Change-Id: I54e60b443df8134653379a6ff13e00ed14d3f194
2022-11-15 05:18:24 -08:00
Oli Lan
f8a6722afc Add isMainUser system API.
This adds an API to determine if the context user is the designated
main user on the device. This user may have access to features which
are limited to a single user on the device.

In Android U, this will be the first user to go through setup.

On regular devices, this will be the system user, but on devices in
No Primary User / Headless System User Mode, it will be a different
user.

The isPrimaryUser System API is confusing because it actually always
returns the system user, even in headless mode. That API is deprecated
in this change.

On devices that are upgrading, if they are non-headless, the system user
will be the main user. If they are headless, the full user with the
earliest creation date will be given the flag.

Bug: 256624031
Test: atest UserManagerTest
Change-Id: Ib36f3b372f9bf33cbb097c4af63eb43515ac835b
2022-11-15 10:47:38 +00:00
felkachang
1e8add8d46 Ensure the resource name is validated
According to the comment of FabricatedOverlaysTests#setResourcesValue,
it describes that the param `resourceName` should be in the form
"[package]:type/entry". However, there is no validation for it.

This patch adds the function ensureValidResourceName to validate the
input param resourceName.

Bug: 205919743

Test: atest OverlayDeviceTests
      # result is http://ab/I87000010106296791

Change-Id: I3327feafe297b697ae295e7a417cba581c482726
2022-11-15 10:04:17 +00:00
Nikita Ioffe
bebc71b9e5 Add FEATURE_VIRTUALIZATION_FRAMEWORK system feature
This feature is used to signal that device supports Android
Virtualization Framework.

Bug: 243512044
Test: m
Change-Id: I0738f26bdd1889b4047132369ace1e80e1a42336
2022-11-15 08:41:34 +00:00
Hai Zhang
ede38006f9 Expose PermissionInfo.PROTECTION_FLAG_VENDOR_PRIVILEGED as system API.
It's already a test API and will be needed in Mainline. All other
protection flags are already APIs except this one.

Bug: 182523293
Test: atest PermissionPolicyTest
Change-Id: I3e6573755b9cb7b2c91071a623295301327f419e
2022-11-14 18:04:05 -08:00
Cole Faust
7da659bb6c Fix errorprone warnings that should be errors
This commit is part of a large scale change to fix errorprone
errors that have been downgraded to warnings in the android
source tree, so that they can be promoted to errors again.
The full list of changes include the following, but not all
will be present in any one individual commit:

BadAnnotationImplementation
BadShiftAmount
BanJNDI
BoxedPrimitiveEquality
ComparableType
ComplexBooleanConstant
CollectionToArraySafeParameter
ConditionalExpressionNumericPromotion
DangerousLiteralNull
DoubleBraceInitialization
DurationFrom
DurationTemporalUnit
EmptyTopLevelDeclaration
EqualsNull
EqualsReference
FormatString
FromTemporalAccessor
GetClassOnAnnotation
GetClassOnClass
HashtableContains
IdentityBinaryExpression
IdentityHashMapBoxing
InstantTemporalUnit
InvalidTimeZoneID
InvalidZoneId
IsInstanceIncompatibleType
JUnitParameterMethodNotFound
LockOnBoxedPrimitive
MathRoundIntLong
MislabeledAndroidString
MisusedDayOfYear
MissingSuperCall
MisusedWeekYear
ModifyingCollectionWithItself
NoCanIgnoreReturnValueOnClasses
NonRuntimeAnnotation
NullableOnContainingClass
NullTernary
OverridesJavaxInjectableMethod
ParcelableCreator
PeriodFrom
PreconditionsInvalidPlaceholder
ProtoBuilderReturnValueIgnored
ProtoFieldNullComparison
RandomModInteger
RectIntersectReturnValueIgnored
ReturnValueIgnored
SelfAssignment
SelfComparison
SelfEquals
SizeGreaterThanOrEqualsZero
StringBuilderInitWithChar
TreeToString
TryFailThrowable
UnnecessaryCheckNotNull
UnusedCollectionModifiedInPlace
XorPower

See https://errorprone.info/bugpatterns for more
information on the checks.

Bug: 253827323
Test: m RUN_ERROR_PRONE=true javac-check
Change-Id: I8446f9076a45ebf7e7ffa06cb0d4ddb1001b6c00
2022-11-14 17:57:30 -08:00
Yurii Zubrytskyi
67a8c66c19 Merge "Replace often searched ArrayList with ArraySet" 2022-11-15 00:19:53 +00:00
Jeremy Meyer
558358612b Merge "implement drawable frros" 2022-11-14 22:35:08 +00:00
Daniel Kim
ba16af7804 Merge "Update the proximity feature to return proximity levels" 2022-11-14 19:02:44 +00:00
Jeremy Meyer
a761f3325e implement drawable frros
Test: unit tests
Bug: 251283316
Change-Id: Iead53711c54596c3787eeba6dcf9ced129f94426
2022-11-14 18:38:12 +00:00