Commit Graph

6363 Commits

Author SHA1 Message Date
Jean-Michel Trivi
e2d8aae2cc Synchronous audio focus behavior with external focus policy
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
2018-02-05 10:56:58 -08:00
TreeHugger Robot
1eb7d64ace Merge "Fix typo in MicrophoneInfo" 2018-02-02 19:09:30 +00:00
TreeHugger Robot
abb5014912 Merge "Docs: Update JavaDocs for Visualizer.OnDataCaptureListener" 2018-02-02 17:51:23 +00:00
TreeHugger Robot
928835ebf1 Merge "MediaSession2: Workaround javadoc issue with hidden generic super class" 2018-02-02 11:00:19 +00:00
TreeHugger Robot
89a9fb5866 Merge "VV2 and MCV2: Override onLayout of ViewGroup and remove MCV2.isShowing()" 2018-02-02 09:18:30 +00:00
Jaewan Kim
25749c6a23 MediaSession2: Workaround javadoc issue with hidden generic super class
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
2018-02-02 18:11:48 +09:00
TreeHugger Robot
e851d7c662 Merge "MediaSession2: Use VolumeProvider2 instead of VolumeProvider" 2018-02-02 08:53:05 +00:00
TreeHugger Robot
677fb050f7 Merge "MediaPlayer2: remove setRetransmitEndpoint" 2018-02-02 07:03:10 +00:00
Hyundo Moon
71bb3176a9 MediaSession2: Use VolumeProvider2 instead of VolumeProvider
Bug: 72616099
Test: Builds successfully
Change-Id: Ic125d017f411ea36c9ae1fa22ec4fde5656187f7
2018-02-02 15:51:15 +09:00
Insun Kang
8589b7b34b VV2 and MCV2: Override onLayout of ViewGroup and remove MCV2.isShowing()
- Overriding onLayout() is needed as VideoView2 and MediaControlView2
extends ViewGroup.
- Removes MediaControlView2's isShowing() method, since it looks
redundant API.

Test: build, VideoViewTest app
Change-Id: If4608ab56ca3f3883cb674c857f7e53e2dd0e73e
2018-02-02 14:21:19 +09:00
Wei Jia
23c46f88eb MediaPlayer2: remove setRetransmitEndpoint
Test: MediaPlayer2 plays
Bug: 63934228
Change-Id: Ifc5ef24175405acde6c65af51c7e85d2bfc01f87
2018-02-01 18:36:46 -08:00
Insun Kang
0d2107bf88 Merge "Make VV2 & MCV2 extend ViewGroup" 2018-02-02 01:40:48 +00:00
jiabin
6509c9aae3 Fix typo in MicrophoneInfo
Bug: 64038649
Test: run cts
Change-Id: I8e84aa5560cdaa5d05d28008f669a292e8b6c96e
2018-02-01 15:20:53 -08:00
TreeHugger Robot
7902b4a1b2 Merge "Add AudioFormat.ENCODING_E_AC3_JOC" 2018-02-01 22:03:22 +00:00
Jeff Sharkey
850f29a169 Merge changes Iac97c342,I52518d52
* changes:
  Enable sendfile() and splice() optimizations.
  Use sendfile() and splice() to speed up copying.
2018-02-01 21:08:52 +00:00
Mikhail Naganov
29f479d502 Merge "Add audio presentation interface to Java API" 2018-02-01 16:46:07 +00:00
Christofer Åkersten
f38d8fb934 Make VV2 & MCV2 extend ViewGroup
Test: VideoViewTest
Change-Id: I91410847de55bef834360d99fcb112b50cef1cea
2018-02-01 21:41:53 +09:00
TreeHugger Robot
899715b9d7 Merge changes from topics "mediasession2_libraryroot", "mediasession2_commandbutton", "medianotification_updatable"
* changes:
  MediaSession2: Rename BrowserRoot to LibraryRoot and move to updatable
  MediaSession2: Move MediaSession2.CommandButton to updatable
  MediaSession2: Move MediaSessionService2.MediaNotification to updatable
