Commit Graph

10321 Commits

Author SHA1 Message Date
Ahaan Ugale
966437f651 Merge "Send the HotwordDetectionService UID to AudioPolicy" into sc-dev am: 298c5093dc am: 1c1a014258
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15465671

Change-Id: I5cf12c4a699fbc06aa39b48f710e9fceca6d6746
2021-08-05 19:49:38 +00:00
Hyundo Moon
a05a1d3a49 Merge changes from topic "public_media_key_session_changed_listener"
* changes:
  Add public getMediaKeyEventSession(PackageName)
  Add public add/removeOnMediaKeyEventSessionChangedListener
2021-08-05 10:17:49 +00:00
Hongguang Chen
89a8905438 Merge "Use tuner AIDL HAL in Java codes." 2021-08-05 05:20:32 +00:00
Ahaan Ugale
3ac246c432 Send the HotwordDetectionService UID to AudioPolicy
This change follows the pattern of how the IME UID is set.

The UID is stored in AudioService and re-sent there if the audio server
dies.

Fix: 194368677
Test: manual - hotword works when another app is using the mic and in
 Auto projection mode; also after restarting the process or killing
 audio server
Test: atest HotwordDetectionServiceBasicTest
Change-Id: I325cb33d17387e62302967b261b6fe61086d8893
2021-08-04 21:29:21 -07:00
Hyundo Moon
33f8af14c4 Add public getMediaKeyEventSession(PackageName)
The MediaSessionManager has two system APIs
 - getMediaKeyEventSession
 - getMediaKeyEventSessionPackageName
which get the current the media key session and its package name.

Since the APIs require MEDIA_CONTENT_CONTROL permission,
non-system apps could not use the APIs.

This CL adds an overloaded version of those APIs so that apps with
enabled notification listener can use the functionality.

Bug: 187483932
Test: Passed MediaSessionManager(Host)Test
Change-Id: I18904fb68ad175a668f79deb77ced507b7fc800b
2021-08-04 12:16:43 +09:00
Kensuke Miyagi
7a45c0a315 Fix Tuner#shareFrontendFromTuner()
Bug: 195154259
Test: android.media.tv.tuner.cts.TunerTest (all 29 tests pass)
Change-Id: I965d928f8a394b89c98cc8990da804e9e804bbe3
2021-08-04 00:50:49 +00:00
Naomi Musgrave
0ee8ae0de9 Merge "Revert "MediaProjection captures DisplayArea"" into sc-v2-dev am: 93a74ca03b am: 657edec50f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15432520

Change-Id: If741ec02955e5b926aa2efaacb1c4e6f08e90917
2021-08-03 12:58:44 +00:00
Naomi Musgrave
657edec50f Merge "Revert "MediaProjection captures DisplayArea"" into sc-v2-dev am: 93a74ca03b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15432520

Change-Id: I892b46e7af7540f777e2bb2f088cda6192d5aa30
2021-08-03 12:40:18 +00:00
Naomi Musgrave
93a74ca03b Merge "Revert "MediaProjection captures DisplayArea"" into sc-v2-dev 2021-08-03 12:19:43 +00:00
Naomi Musgrave
da38617955 Revert "MediaProjection captures DisplayArea"
This reverts commit 45dd2a3202.

Reason for revert: b/195280234 is blocking droidfood

Bug: b/195280234
Change-Id: I09593dffb797d1e4c60cff52e7901ed6c00f719c
2021-08-03 09:19:23 +00:00
Hongguang
956e635430 Use tuner AIDL HAL in Java codes.
This CL also updates the values of some tuner System API constants.
Those values generated by the HIDL HAL were duplicated, and should be
fixed.

Bug: 191825295
Bug: 194426536
Fix: 194426536
Test: atest android.media.tv.tuner.cts
Change-Id: Ife35bd0000b3aa864d6d0a7842536cad07f5ab9c
2021-08-02 12:02:25 -07:00
Mikhail Naganov
8146fbf684 Merge "AudioMix: Always produce output channel masks from Builder" 2021-08-02 17:49:31 +00:00
Kyunglyul Hyun
18767988a7 Merge "Don't return selected routes as transferable" into sc-dev am: 284388a267 am: 35b739a405
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15426495

