Commit Graph

9283 Commits

Author SHA1 Message Date
Amy Zhang
3dc7efafbf Add DTMB Frontend Type, Settings and Capabilities.
DTMB is only supported in Tuner HAL 1.1 or higher.
Tuner framework does version check to make sure enought support from HAL
implementation.

Tuner.tune and Tuner.scan with DTMB settings running on Tuner HAL 1.0
implementation would be no-op.

Test: atest android.media.tv.tuner.cts
Bug: 159064654
Change-Id: Ic2f759cc92fee75ae94b72e233fd6c4448359a67
2020-10-14 17:11:04 -07:00
Amy Zhang
313c4a9958 Merge "Add 1.1 Tuner frontend setting into Tuner java Framework" 2020-10-14 23:21:29 +00:00
Amy Zhang
a0267d540a Merge "Add context id setter in the IpFilterConfiguration" 2020-10-14 20:36:46 +00:00
Amy Zhang
3e7c28632d Add 1.1 Tuner frontend setting into Tuner java Framework
This CL adds the Tuner 1.1 extended frontend setting options into
Tuner Java system APIs.

Including the following settings:
General Frontend Settings: Spectral Inversion, End Frequency
Dvbt Settings: plp rotation, extended transmission mode
Dvbs Settings: scan type.

Test: make
Bug: 158818695
Change-Id: I0d80f244ad29a73458e66ee012c48b9dbde356be
2020-10-14 10:52:37 -07:00
Amy Zhang
646c1129ad Add link/unlinkFrontendToCiCam APIs in Tuner java
These APIs are only supported in Tuner 1.1 or higher

Test: atest android.media.tv.tuner.cts
Bug: 158818696
Change-Id: I1df5b8b908455d47dbe183070456b15116b75cb7
2020-10-13 18:54:04 -07:00
Amy Zhang
de5715ea6f Add context id setter in the IpFilterConfiguration
Test: make dist
Bug: 153595125
Change-Id: Ie949ea0c108cb020f028cf0ce24020235762d0cb
2020-10-13 18:53:56 -07:00
Amy Zhang
4a11c4408f Merge changes from topic "filterid"
* changes:
  Add TunerVersionChecker  to expose the Tuner HAL implementation version
  Make Tuner java framework and Tuner JNI adopt Tuner HAL 1.1
2020-10-14 00:32:06 +00:00
Amy Zhang
7b3b578d50 Add TunerVersionChecker to expose the Tuner HAL implementation version
This can help Tuner java/cts get the information of the Tuner HAL
implementation version and notify the client on the availability of
the APIs in different versions or test with different expected result.

Users can all access getTunerVersion to get the information.

Test: atest android.media.tv.tuner.cts
Bug: 158816517
Bug: 164449999
Change-Id: I0b6e4c226e696ca7f94dff7d2c9a59f57af7e13a
2020-10-13 14:30:35 -07:00
Amy Zhang
b13e3042f3 Make Tuner java framework and Tuner JNI adopt Tuner HAL 1.1
Please see the Tuner HAL 1.1 design doc here:
go/android_tuner_hal_1.1

In this CL, the Tuner framework and JNI start to use the
@1.1::IFilter.getId64Bit() API and @1.1::IFilterCallback.

Currently the 1.1 IFilterCallback passes two new 1.1 record filter
events: DemuxFilterTsRecordEvent and DemuxFilterMmtpRecordEvent.

Tuner Framework exposes a new API: getId64Bit() which calls
the native getId64Bit. Also Filter java will be using long id
instead of the previous int id.

The FilterCallback interface remains unchanged but the TsRecordEvent
and the MmtpRecordEvent carry more variables to pass the extra info
in version 1.1.
When the HAL implementation is on version 1.0 and calls
onFilterEvent, it still uses the extended TsRecordEvent and
MmtpRecordEvent but the 1.1 field will be set to invalid.

Related HAL interface can be referred here:
hardware/interfaces/tv/tuner/1.1

Test: make -j44 dist, atest android.media.tv.tuner.cts
Bug: b/159058358
Bug: 158816517