2018-02-01 11:46:13 +00:00
Jaewan Kim
ac9edc37db MediaSession2: Rename BrowserRoot to LibraryRoot and move to updatable
Renaming was the one of the feedback from ag/3506231

Test: Run all MediaComponents tests once
Change-Id: I6499070502cd0e20ea53a1447278d680e586dec7
2018-02-01 16:56:37 +09:00
Jaewan Kim
435142badc MediaSession2: Move MediaSession2.CommandButton to updatable
Bug: 72665718
Test: Run all MediaComponents test once
Change-Id: I5e6b382695b9d8c2f9634531ded32fdac438965c
2018-02-01 16:56:23 +09:00
Jaewan Kim
a7cf21b468 MediaSession2: Move MediaSessionService2.MediaNotification to updatable
Test: Run all MediaComponents tests once
Change-Id: Ieb38e1181f2ed9e96c3218ca0fdc3c1d13424af7
2018-02-01 16:53:55 +09:00
TreeHugger Robot
faf852539a Merge "Support query active microphones in MediaRecorder." 2018-02-01 07:52:55 +00:00
Jeff Sharkey
b18f899241 Use sendfile() and splice() to speed up copying.
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
2018-01-31 21:47:22 -07:00
TreeHugger Robot
23a7b8d36b Merge "Support query active microphones information in AudioRecord." 2018-02-01 01:35:26 +00:00
TreeHugger Robot
490d323003 Merge "Add support for getting all available microphones characteristics." 2018-01-31 22:20:25 +00:00
Julia Reynolds
ce9bcc4977 Merge "Show the connected device more reliably" 2018-01-31 14:21:57 +00:00
TreeHugger Robot
2e3569d711 Merge changes from topics "move_playbackstate2", "command_code"
* changes:
  MediaSession2: Move PlaybackState2 to updatable
  MediaSession2: Polish command codes
2018-01-31 14:17:27 +00:00
Jaewan Kim
bc55661b11 Merge "MediaSession2: Hide system apis" 2018-01-31 14:12:56 +00:00
Hyundo Moon
c79d6b4fdf MediaSession2: Move MediaController2.PlaybackInfo to updatable
Bug: 72716294
Test: Builds successfully
Change-Id: I6c1f7afdc49df6fe345db17fc41563a511c665e0
2018-01-31 20:55:02 +09:00
Jaewan Kim
f029ae9511 MediaSession2: Move PlaybackState2 to updatable
Test: Run all MediaComponents test once
Bug: 72670371
Change-Id: Ic7953bf4bb7841238dec7082d8e9d9b412775e6d
2018-01-31 17:50:26 +09:00
Hyundo Moon
196e1de5af MediaSession2: Create VolumeProvider2
Bug: 72721358
Test: Builds successfully
Change-Id: Ia7eca3f92deff7ba3fd5633d94748b0b80e86104
2018-01-31 17:04:57 +09:00
Jaewan Kim
71a96f27c6 MediaSession2: Polish command codes
This is the preliminary step toward permission check.

Bug: 72618604
Test: Run all MediaComponents test once
Change-Id: I64679dce0c70fd322fa7819e4ba15ba52601d021
2018-01-31 17:01:13 +09:00
Sungsoo Lim
7d30e1c554 MediaSession2: Hide system apis
Test: build
Change-Id: I6c56c260a002086bbd2c20420b301c66635215c3
2018-01-31 15:43:55 +09:00
TreeHugger Robot
2043082f96 Merge "Move View related methods to helper class" 2018-01-31 04:48:32 +00:00
Christofer Åkersten
a6c97e4615 Move View related methods to helper class
Test: Instantiate MediaControlView2
Change-Id: Ia958a97b38e67f236ee510978c379af9249d2887
2018-01-31 11:27:40 +09:00
Christofer Åkersten
622b1f1b64 Move MediaSession2 builder to impl
Bug: 72665881
Test: runtest-MediaComponents
Change-Id: I22a299dac9d9576e4383fe9538fe696f09afaae5
2018-01-31 11:12:06 +09:00
TreeHugger Robot
4cc91d0611 Merge changes from topics "rating2_updatable", "mediasession2_playlistparams", "mediametadata2_updatable"
* changes:
  MediaSession2: Move Rating2 to updatable
  MediaSession2: Move MediaSession2.PlaylistParams to updatable
  MediaSession2: Move MediaMetadata2 to updatable
