39 Commits

Author SHA1 Message Date
Sungsoo Lim
420c2fc155 Move media/apex to apex/media
And fix some lint warnings.

Test: build & boot
Change-Id: Ib59aa788b02e5bf77dd1355766adbb57860cf737
2020-01-03 23:10:32 +09:00
Anton Hansson
791551a70f Stop building against core_platform where possible
This is not a stable API surface, so modules shouldn't be building
against it. Compiling against core_platform also disables link-checking,
which can hide other problems.

Bug: 137191822
Test: m
Change-Id: I7ce7dad8c02b094c565daf8c178bc6f89bb610ef
2019-12-21 08:11:31 +00:00
Ytai Ben-tsvi
0d52f4202c Merge changes from topic "soundtrigger_refactor"
* changes:
  Migrate SoundTrigger implementation to new service
  Implement the soundtrigger_middlewware service
  Add a permission for preempting sound trigger sessions
  Sound trigger middleware service definition
  Add audio.common types AIDL definition
2019-12-17 22:33:55 +00:00
Anton Hansson
b520939fda Make updatable-media use defaults for droidstubs
Test: m
Change-Id: I8ba874bbec920fcc3832549e12d440701d5bdbbe
2019-12-17 08:10:23 +00:00
Ytai Ben-Tsvi
93c117c86f Implement the soundtrigger_middlewware service
This service is intended to replace:
frameworks/av/include/soundtrigger/ISoundTriggerHwService.h

This change only adds the replacement service, follow up
changes migrate the clients to use the new service and remove
the old one. The new service is feature-equivalent to the new
one, but offers the following advantages:
- AIDL interface (as opposed to hand-written parceling code).
- Pure Java implementation all the way to the HAL.
- Better documentation.
- Rigorous error handling.
- Unit tests.
- Reduced code complexity (less layers, better separation of
  concerns).
- Permission-based security model (as opposed to some baked-in
  assumptions about process affinity).

Change-Id: I79f4eff105d3e6245990be068b933d4d48c35a0d
Bug: 142070343
2019-12-16 14:15:37 -08:00
Ytai Ben-Tsvi
ab58ef6483 Sound trigger middleware service definition
These are the AIDL files that define the sound trigger middleware
interface.
This service is intended to replace the existing
frameworks/av/include/soundtrigger/ISoundTriggerHwService.h
using AIDL in order to avoid a large amount of hand-written
parceling code and other forms of boilerplate, and provide
cross-language support.

Change-Id: Ia783ba4f1ea7335a984396e7024cac0411699403
Bug: 142070343
2019-12-13 10:32:44 -08:00
Jiyong Park
119afc0695 SystemApi is parameterized
We have decided to reuse the existing annotation @SystemApi for all Java
APIs regardless of whether they are for apps or platform internal
modules. This was because introducing new annotation types every time
when we have to create new API surfaces will only increase the confusion
without giving much benefit.

Instead, to differenciate the different API surfaces of @SystemApi, the
annotation type is parameterized. Specifically, it has to axises.

client: specifies the intended client of the API.

process: specifies the process(es) that the API is available.

The default for client and process are priv-apps and all, respectively,
which corresponds to the today's @SystemApi for privileged apps like
GMS.

Bug: 140202860
Test: m
Change-Id: I3305b71e22970e80db95f3daf3d7713603c7d68d
2019-12-13 14:58:16 +09:00
Ytai Ben-Tsvi
d58b04ae47 Add audio.common types AIDL definition
This is a subset of the types defined in
hardware/interfaces/audio/common/2.0/types.hal.
Specifically, the subset that sound trigger depends on.
These files were auto-generated using the hidl2aidl tool, and
later manually edited to workaround some missing features in
the conversion tool or AIDL (mostly around enum support).

