Also changed the Handler parameter to Executor
Bug: 217742182
Test: atest CtsVirtualDevicesTestCases
Change-Id: I0f8f0c6a0f57e773191382da824e53d6ea371f4b
Also changed the Handler parameter to Executor
Bug: 217742182
Test: atest CtsVirtualDevicesTestCases
Change-Id: I3321927b36361168655f4886825955a642fb6c79
Listens to User Restrictions change of DISALLOW_UNMUTE_MICROPHONE to suspend or resume audio injection.
Bug: 195654431
Test: manual testing by go/testdpc pass
Change-Id: Ifedb89172edb0dc6474e078dea0c96f1c7038c4c
Add createVirtualAudioDevice() API in VirtualDevice to return a VirtualAudioDevice object for the caller to capture audio and inject microphone to applications running on the specified virtual display.
The VirtualAudioController in service side will responsible for listening virtual display running applications change, playback and recording config change, then notify the VirtualAudioSession to update AudioRecord/AudioTrack inside the AudioCapture/AudioInjection class internally.
Bug: 201558304
CTS-Coverage-Bug: 218528439
Test: atest FrameworksCoreTests:android.companion.virtual, atest FrameworksServicesTests:com.android.server.companion.virtual, manual testing with Exo by ag/16575248
Change-Id: I74f3da67b76aaa909943fbfc8418bf22d637ca39
- Add additional javadoc for vendor and product ids
- Enumerate full allowed key code set for VirtualKeyEvent
- On cloud devices, CTS fails with 'bad address' for VirtualTouchscreen.
Pass by address rather than by value to solve.
Bug: 216554655
Test: atest CtsHardwareTestCases:android.hardware.input.cts.tests
Change-Id: Ifb233d2b6c4eee1ffdcba218ed17312e67bac6f6
Meta-data will increase the system server ram consumption.
So we decide to use property instead of meta-data to
indicate the primary cdm service.
Test: atest CtsCompanionDeviceManagerCoreTestCases:SelfPresenceReportingTest
Fix: 217953124
Change-Id: I91ebe374bba392d14d693d3c6a36433b5af7cf2a
Replace "would prefer" with stronger language - "requires" - in the
javadoc to AssociationRequest.Builder.setForceConfirmation(boolean) and
AssociationRequest.isForceConfirmation().
Bug: 217366132
Test: m
Change-Id: I7d94598d71a39fc022927634975706ccffeac406
Also update the documentation to more accurately represent what the
flag actually does.
Bug: 217273933
Test: existing tests should pass
Change-Id: I28c9798d7974e58cfcd6ab59e7ee50f9a6c43985
If the permission is not already held by the caller through other means,
this causes unregistration failures, since the unique id disassociation
requires a signature permission. Clear the binding identity if the
permission is found, allowing use of the permisson. This is especially
important for CTS tests, and for access by non-signature apps.
Bug: 217275682
Test: atest CtsHardwareTestCases:android.hardware.input.cts.tests
Change-Id: Ide5232e5b5b5b1b3ca96e5cbfb997e4a1001a583
Due to permission sync feature has been punted to U, the data transfer
APIs need to be hidden.
Bug: 199427116
Fix: 203822629
Test: m and flash
Change-Id: Ibb642827cd9f1708a557af7a8a996826ceec3eb9
For virtual displays that are created through VDM, allow
FLAG_OWN_DISPLAY_GROUP to be added. This applies to every display
created through VDM, because VDM adds this flag on behalf of the caller
by default.
Bug: 194949534
Test: atest DisplayManagerServiceTest.java
Change-Id: I1826dbd0cb7f4c4a76abbf25741b9862c5ff7355
The API allows virtual device owners to listen to when the top activity
of a virtual device's display changes, and when a display becomes empty.
The former is used to display a notification to the user that can say
"Syncing <app name> to your Chromebook". The latter is used so that the
streamed window on ChromeOS side can be closed when the display becomes
empty.
Bug: 194949534
Test: To be added in ag/15781910
Change-Id: I5172e55a3a79b5fadc1719e99160b7675612e97b
These APIs allow Virtual Device owners to configure allow and deny lists of
components which are allowed to be streamed.
Bug: 201559291
Test: To be added in ag/15781910
Change-Id: I5e9297b9fdbe987690e164b7215352e741806fd5
This reverts commit 331be9a643.
Reintroducing ag/16366278 since it seems unrelated to b/214053959 (more details on b/214053959#comment55).
Original commit message:
Migrate unsafe parcel APIs in framework-minus-apex
Migrate the following unsafe parcel APIs in framework-minus-apex:
* Parcel.readSerializable()
* Parcel.readArrayList()
* Parcel.readList()
* Parcel.readParcelable()
* Parcel.readParcelableList()
* Parcel.readSparseArray()
This CL was generated by applying lint fixes that infer the expected
type from the caller code and provide that as the type parameter
(ag/16365240).
A few observations:
* In some classes we couldn't migrate because the class also belonged to
another build module whose min SDK wasn't current (as is the case for
framework-minus-apex), hence I suppressed the lint check
(since I'll eventually submit the lint check to the tree).
* In some cases, I needed to do the cast in
https://stackoverflow.com/a/1080525/5765705 to make the compiler happy
since there isn't another way of providing a class of type
Class<MyClassWithGenerics<T>>.
* In the readSerializable() case, the new API also requires the class
loader, that was inferred to by InferredClass.class.getClassLoader().
* Note that automatic formatting and import rely on running hooked up
to the IDE, which wasn't the case here.
Bug: 195622897
Change-Id: I272432e6e082a973f7a50492ec35d79c2b577c93
Test: TH passes
Prefix CDM's "primary" tag with "android.companion" to bring it in line
with other similar tags used in Android Applications Framework:
- android.service.notification.default_filter_types
- android.view.merge
- android.media.tv.input
etc.
Expand Javadoc for android.companion.CompanionDeviceService
Bug: 198539218
Test: atest CtsCompanionDeviceManagerCoreTestCases
Test: atest CtsCompanionDeviceManagerUiAutomationTestCases
Change-Id: I10fd70c24b6a653dd03e1b74dc682194d867df93
Add launchPendingIntent method on VirtualDevice, which allows specifying
a display ID to launch the pending intent on. For activity intents, this
is equivalent to adding the ActivityOptions with setLaunchDisplayId on
the pending intent. For service and broadcast pending intents,
VirtualDeviceManager will try to catch any trampolines activities
launched by the pending intent creator and start those on the virtual
display instead.
Bug: 194949534
Test: Manual, CTS to be added in ag/15781910
Change-Id: Ia5d6c92167f0ee6c9f246fd4335daa824aceaef9
This CL turns AssociationInfo into an immutable data class and
introduces a typesafe builder pattern for producing modified copies.
Note that this change now also invalidates the user cache entry when
making updates to associations.
Test: atest CtsCompanionDeviceManagerCoreTestCases
Test: atest CtsCompanionDeviceManagerUiAutomationTestCases
Change-Id: Ifd62d2ecce57790b6e462eb23033ca6c9a0cfe1b
Make IOnAssociationsChangedListener.onAssociationsChanged() blocking
(not "oneway") to make sure that the clients of the
addOnAssociationsChangedListener() API (@SystemAPI guarded by a
"signature" permission) are able to prevent race conditions that may
arise if their own clients (applications) effectively get notified
about the changes before system services do.
This is safe for 2 reasons:
1. The addOnAssociationsChangedListener() API is only available to the
system components (guarded by a "signature" permission).
See android.permission.MANAGE_COMPANION_DEVICES.
2. On the Java side addOnAssociationsChangedListener() in CDM takes an
Executor, and the proxy implementation of onAssociationsChanged()
simply "posts" a job to it.
See CompanionDeviceManager.OnAssociationsChangedListenerProxy class.
Bug: 214016641
Test: atest --iterations 10 CtsCompanionDeviceManagerCoreTestCases:AssociationsChangedListenerTest
Test: atest CtsCompanionDeviceManagerCoreTestCases
Test: atest CtsCompanionDeviceManagerUiAutomationTestCases
Test: atest CtsOsTestCases:CompanionDeviceManagerTest
Change-Id: I7c664e9b9c848f8f0291ff46a56ff47bae7db346
postAtFrontOfQueue() instead of post()-ing at the back of the queue
in ICompanionDeviceService.Stub to prevent "posted" methods are invoked
*before* onUnbind()/onDestroy().
Add missing @Override annotation to onDispatchMessage method.
Clean up dispatchMessage() which is not a part of
ICompanionDeviceService interface.
Make the Stub implementation class private.
Bug: 198485833
Bug: 200940347
Test: atest CtsCompanionDeviceManagerCoreTestCases
Test: atest CtsCompanionDeviceManagerUiAutomationTestCases
Test: atest CtsOsTestCases:CompanionDeviceManagerTest
Change-Id: Ic44e7968b1cef42355631151aa6958fe1ec7dd6e