Change-Id: Id813f8f7064e8f7880fb6271ea776c897cde12a7
2021-07-31 04:26:09 +00:00
Kyunglyul Hyun
e8d30a33c0 Merge "Don't return selected routes as transferable" into sc-dev am: 284388a267 am: 5b0171fd7c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15426495

Change-Id: I89b88f5873cdca9e577b345c4a595efe1f5d4f8a
2021-07-31 04:25:45 +00:00
Kyunglyul Hyun
35b739a405 Merge "Don't return selected routes as transferable" into sc-dev am: 284388a267
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15426495

Change-Id: I10d80e80ba07bdd89602659dab2d173ee8650192
2021-07-31 04:13:52 +00:00
Kyunglyul Hyun
284388a267 Merge "Don't return selected routes as transferable" into sc-dev 2021-07-31 03:55:57 +00:00
Zimuzo Ezeozue
9fa86d541a Merge "Fix fd leak while bypassing transcoding in media APIs" into sc-dev am: 3fefc5c3ed am: ce692ac89c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15423590

Change-Id: I11e644c3481cf755dfc16e2b397cd8b72ec01668
2021-07-30 14:53:47 +00:00
Zimuzo Ezeozue
ce692ac89c Merge "Fix fd leak while bypassing transcoding in media APIs" into sc-dev am: 3fefc5c3ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15423590

Change-Id: I88486c8e7278e5899405a379034a453ed95b19f9
2021-07-30 14:39:01 +00:00
Naomi Musgrave
140ea00402 Merge "MediaProjection captures DisplayArea" into sc-v2-dev am: a4bd8de95c am: 659ae92051
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14843819

Change-Id: I9fe435874d2dee7ecc43369b39dd871f3f614d07
2021-07-30 13:17:54 +00:00
Naomi Musgrave
659ae92051 Merge "MediaProjection captures DisplayArea" into sc-v2-dev am: a4bd8de95c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14843819

Change-Id: Icf52526aef86c0c89dd1da0a1e20fca93d6e2455
2021-07-30 13:05:27 +00:00
Zimuzo Ezeozue
f4d00d5385 Merge "Fix fd leak while bypassing transcoding in media APIs" 2021-07-30 12:14:10 +00:00
Naomi Musgrave
45dd2a3202 MediaProjection captures DisplayArea
MediaProjection is used by apps to capture the contents of
a display. Apps consume the content from a surface passed
in to MediaProjection#createVirtualDisplay. The images
written out to the surface can be used for saving
screenshots of the current display, screen recording,
or casting to a different display.

MediaProjection is currently tied to capturing a physical
display. This change instead captures the DisplayArea
the app is launched on. This is consistent with Display API
sandboxing, which returns the DisplayArea bounds rather
than the physical display bounds.

Note that apps use the Display APIs to size the
VirtualDisplay and output surface.

Verified: screenshots, screen recording, and casting

Bug: 180624777
Test: atest WmTests:DisplayContentTests
Change-Id: I909e9d32f573aec33869d9f49d6caffc8d7420aa
2021-07-30 09:48:42 +00:00
Kyunglyul Hyun
91c76bc5f4 Don't return selected routes as transferable
MediaRouter2Manager returned selected routes
as "transferable" routes.
This CL fixes it.

Bug: 194370296
Test: manually
Change-Id: I85e0e94bd38e07ee1a99369e9de5a4564aee6d58
2021-07-30 05:23:04 +00:00
Hyundo Moon
27c9c79f81 Add public add/removeOnMediaKeyEventSessionChangedListener
The MediaSessionManager has two system APIs
 - addOnMediaKeyEventSessionChangedListener
 - removeOnMediaKeyEventSessionChangedListener
which listen the media key session updates.

Since the APIs require MEDIA_CONTENT_CONTROL permission,
non-system apps could not use the APIs.

This CL adds an overloaded version of those APIs so that apps with
enabled notification listener can use the functionality.

Bug: 187483932
Test: Passed MediaSessionManager(Host)Test
Change-Id: Ic13353983e23f557afaa13eb11a48e48d24d4358
2021-07-30 12:18:20 +09:00
Mikhail Naganov
e1fa0d0fb4 AudioMix: Always produce output channel masks from Builder
Ensure that AudioMix.Builder always produces and AudioMix
which uses an output channel mask. There are assumptions
in the framework that this is the case, however clients
can actually pass an input mask.

Bug: 194910301
Test: gts-tradefed run gts -m GtsGmscoreHostTestCases \
      -t com.google.android.gts.audio.AudioHostTest