Change-Id: I1c0ffe8a2ebaf09eb4516beaaf4b6fc80985bfc9
Bug: 142070343
2019-12-12 15:10:35 -08:00
Santiago Seifert
a4be466265 Add initial implementation of MediaParser
Bug: 132153067
Bug: 134057371
Test: Pending.
Change-Id: I2d2881df34a6f4da13bfefffb58194eaaab6b4e3
2019-12-05 11:47:17 +00:00
Santiago Seifert
964f541d9b Add initial stubs for MediaParser
Bug: 132153067
Bug: 134057371
Test: Only stubs submitted.
Change-Id: I1107492445126127a92649abf97268c817cedf1b
2019-11-18 19:16:13 +00:00
Marco Nelissen
a9a802f976 Remove MediaPlayer2
Bug: 141546997
Test: build, boot
Change-Id: I1550c14f3a0967910809cc2415d10f62c967bd44
2019-09-24 12:47:41 -07:00
Jiyong Park
20426538f8 Cut the dependency to framework from droiddoc modules
droiddoc modules for the SDK API documentation and stubs library
generations have depended on the 'framework' (which was recently changed
to framework-minus-apex' module to get the list of Java source files to
be processed.

This however caused a circular dependency when we tried to modularize
some classes in the framework library as a separate library. The
separate java library depended on the stubs library (because it should
only use SDK APIs) and the stubs library depended on the framework
library. The framework library itself depended on the separated library
(or its stub) to use APIs from the separated library, thus forming a
circular dependency.

This change fixes the problem by directly giving the framework source
files via a filegroup `framework-sources-to-document` where all Java
and AIDL files that are to be documented are included in.

This change also put the generated R.java and Manifest.java files from
framework-res into the filegroup for framework sources.

Bug: 70046217
Bug: 135922046
Test: m

Change-Id: I09ad88da47540d31ad089aad5e1151a4b6877ec2
2019-08-29 07:44:38 +09:00
Jiyong Park
d2411f730f Remove -without-aidls filegroups for the media apex.
When there is no *.aidl file in a filegroup, include path for the aidl
compiler is not set to the path property of the filegroup. This blocks
the plan to cut the dependency from API stubs libs to the framework,
because then we have to rely on the include paths deducted from the
input filegroups, rather than AIDL include paths exported from the
framework.

To make that happen, this change first removes the *-without-aidls
filegroups and replace the reference to them with the corresponding file
groups having AIDLs. Adding the AIDL files for media apex to the API
stubs is fine because the AIDL files are @hidden ones.

Bug: 70046217
Bug: 135922046
Test: m

Change-Id: I794f6d0a7bcbef311d345d6e18ca311800af8ef4
2019-08-27 11:30:21 +09:00
Jiyong Park
2230dce13b Set path property for filegroup modules
The path property specifies the base directory for Java files. This can
be used by the build system to filter (or filter-out) Java files by
their package names.

Bug: 135922046
Test: m
Change-Id: I6bece92e702b560e53bc087b5960bff577dc3175
2019-08-21 15:54:37 +09:00
Kun Niu
6eff1d439b add java_api_finder plugin to mainline module Media to generate java APIs used by Media.
Bug: 129294170
Test: m updatable-media RUN_ERROR_PRONE=true |& tee media_error_prone.out
Change-Id: I3cdfe5e00394c6ff7b9c857f63a5e45ac79f8d24
2019-07-02 19:58:47 +00:00
Paul Duffin
8fcace4404 Replace no_framework_libs: true with sdk_version: "core_platform"
(cherry picked from commit 7954524e3cc618830f0bf7b23687bf222ecd285b)

Bug: 134566750
Test: m
Change-Id: I0260942108a13cc5e9bed1d6005abfb8daffe0ac
Exempt-From-Owner-Approval: minor build change
2019-06-19 10:48:09 +01:00
Dongwon Kang
9b505e984b Remove MediaPlayer2 from media apex.
Test: build, atest MediaSession2Test
Bug: 130637522
Change-Id: I65a8bc3e483d8653da6afa55d442185a554d5901
2019-04-16 11:53:09 -07:00
Sungsoo Lim
5562ab8966 Remove MediaItem2
Bug: 130579223
Test: build
Change-Id: Ie772b508b51a12eb4e96f1f19c08ecdec4a9959b
2019-04-16 09:28:11 +09:00
Vladimir Marko
c631e8f204 Restrict updatable-media to android.media package.
Test: m
Bug: 122937705

(cherry picked from commit d634f2b44e5d029d685068ecd86df7c734f1e296)

Change-Id: Ie246387748fd7410b8cc8270bd123c71df07ef2a
Merged-In: I7cad8971d1dcf301cc7d0a8c15ebde9e14d1e18a
2019-04-09 16:35:37 +01:00
Dongwon Kang
77ab98645a Use ProxyFileDescriptorCallback instead of DataSourceCallback
Test: MediaPlayer2Test
Bug: 128461264, Bug: 126701061
Change-Id: Id971c77bf9a3003e2f24b716ad784b5f2f56f55f
2019-03-21 22:05:48 -07:00
Insun Kang
291318d5f4 Remove duplicated classes with framework.jar from updatable-media.jar
Bug: 111107855
Test: Sucessfully build with aosp/884112
Change-Id: Ic3c93ab395ccfae6150297bf6447043f928a01c5
2019-02-13 11:52:46 +09:00
Dongwon Kang
27ee190766 Clean up on metalava_updatable_media_args
Test: TH
Bug: 123253805
Change-Id: I640280ba93b7424418c4ba28eaa39e7fc2b1ef46
2019-02-04 14:19:38 -08:00
Dongwon Kang
e6e5f41302 Move Session2Token to media apex
Test: build
Change-Id: Id55fe0fa8596f98a84f5bdc89755631b18c7d308
2019-01-31 15:33:41 -08:00
Insun Kang
d5fa8155ec Add updatable_media_stubs to prevent private API use.
Also resolve dependency cycle between framework and updatable-media.

Bug: 123551910, Bug: 123253805
Test: build
Change-Id: I220bc32319b53d77a14b7e9a36ab0faca0003d66
2019-01-31 15:33:41 -08:00
TreeHugger Robot
d73433cf25 Merge "VideoSize: replace with Size" 2019-01-31 17:35:13 +00:00
Wei Jia
a3aac960ba VideoSize: replace with Size
Test: cts
Bug: 123661223
Change-Id: I31bfdf7a50a865854034e6c4fa0515e0c028f1a9
2019-01-30 17:22:38 -08:00
Hyundo Moon
83ff14c310 Move Media 1.0 files in mainline back to framework
Test: make update-api -j; make -j;
atest CtsMediaTestCases:android.media.cts.MediaSessionTest;
atest CtsMediaTestCases:android.media.cts.MediaControllerTest;
atest CtsMediaTestCases:android.media.cts.MediaBrowserTest;
Change-Id: Ie30f0ca86bd9303683bf6573f2f5858c6fb3206a
2019-01-30 22:03:04 +09:00
Sungsoo Lim
15c52f693d Move Rating and MediaDescription into mainline module
Bug: 119539695
Test: pass MediaSessionTest, MediaControllerTest and
      MediaSessionManagerTest
Change-Id: I2274a473700b6ea432e368aeeb5201d449d53635
2019-01-30 13:58:31 +09:00
Hyundo Moon
a17bf2d0f2 Move MediaMetadata class back to framework
Due to the @UnsupportedAppUsage on
MediaMetadata.getKeyFromMetadataEditorKey, we'd better not to move the
class to APEX. This CL moves the MediaMetadata back to framework.

Also, in order to avoid hidden framework API usages in mainline module,
this CL moves the usage of hidden constructor of MediaMetadata.Builder()
from MediaSessionEngine to MediaSession.

Bug: 123488217
Test: make update-api -j; make -j;
      vendor/google/tools/flashall;
      atest CtsMediaTestCases:android.media.cts.MediaSessionTest;
      atest CtsMediaTestCases:android.media.cts.MediaControllerTest;
Change-Id: I21b4f0f59214478071bb0eafa93bb9538e44bf4e
2019-01-29 17:16:50 +09:00
Hyundo Moon
14ca142e65 Ensure that framework does not refer MediaSession2 related code
Also, this CL moves mediasession2 to com.android.media apex.

Bug: 123495968
Test: Passed below tests:
atest CtsMediaTestCases:android.media.cts.MediaSession2Test;
atest CtsMediaTestCases:android.media.cts.MediaController2Test;
atest CtsMediaTestCases:android.media.cts.MediaItem2Test;
atest CtsMediaTestCases:android.media.cts.MediaSession2ServiceTest;
atest CtsMediaTestCases:android.media.cts.Session2CommandGroupTest;
atest CtsMediaTestCases:android.media.cts.Session2CommandTest;
Change-Id: I8cf7a657545e6b7b2973035f365506206e7147a0
2019-01-29 09:12:54 +09:00
Hyundo Moon
c1e4316e02 Remove MediaController2 usages in MediaSessionServiceImpl
Bug: 123336670
Test: Passed below tests
      MediaSessionManagerTest#testNotifySession2Created/Destroyed*
Change-Id: I25a20bf9e8a78920f2219d22b81b899af665ed32
2019-01-25 18:52:44 +09:00
Sungsoo Lim
64ed009399 Separate updatable-media library
Test: build
Change-Id: If83855f36a7ed8bb7675e43c7c789fc9cc2b6923
2019-01-24 14:53:27 +09:00
Sungsoo Lim
4e475438ad Move MediaBrowser API into updatable media
Bug: 119539966, Bug: 119538799
Test: build and boot,
    atest CtsMediaTestCases:android.media.cts.MediaBrowserTest,
    atest CtsMediaTestCases:android.media.cts.MediaBrowserServiceTest
Change-Id: I7afed77e61506a1b4ea57ac41eee62bfcda01a74
2019-01-24 04:45:47 +09:00
Sungsoo Lim
bb3b401d42 Add build rule for updatable media 1.0 APIs
Bug: 119539849, Bug: 119539141
Test: build and boot,
    atest CtsMediaTestCases:android.media.cts.MediaSessionTest,
    atest CtsMediaTestCases:android.media.cts.MediaControllerTest
Change-Id: Iaf07842de5aa00da5987b993b77960efa9a602bf
2019-01-24 04:34:34 +09:00
Insun Kang
f86a56c591 Add build rule for media2-abi-*
- media2-abi-* included in updatable-media.jar
- Moves the media2-abi files into media/apex
- Resolves a hidden api usage

Bug: 123209084
Test: build
Change-Id: I9f9b0b9c288da5c7acbfedcb56867ff405ac0d61
2019-01-24 04:34:19 +09:00
Dongwon Kang
0d035539c2 Include updatable-media.jar in bootclasspath & apex
Test: build & boot & MediaPlayer2Test
Bug: 112766913
Change-Id: I66e0b5f9e12f14b1758c0281caac0dfdfe0b5729
2019-01-17 13:35:03 -08:00
Dongwon Kang
8afd5319b0 Separate out mediaplayer2 code from framework
"media2.jar" is renamed to "updatable-media.jar" in order to
show its purpose clearly.

Test: build & boot & MediaPlayer2Test
Bug: 112766913
Change-Id: Ia2ea05e0ed1a8bb2cfea20c9e2585e3d3cbfffd9
2019-01-17 13:33:58 -08:00
Insun Kang
b3517bf1fe Initial code for AML MediaSessionService
Bug: 123000882
Test: build / manually
Change-Id: If2234340ed835fa02dcdbd1fd1b968418fe0a8ac
2019-01-17 19:32:12 +09:00
Dongwon Kang
43c88f346e Add media2 build target to prevent hidden API usage in MediaPlayer2
The only hidden API usuage, c-tor of TimedText, is temporarily commented
out.

Test: make media2
Bug: 112766913
Change-Id: I6330724e65bb42db678f23134677dfd8675a3970
2018-12-11 18:30:27 -08:00