Change-Id: I8d52c0b2031eed9c54909e5bf233137c56eeb78f
2020-10-13 14:28:31 -07:00
Charles Chen
558cee47d3 Merge "Add foldable support for RouteInfo#getPresentationDisplay" 2020-10-13 05:59:53 +00:00
TreeHugger Robot
83b6828015 Merge "Add MediaCodec.CryptoInfo.getPattern" 2020-10-12 19:11:44 +00:00
Santiago Seifert
09ae5f60a9 Add MediaCodec.CryptoInfo.getPattern
Allows MediaParser and MediaExtractor clients to know the
encrpytion pattern of the parsed/extracted media. Without
the getter, only MediaCodec can know the pattern, which
impossibilitates the use of app-bundled decoders.

Bug: 158743263
Test: atest CtsMediaTestCases:MediaCodecTest.testCryptoInfoPattern
Change-Id: Iaf77c8ecafad093cfa434a9ac31314895a44e78f
2020-10-12 16:53:44 +01:00
TreeHugger Robot
93a933d5ed Merge "Expose video codec type in MediaMetadataRetriever" 2020-10-12 14:57:36 +00:00
Charles Chen
9ba52e22a5 Add foldable support for RouteInfo#getPresentationDisplay
In this CL, RouteInfo#getPresentationDisplay by following order:
1. Connected Wifi displays (Ex: chromecast)
2. Attached external displays (Ex: an external display plugged by HDMI)
3. Non-default built-in displays

Test: MediaRouteInfoTest
Bug: 130035480
Change-Id: Ib2dd63217ebe415c2bda57f60e42713ca325f56e
2020-10-12 19:05:49 +08:00
Hyundo Moon
41a7b5aee4 Merge "Resolve API review for MediaMetadata#getBitmapDimensionLimit" 2020-10-12 04:34:28 +00:00
Hyundo Moon
4b354a774d Resolve API review for MediaMetadata#getBitmapDimensionLimit
Following changes are included:
 - Added @IntRange for getBitmapDimensionLimit()
 - Used Integer.MAX_VALUE for 'no scaling was applied'
   - Accordingly, made the @IntRange start from 1 (previously zero)

Bug: 168215839
Test: Ran CTS
Change-Id: Ia7687545aa778425357c31e32738c1a25794086c
2020-10-11 08:57:45 +09:00
Chong Zhang
9fc0e10936 Expose video codec type in MediaMetadataRetriever
bug: 163086057
test: android.media.cts.MediaMetadataRetriever

Change-Id: I337963b6e377001002170359d7d2a7300e3f59bc
2020-10-10 02:06:30 +00:00
TreeHugger Robot
81866bad67 Merge "Rename TvChannelInfo to TunedInfo" 2020-10-09 21:12:34 +00:00
shubang
11732d7801 Rename TvChannelInfo to TunedInfo
Bug: 163350497
Test: atest mmm
Change-Id: I1365a393547049fd17647f99a00d93987ea6f96b
2020-10-09 12:15:53 -07:00
Nick Moukhine
4c3ecce019 Merge "Add system service for music recognition." 2020-10-09 07:35:34 +00:00
Jeff Sharkey
f76ffeaff1 Merge changes from topic "oct6"
* changes:
  Upgrade AndroidFrameworkBinderIdentity to fatal.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
  Tighten up Binder.clearCallingIdentity() usage.
2020-10-08 18:50:22 +00:00
Jeff Sharkey
b93712f623 Tighten up Binder.clearCallingIdentity() usage.
This is a third CL in a chain that adjusts existing malformed code
to follow AndroidFrameworkBinderIdentity best-practices.

Specifically, if a thread clears an identity they need to restore it
to avoid obscure security vulnerabilities.  In addition, the relevant
"try" block must start immediately after the identity is cleared to
ensure that its restored if/when any exceptions are thrown.

Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I74cb958b68d55a647547aae21baff6ddc364859b
2020-10-07 21:24:05 -06:00
Jin Seok Park
b1161a0937 Merge "[Media ML] Refactor APIs for dispatching key events" 2020-10-07 09:30:26 +00:00
Jeff Sharkey
2d2e07e2ff Tighten up Binder.clearCallingIdentity() usage.
The recently added AndroidFrameworkBinderIdentity Error Prone checker
examines code to ensure that any cleared identities are restored to
avoid obscure security vulnerabilities.

This change is a purely mechanical refactoring that adds the "final"
keyword to the cleared identity to ensure that it's not accidentally
modified before eventually being cleared.  Here's the exact command
used to generate this CL:

$ find . -name "*.java" -exec sed -Ei \
    's/    (long \w+ = .+?clearCallingIdentity)/    final \1/' \
    {} \;

Bug: 155703208
Test: make
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: I832c9d70c3dfcd8d669cf71939d97837becc973a
2020-10-06 11:18:09 -06:00
TreeHugger Robot
e1505c7959 Merge "Use pid and uid for getCurrentTvChannelInfo" 2020-10-05 06:12:38 +00:00
shubang
6f10e974c8 Use pid and uid for getCurrentTvChannelInfo
so the app tag and app type can be correctly returned,
and add javaDoc.

Bug: 163350497
Test: mmm
Change-Id: Ib2fdddab5e8177edf379d9fbf182a3115cc47bc9
2020-10-02 14:35:26 -07:00
Nick Moukhine
cf47bdd888 Add system service for music recognition.
The client submits a RecognitionRequest via MusicRecognitionManager.  System server opens an audio stream based on the request and sends it to a MusicRecognitionService (which is exposed by a system app).  The result is passed back through system server to the original caller.

Test: tracked in b/169662646
Bug: 169403302
Change-Id: I4c7fd9d9d72ddd5678867fd037cab6198bff2c2d
2020-09-30 14:44:01 +00:00
Kyunglyul Hyun
790edb871f Merge "[Media ML] public alternative for MediaController#controlsSameSession" 2020-09-30 12:34:37 +00:00
Jean-Michel Trivi
65f9fd0123 Merge "Use the try catch to deal with the StaleDataException." am: 1fa847ad64 am: 15698dd32d am: 4b16237ab7 am: d715c91c2a am: 0a2fb51a9e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433917

Change-Id: I018f9d6d2563625b57d748f253573998dac342d6
2020-09-30 00:36:35 +00:00
Jean-Michel Trivi
0a2fb51a9e Merge "Use the try catch to deal with the StaleDataException." am: 1fa847ad64 am: 15698dd32d am: 4b16237ab7 am: d715c91c2a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433917

Change-Id: I910b327fba414ae7ce3574acc078a0af40756b87
2020-09-30 00:07:29 +00:00
guofei.xue
6695525f1b Use the try catch to deal with the StaleDataException.
When test the monkey, the mCursor is not null and the mCursor is Closed.
So that the mCursor cannot call the method of moveToPosition. Otherwise
it will lead to StaleDataException.

In order to prevent the android.database.StaleDataException and IllegalStateException,
use the try catch to deal with the StaleDataException and IllegalStateException.

Test:Perform the monkey test, and See if this android.database.StaleDataException will happen again when call the method of android.media.RingtoneManager#getRingtoneUri.

Bug: 169292273

Change-Id: I577c41c6a4b0025ce562a2dc495a6f28b103cfaa
2020-09-29 17:59:26 +00:00
Treehugger Robot
1d0f0eca86 Merge changes I7907f0a3,Iec46c80b am: 4d233a83b7 am: 60d7707016 am: 0ca8b033dd am: 4b664e7ca0 am: ab63bbb80e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433915

Change-Id: If1d1549a66ae5f593fb1267ea9b363e8ff663d99
2020-09-29 17:58:42 +00:00
Treehugger Robot
ab63bbb80e Merge changes I7907f0a3,Iec46c80b am: 4d233a83b7 am: 60d7707016 am: 0ca8b033dd am: 4b664e7ca0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1433915

Change-Id: I34dc8b244777e39fe85a0a4a5a5d2d04ec66a10b
2020-09-29 17:32:29 +00:00
Treehugger Robot
4d233a83b7 Merge changes I7907f0a3,Iec46c80b
* changes:
  When the mUri is null,it will happen NullPointerException.
  Ringtone uri should add type query
2020-09-29 15:31:16 +00:00
Jin Seok Park
5287e24b3b [Media ML] Refactor APIs for dispatching key events
There are currently two APIs with the same name:
dispatchMediaKeyEventAsSystemService(KeyEvent), and
dispatchMediaKeyEventAsSystemService(KeyEvent, MediaSession.Token),
but their internal implementations and return types do not overlap.

Instead rename the second API to
dispatchMediaKeyEventToSessionAsSystemService(...) to avoid
associating the two APIs.

The same logic is applied to dispatchVolumeKeyEventAsSystemService.