Change-Id: I698eef509a0e3427b7cfc4bf8b045379416f7964
2021-07-29 19:20:42 -07:00
Zim
366493edd2 Fix fd leak while bypassing transcoding in media APIs
To call the media service while bypassing transcoding there are 4 file
descriptors involved:

A: The original file descriptor the app owns and is responsible for
closing
B: Dupe of A, to pass into the MediaStore API as an input to receive a
non-transoding fd
C: The output from the MediaStore API
D: Final fd owned by the media service, after C gets duped over binder
as part of setDataSource

We were leaking (B) and (C). Now we close them appropriately.

See I0124ec8fbd0471237e99bab321f903544f8fe1f8 for another 2 fd leak
fix in MediaProvider

Test: atest TranscodeTest
Test: Manual with 'adb shell lsof | grep <filename>'
Bug: 194828489
Bug: 179804072
Change-Id: I978257bbc4a8f6813b6e6a5ce22124257204f432
Merged-In: I978257bbc4a8f6813b6e6a5ce22124257204f432
2021-07-29 22:05:17 +01:00
Zim
eccf1db4f7 Fix fd leak while bypassing transcoding in media APIs
To call the media service while bypassing transcoding there are 4 file
descriptors involved:

A: The original file descriptor the app owns and is responsible for
closing
B: Dupe of A, to pass into the MediaStore API as an input to receive a
non-transoding fd
C: The output from the MediaStore API
D: Final fd owned by the media service, after C gets duped over binder
as part of setDataSource

We were leaking (B) and (C). Now we close them appropriately.

See I0124ec8fbd0471237e99bab321f903544f8fe1f8 for another 2 fd leak
fix in MediaProvider

Test: atest TranscodeTest
Test: Manual with 'adb shell lsof | grep <filename>'
Bug: 194828489
Bug: 179804072
Change-Id: I978257bbc4a8f6813b6e6a5ce22124257204f432
2021-07-29 21:57:57 +01:00
shubang
14f9771c72 Tuner APIs: add locks to runnables to avoid crashes caused by NPE
The executor can be run in a different thread, which can cause race
condition. Adding the lock can help avoid the NPE reported.

Bug: 193604292
Test: atest android.media.tv.tuner.cts.TunerTest
Change-Id: I647ea2b428c1510b1df7f6cecc686bb7eb288a18
2021-07-29 17:35:18 +00:00
Shubang Lu
2233656aa0 Merge "Change default value from NONE to UNKNOWN" into sc-dev am: 8e31f85e02
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15377214

Change-Id: Id8efdbbf549be60cf2ba769b2cceafdba239b1ac
2021-07-28 18:24:32 +00:00
Shubang Lu
b4467c0ff4 Merge "Change default value from NONE to UNKNOWN" into sc-dev am: 8e31f85e02 am: 52fe97fab4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15377214

Change-Id: I5943464abd2dded5b6aca15abde86be170290073
2021-07-26 19:11:08 +00:00
Sailendra Doddi
def65d889c Merge changes If362e2ad,I1246175c,Ie4aa961e,I6e69dfcd
* changes:
  Updated comments using https://source.android.com/setup/contribute/respectful-code
  Updated comments using https://source.android.com/setup/contribute/respectful-code
  Updated comments using https://source.android.com/setup/contribute/respectful-code
  Updated comments using https://source.android.com/setup/contribute/respectful-code
2021-07-26 10:32:19 +00:00
Shubang Lu
a1fbb1f251 Merge "Change default value from NONE to UNKNOWN" into sc-dev am: 8e31f85e02 am: f21a6499f8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15377214

Change-Id: Ia47e6e4f11ca659b037a5a3c5f36b9ef12ccafc7
2021-07-24 09:36:05 +00:00
Shubang Lu
52fe97fab4 Merge "Change default value from NONE to UNKNOWN" into sc-dev am: 8e31f85e02
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15377214

