This patch preserves the synchronous nature of audio focus requests,
even when an external focus policy is installed.
When focus is requested, the request is blocked on
the client-side, while AudioService informs the external
policy of the request, and until the ext policy responds
with the focus request result for this client, or
it times out.
The new AudioPolicy API is the call for the external policy
to send the focus request result.
Bug: 63906162
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases -t 'com.google.android.gts.audio.AudioHostTest#testFocusPolicy'
Change-Id: I4671517f7f00eaaed8748bd4013b7d20be3085fb
This includes two changes.
- Change all methods in MediaSession2.BuilderBase signatures from
public to package private.
- Subclasses of MediaSession2.BuilderBase (MediaSession2.Builder,
MediaLibraryService2.MediaLibrarySessionBuilder) now inherit all
methods from its super class and change method signatures to public
Changes are needed to workaround and fix following issues.
- Hidden super class's methods aren't shown in the Javadoc and 3rd
party apps cannot use them.
- Public generic methods in the super classes are shown in the Javadoc
with the generic types (e.g. 'U setSessionCallback()' instead of
'Builder setSessionCallback()')
- Stub classes for tests are automatically generated, but it somehow
fails to generate stub for the BuilderBase (seems like a bug)
Test: 'm update-api' and checked generated javadoc
Change-Id: I6f635624ef806578ab79d080424f11cb637d7984
* changes:
MediaSession2: Rename BrowserRoot to LibraryRoot and move to updatable
MediaSession2: Move MediaSession2.CommandButton to updatable
MediaSession2: Move MediaSessionService2.MediaNotification to updatable
There are several places across the OS where Java code is simply
copying data between two points, which requires bringing that data
out into userspace before going back into the kernel. (That's pretty
lame.) The patches for the recent Meltdown/Spectre security issues
have made this overhead even worse, so it's finally time to move this
copying directly into the kernel.
This change adds a couple new FileUtils.copy() methods which inspect
the given streams/FDs, and attempt to do as much optimization as
possible before falling back to a slower userspace-based copy.
Benchmarks are showing typical improvements of 44% for 32KB files,
50% for 32MB files, and 35% for 32MB pipes.
Plenty of tests are included, and there's a simple kill-switch that
can be used to enable/disable the feature if it starts causing any
trouble. (A future CL will enable the optimizations.)
Test: bit FrameworksCoreTests:android.os.FileUtilsTest
Test: vogar --mode app_process --benchmark frameworks/base/core/tests/benchmarks/src/android/os/FileUtilsBenchmark.java
Bug: 71932978
Change-Id: I52518d529da5d961610998b9f61399064d8025cd
This is the preliminary step toward permission check.
Bug: 72618604
Test: Run all MediaComponents test once
Change-Id: I64679dce0c70fd322fa7819e4ba15ba52601d021
Added more explanations for onFftDataCapture method.
Fixed some syntax errors.
Bug: 65673222
Test: make docs
Change-Id: Ia793e90061de9bf78ba2774102ceccc766c74e27