Bug: 166262380
Test: build
Change-Id: I20f7c6d4dd97eff6625307cf9bbc14ff824c3286
2020-09-29 16:45:40 +09:00
Kyunglyul Hyun
3b4f87db0d [Media ML] public alternative for MediaController#controlsSameSession
Provide a public alternative for @UnsupportedAppUsage method.

Bug: 161331118
Test: build successful
Change-Id: I69626b8665a1173e29cff4680f82c7fc99c045ac
2020-09-29 07:23:09 +00:00
Hyundo Moon
0732c3ae8e Add a public method MediaMetadata.Builder#setBitmapDimensionLimit()
This CL replaces the copy constructor
MediaMetadata(MediaMetadata source, int maxBitmapSize)
with the new public method Builder#setBitmapDimensionLimit().

Also added a getter getBitmapDimensionLimit().

Bug: 168215839
Test: m update-api -j; Ran MediaMetdataTest
Change-Id: I6844fcf01c4ee98c99bd0dc880b96f73989dbd3c
2020-09-28 16:32:23 +09:00
TreeHugger Robot
a76f514974 Merge "Implement callback for current channel infos" 2020-09-26 01:41:46 +00:00
TreeHugger Robot
43ba05c031 Merge "Add API getCurrentChannelInfos" 2020-09-26 00:31:47 +00:00
shubang
990957db49 Implement callback for current channel infos
Test: mmm
Change-Id: Ia808cddfaab1a506ed106a31b698e406d732646c
2020-09-25 16:30:52 -07:00
Chong Zhang
2c18280f91 transcoding: remove uid/pid from registerClient
bug: 154733526
test: unit testing, builds
Change-Id: If4b5201587ab5d4a9da91376a85310c864f13644
2020-09-24 17:52:47 -07:00
shubang
47a260f827 Add API getCurrentChannelInfos
Test: cuttlefish + sample tuner input
Change-Id: Ia13bebfb595ce1886c9aa540121f6836a404fd25
2020-09-24 14:42:51 -07:00
guofei.xue
813857d851 When the mUri is null,it will happen NullPointerException.
When test the monkey, the mUri is existed to be null pointer high probability.

In order to prevent a null pointer exception, added a judgment condition that the mUri is not null or empty.

Test:Perform the monkey test,and See if this NullPointerException will happen again when call the method of android.media.Ringtone#play.

Bug: 169292270

Change-Id: I7907f0a376d67bb0a0f50ea155e2aa2f4552b1de
2020-09-24 11:46:35 +00:00
TreeHugger Robot
6128432078 Merge "Add BIND_INCLUDE_CAPABILITIES flag when binding to the service." into rvc-qpr-dev am: 36019e12b2 am: 2c70f81609
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12661665

Change-Id: I7ea669edfd84e93b9a0552c47ec95689b1a77f46
2020-09-23 22:08:52 +00:00
TreeHugger Robot
2c70f81609 Merge "Add BIND_INCLUDE_CAPABILITIES flag when binding to the service." into rvc-qpr-dev am: 36019e12b2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12661665

Change-Id: I9f74ba4ee981620c72516ce4c4737990b7ce2b35
2020-09-23 22:07:29 +00:00
TreeHugger Robot
56fd85683b Merge "Add MediaFormat key for slow-motion marker info" 2020-09-23 18:41:44 +00:00
Arnaud Berry
76724683e3 Add BIND_INCLUDE_CAPABILITIES flag when binding to the service.
This allows headless media applications to access the location if they
have the permission and is needed for AAOS apps in particular.

Bug: 169242810
Bug: 156904507
Test: manual with AAOS Media app
Change-Id: I1196718638fba336a815809578f643814545baf4
2020-09-23 16:21:50 +00:00
Chong Zhang
7f12ed39e8 Add MediaFormat key for slow-motion marker info
bug: 160260201
CTS-Coverage-Bug: 169242631
Change-Id: I68746086d008957776bee8328a5331de3ba65db9
2020-09-23 09:18:27 -07:00
Zimuzo Ezeozue
9cf6725256 Merge "Implement TranscodingJob#toString" 2020-09-23 11:53:31 +00:00
Jin Seok Park
69f8c3108a Merge "Remove UnsupportedAppUsage from ExifInterface" 2020-09-23 09:37:35 +00:00