Change-Id: Ie32cbe74d370f6296e3122ebbf31f1383d6dafd7
2021-07-24 09:17:05 +00:00
shubang
d7b1d8e6a0 Change default value from NONE to UNKNOWN
Bug: 194523273
Test: atest MediaMetricsAtomTests
Change-Id: Ib5b96db02089f3b785507c7f5fd822bcb68f35ea
2021-07-23 14:32:22 -07:00
Sailendra Doddi
00a5882257 Updated comments using https://source.android.com/setup/contribute/respectful-code
BUG=162536543
Test: N/A
Change-Id: I6e69dfcdf75102c39344a2d41c9957b9ba25be7f
2021-07-22 15:31:32 +00:00
Ray Essick
d226b88d42 Merge "Describe Video Encoding Floor" into sc-dev am: 11badea7d3 am: db55a584af
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15238435

Change-Id: I5186a6adfbcae2e17f940adf8b829407446265a8
2021-07-22 03:32:42 +00:00
Ray Essick
9b32702f42 Merge "Describe Video Encoding Floor" into sc-dev am: 11badea7d3 am: b3695ff530
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15238435

Change-Id: I7ad312f4a845789b7c79e2ab81f10f97d226c1d3
2021-07-22 03:31:32 +00:00
Ray Essick
bf08124b44 Merge "Describe Video Encoding Floor" into sc-dev am: 11badea7d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15238435

Change-Id: If12f9bc780c7145f549aa1491793658b7a736370
2021-07-22 03:27:50 +00:00
Ray Essick
b3695ff530 Merge "Describe Video Encoding Floor" into sc-dev am: 11badea7d3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15238435

Change-Id: I211c47fc69fb419c5c2469d6ec4f12dd755983de
2021-07-22 03:15:37 +00:00
Ray Essick
11badea7d3 Merge "Describe Video Encoding Floor" into sc-dev 2021-07-22 03:10:53 +00:00
Jin Seok Park
2e658b293e Merge "Add support for saving attributes for DNG files" 2021-07-20 01:33:37 +00:00
Andy Hung
53e843c44b Merge "MediaMetricsManager: Authorize log session ids" into sc-v2-dev am: 5a97294940 am: e6e2c080e2
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15247197

Change-Id: I7f06fa35f8365cc5fd0fc3a1f265ae2b9abc8d4b
2021-07-19 21:58:47 +00:00
Andy Hung
e6e2c080e2 Merge "MediaMetricsManager: Authorize log session ids" into sc-v2-dev am: 5a97294940
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15247197

Change-Id: I4bf3aea0626caa25f9fa555c7fda59542a92d398
2021-07-19 21:46:23 +00:00
Andy Hung
5a97294940 Merge "MediaMetricsManager: Authorize log session ids" into sc-v2-dev 2021-07-19 21:30:31 +00:00
TreeHugger Robot
7f1f3f5bf1 Merge "Add PCM float profile if extended precision PCM shows but not pcm float." into sc-dev am: 14e7e8316f am: 0426c88c1f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302848

Change-Id: I4903da94aeea7597fdca63421fffe2e6e375ad22
2021-07-19 16:41:32 +00:00
TreeHugger Robot
58c4843483 Merge "Add PCM float profile if extended precision PCM shows but not pcm float." into sc-dev am: 14e7e8316f am: 85d3b6154a
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302848

Change-Id: Iedd0703ab24f7b1a44f278315e6d2f5a8ff53c98
2021-07-19 16:41:03 +00:00
TreeHugger Robot
0426c88c1f Merge "Add PCM float profile if extended precision PCM shows but not pcm float." into sc-dev am: 14e7e8316f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302848

Change-Id: I163f483af6d49def9ec848592c94f283bae835e0
2021-07-19 16:27:45 +00:00
TreeHugger Robot
073b1b0162 Merge "Add PCM float profile if extended precision PCM shows but not pcm float." into sc-dev am: 14e7e8316f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15302848

Change-Id: Ic55761a843880226371475dc2f64340937abc830
2021-07-19 16:27:13 +00:00
TreeHugger Robot
14e7e8316f Merge "Add PCM float profile if extended precision PCM shows but not pcm float." into sc-dev 2021-07-19 16:12:47 +00:00
Jin Seok Park
4dbaec627c Add support for saving attributes for DNG files
Also add support for IMAGE_TYPE_UNKNOWN files that do not have an
identifiable file extension, but follows the TIFF specification.

Also fixes issue where certain thumbnail-only tags were not being
replaced after primary/preview/thumbnail image data was swapped.

Bug: 193010129, Bug: 193010735
Test: atest ExifInterfaceTest
Change-Id: I098cf1a0730d0cb0f1d6010a21b3ec7ada8dc6b7
2021-07-19 15:48:54 +09:00