2018-01-30 23:41:35 +00:00
Julia Reynolds
24cc759de9 Show the connected device more reliably
Test: manual
Change-Id: Ief39215321e0a283f724dd0b0cdf5b9eeab1e116
Fixes: 72494077
2018-01-30 16:56:52 -05:00
Mikhail Naganov
2a56f09c51 Docs: Update JavaDocs for Visualizer.OnDataCaptureListener
Added more explanations for onFftDataCapture method.
Fixed some syntax errors.

Bug: 65673222
Test: make docs
Change-Id: Ia793e90061de9bf78ba2774102ceccc766c74e27
2018-01-30 11:55:46 -08:00
Insun Kang
dda4a8e17b Merge "VideoView: Change showSubtitle() to get boolean parameter" 2018-01-30 15:40:35 +00:00
TreeHugger Robot
cbd5a384d7 Merge "MediaController2: Rename onAudioInfoChanged" 2018-01-30 13:19:26 +00:00
Jaewan Kim
bb6ca486d1 MediaSession2: Move Rating2 to updatable
Test: Run all MediaComponents tests once
Bug: 72670051
Change-Id: I5c405e34569c1ccc469dad09bbc8aad1cd7fdcf4
2018-01-30 22:13:16 +09:00
Jaewan Kim
3117c0c263 MediaSession2: Move MediaSession2.PlaylistParams to updatable
Bug: 72670266
Test: Run all MediaComponents tests once
Change-Id: I5bf0ae9b97f2f60baabfe05e9df893308ee8d41a
2018-01-30 22:13:05 +09:00
Jaewan Kim
f641c09772 MediaSession2: Move MediaMetadata2 to updatable
Bug: 72670468
Test: Run all MediaComponents test once
Change-Id: I2351f63e00a3ed6adfe5a61b995fd8143d67bb35
2018-01-30 22:12:53 +09:00
Insun Kang
4fa8064378 VideoView: Change showSubtitle() to get boolean parameter
- Adds VideoView2 attributes
  - enableControlView
  - showSubtitle (boolean)
  - viewType (enum)
      - surfaceView
      - textureView

- showSubtitle() --> showSubtitle(boolean)
- hideSubtitle() removed.

Test: build

Change-Id: Ib21722af1c9c1caf036e047a18d27d46097e8f03
2018-01-30 21:42:58 +09:00
Hyundo Moon
a79de7da8b MediaController2: Rename onAudioInfoChanged
This CL renames the controller callback method onAudioInfoChanged into
onPlaybackInfoChanged.

Bug: 72616099
Test: Builds successfully
Change-Id: I6a0059790d65b55fdb6edcab18743fd94c4bdf6c
2018-01-30 18:37:17 +09:00
TreeHugger Robot
ff3ba299ae Merge "Make MediaSession2.CommandGroup updatable" 2018-01-30 07:58:14 +00:00
TreeHugger Robot
916cdd364c Merge "Remove show/hide API" 2018-01-30 07:55:32 +00:00
TreeHugger Robot
11890afe54 Merge "Make MediaSession2.Command updatable" 2018-01-30 05:33:32 +00:00
Sungsoo Lim
fe46402e22 Make MediaSession2.CommandGroup updatable
Bug: 72665979
Test: build
Change-Id: I1ba53c0bd5eb8b72847733693f4975d53e97f2d9
2018-01-30 13:37:33 +09:00