Commit Graph

6837 Commits

Author SHA1 Message Date
Xin Li
c76d117d2a DO NOT MERGE - Merge pi-platform-release (PPRL.190505.001) into stage-aosp-master
Bug: 132622481
Change-Id: I7ba1a9999b3a9bac8031dd086fa2632e45404f32
2019-05-15 11:31:45 -07:00
Henry Fang
21401590f0 Merge "Add encryption information to TvTrackInfo"
am: 3e6a8c1c0e

Change-Id: I294b50fdcf3fbf366971f23f7487f05799353124
2019-05-09 12:24:45 -07:00
Kyeongkab.Nam
2843b7e22f Add encryption information to TvTrackInfo
Add TIF API for getting encryption status of each tracks in order for
TV App to use it.

Test: build
Bug: 112835103
Change-Id: I3065358d20d17c688e3349140b44d443fc34965d
2019-05-09 01:20:12 +00:00
Tobias Thierer
b7ca85651f Merge changes I4e32a588,I202c5653
am: 003ab94333

Change-Id: Ib993592d06a8956770623c3712367275cbe0868a
2019-04-06 07:38:11 -07:00
Tobias Thierer
8d9fccee62 Make MediaHTTPConnection thread safe.
MediaHTTPConnection's public methods are called from multiple Binder
threads. Since both HttpURLConnection and access to the various
connection related fields is not thread safe, this CL guards most
methods by a single lock. This means that the methods can now block
when called, although this should be rare:

 - there are two processes that call these methods. One process
   only calls getSize(), and the other process calls methods
   from a single thread (ie. at not overlapping clock times).
 - should lock contention unexpectedly increase in future, then
   that would be bad (because Binder thread pool threads would
   be blocked/unavailable), but it would not be easy to detect.
   It would be easy to detect if we could stop getSize() being
   called at overlapping clock times, since we could then use
   ReentrantLock.tryLock() to assert that the lock is never contended
   outside of disconnect().

Because it's a requirement for disconnect() to quickly stop another
thread that is blocked in readAt(), disconnect() is the only method
that doesn't acquire the lock immediately; the mConnection field
is marked volatile so that disconnect() has a high chance of reading
that field and calling disconnect() on it without waiting for
another thread (there's a small risk that another thread might
acquire the lock and start a new connection while disconnect()
is waiting for the lock; in that case, after acquiring the lock,
disconnect() will also disconnect that new connection; this is
subject to potential change in future.

Initially, a ReentrantLock object was considered but for now this
CL instead uses the synchronized lock on "this" because:

 - it minimizes churn on the lines of code in this file because
   synchronized (this) { } can be expressed by introduction of
   the word "synchronized" on the method header, whereas
   mLock.lock(); try { ... } finally { mLock.unlock(); } would
   indent all the lines in-between and thus pollute git annotate.
 - some methods were already synchronized.
 - ReentrantLock.tryLock() is not used for now; most of the time,
   lock acquisition should be uncontended but the two cases of
   lock contention mentioned above exist, which makes it difficult
   to distinguish surprising from unsurprising lock contention.
   While this is the case, it seems better to keep the code
   simple and to just unconditionally block.

Fixes: 114337214
Fixes: 119900000
Fixes: 129444137
Fixes: 128758794
Fixes: 63002045

Test: Checked manually that bug 114337214 no longer reproduces on
      Android API level 27 (Oreo MR1) after cherrypicking this CL.
Test: Ran the following on internal master with this CL:
      make cts && cts-tradefed run cts -m CtsMediaTestCases \
      -t android.media.cts.NativeDecoderTest#testAMediaDataSourceClose \
      --abi arm64-v8a
Test: Ran the following both on AOSP (158 tests) and internal master (178):
      atest CtsMediaTestCases:android.media.cts.{MediaPlayer{,2},Routing}Test

      All these tests pass except that on AOSP only, the following test
      fails both before and after my CL (appears unrelated):
      android.media.cts.RoutingTest#test_MediaPlayer_RoutingChangedCallback
Change-Id: I4e32a58891c3ce60ddfa72d36060486d37906f8d
2019-04-02 23:45:16 +01:00
Tobias Thierer
dc9f4b4d5d Revert "MediaHTTPConnection: move connection states into an inner class"
This reverts commit 621e7968ad.

Many of the fields that were moved are annotated @UnsupportedAppUsage,
so the CL would have had undesirable app compat impact. Further,
because investigation has revealed that lock contention *is* possible,
we need to always acquire the lock anyway so there is no longer a
benefit in keeping all of the mutable state in a single field that
can be atomically set to null.

Test: Treehugger
Change-Id: I202c5653cb086d99228491e161a159bad640105a
2019-04-02 22:01:33 +01:00
Michael Wright
187bd825b8 Merge "Add self to OWNERS for MediaProjection."
am: 00ccf23ebd

Change-Id: I34369b2d81c8fea7c56000e305ee8f82a18135de
2019-03-22 17:14:39 -07:00
Treehugger Robot
00ccf23ebd Merge "Add self to OWNERS for MediaProjection." 2019-03-22 23:48:31 +00:00
Dichen Zhang
6be164a330 Merge "MediaHTTPConnection: move connection states into an inner class"
am: abe16aff07

Change-Id: I3b501494ebdd882df2e0073b2e5eb752742a35b1
2019-03-18 18:48:41 -07:00
Treehugger Robot
abe16aff07 Merge "MediaHTTPConnection: move connection states into an inner class" 2019-03-19 01:29:24 +00:00
Dichen Zhang
621e7968ad MediaHTTPConnection: move connection states into an inner class
Bug: 119900000
Test: go/ag/5140159
Change-Id: I8edae85ea614dd537758f342c0c4b57be09c2da5
2019-03-18 15:06:49 -07:00
Michael Wright
f64ba348d7 Add self to OWNERS for MediaProjection.
Bug: N/A
Test: N/A
Change-Id: Ia33983576f55d0d3ea1443655db9103800e38d45
2019-03-14 11:34:27 +00:00
Andrei-Valentin Onea
f63b6157a1 Merge "Add @UnsupportedAppUsage annotations"
am: 10c573ff85

Change-Id: I394e53a553e4c054c52fb3e991b4f81f3c152a94
2019-03-08 06:00:20 -08:00
Andrei Onea
8c2fb5b99b Add @UnsupportedAppUsage annotations
For packages:
  android.database
  android.hardware.display
  android.hardware.input
  android.hardware.location
  android.location
  android.media
  android.media.projection
  android.media.tv

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Merged-In: I570c08292f8a9f512c96f9dce13f5337718f112c
Change-Id: I1d6c60fcb53f404d5775163bf6929395921f5a45
2019-03-06 15:39:19 +00:00
Dichen Zhang
a97abe701c Merge "revert "HLS seeking: call readAt() on new thread""
am: 00a4170c0c

Change-Id: Ia2a3db95cc56e23252b0d9df28e5c3289c1a34e5
2019-02-28 16:35:39 -08:00
Dichen Zhang
6593694f97 revert "HLS seeking: call readAt() on new thread"
This reverts commit Ie527aeaff91e1b82c7e707a6feaf79548c7ac380

Bug: 119900000
Test: go/ag/5140159

Change-Id: Ia8b2f3efc2f3551e749c16c6c8dfbc070f8bb980
2019-02-27 11:04:02 -08:00
Xin Li
b455c3a7f3 DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master
Bug: 120848293
Change-Id: I2f9a524f2ba552de3f62e343075cf0abf400bbae
2019-02-21 16:02:06 -08:00
Dichen Zhang
7b459880ee Merge "HLS seeking: call readAt() on new thread"
am: f9d7df6f78

Change-Id: Idf8a6341cdb8a2bf9478aa523e8066d96089e598
2019-02-15 14:02:59 -08:00
Dichen Zhang
f9d7df6f78 Merge "HLS seeking: call readAt() on new thread" 2019-02-15 21:47:26 +00:00
Dichen Zhang
94843014bc HLS seeking: call readAt() on new thread
Bug: 119900000
Test: go/ag/5140159
Change-Id: Ie527aeaff91e1b82c7e707a6feaf79548c7ac380
2019-02-14 16:26:49 -08:00
Xin Li
0e71b4f19b DO NOT MERGE - Merge pi-platform-release (PPRL.190205.001) into
stage-aosp-master

Bug: 124234733
Change-Id: Ic4f67fde0835da0b1c363906cccef0d244e38393
2019-02-14 09:48:06 -08:00
Tomoharu Kasahara
a0d0c542b9 Enable phone apps to mute the BLUETOOTH_SCO stream
This change adds support for privileged apps with the MODIFY_PHONE_STATE
permission to mute the bluetooth sco stream using the adjustStreamVolume
method.
The change adds specific handling for BLUETOOTH_SCO as a mutable stream.

Bug: 111195322
Test: Mute works by AudioManager.adjustStreamVolume
 (STREAM_BLUETOOTH_SCO, ADJUST_MUTE, 0)

Change-Id: I932f9e152e9b6df93a749b083a7bcc7e08c2ad70
2019-01-23 09:04:42 +09:00
Mathew Inwood
8501ae1763 Merge "Limit access to suspected false positives." am: aeda49d185
am: 152d5a5dcd

Change-Id: I8e10322e69d2d479079df5cf8fec0287c7c117f1
2019-01-02 05:00:54 -08:00
Mathew Inwood
55418eada5 Limit access to suspected false positives.
Members modified herein are suspected to be false positives: i.e. things
that were added to the greylist in P, but subsequent data analysis
suggests that they are not, in fact, used after all.

Add a maxTargetSdk=P to these APIs. This is lower-risk that simply
removing these things from the greylist, as none of out data sources are
perfect nor complete.

For APIs that are not supported yet by annotations, move them to
hiddenapi-greylist-max-p.txt instead which has the same effect.

Exempted-From-Owner-Approval: Automatic changes to the codebase
affecting only @UnsupportedAppUsage annotations, themselves added
without requiring owners approval earlier.

Bug: 115609023
Test: m
Change-Id: Ia937d8c41512e7f1b6e7f67b9104c1878b5cc3a0
Merged-In: I020a9c09672ebcae64c5357abc4993e07e744687
2018-12-28 14:26:35 +00:00
Treehugger Robot
a32f898720 Merge "DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master" 2018-12-13 05:45:20 +00:00
Adrian Roos
d4f9f9f666 Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi" am: af0e1c2fa5
am: 963172ac83

Change-Id: I2251db66ef73d5b69c84b4e83f2788d2bc953eda
2018-12-12 08:44:43 -08:00
Adrian Roos
963172ac83 Merge "API: Clean up redundant and ineffective usages of SystemApi and TestApi"
am: af0e1c2fa5

Change-Id: I016cacee1e1de6c7a8269fc3605ed25716598d9e
2018-12-12 08:33:17 -08:00
Adrian Roos
6115769c16 API: Clean up redundant and ineffective usages of SystemApi and TestApi
Everything that is marked SystemApi or TestApi, but not @hide is still
part of the public SDK, it is therefore not sound to have that combination.

In the future, specifing such a combination will be considered an error
to prevent inadvertently exposing SystemApi and TestApi as public API.

Bug: 115333477
Change-Id: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Merged-In: Ibd5d6a22862fdbc1e20a1cb3925280f5a682edea
Test: METALAVA_PREPEND_ARGS="--error UnhiddenSystemApi" m checkapi
Exempt-From-Owner-Approval: API cleanup
2018-12-12 15:02:26 +01:00
Xin Li
15b123ef45 DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into master
Bug: 120502534
Change-Id: Idc8bfb6d97a869b76cfb87ca1a494201baf9e8bd
2018-12-11 14:13:44 -08:00
Xin Li
75f75c18cc DO NOT MERGE - Merge pie-platform-release (PPRL.181205.001) into stage-aosp-master
Bug: 120502534
Change-Id: I7351a1832c4bd2fd86324183ab83e9088d716822
2018-12-10 12:30:19 -08:00
Orion Hodson
2e09a6b61a Merge "Remove ScopedBytes use" am: 422fa22456
am: 7c58021208

Change-Id: I8c552ea28fa7fb5577a7932c599a0f615df28125
2018-12-09 12:16:36 -08:00
Treehugger Robot
422fa22456 Merge "Remove ScopedBytes use" 2018-12-09 19:36:28 +00:00
Chong Zhang
79fa7d39c3 Merge "Fix ExifInterface for .heic when meta is at the end" am: 98c9cd7b20
am: 17fc70b1ee

Change-Id: Ib3073cfac59888d707583efd9a9fda1d3731f103
2018-12-03 19:24:28 -08:00
Chong Zhang
317316fb2b Fix ExifInterface for .heic when meta is at the end
available() bytes is counted after the last read position,
after the seek to new position, size should be compared
with the avaliable directly (without adding position).

bug: 120086693
test: Open .heic files in Downloads/Photos that's either
very small (b/117625929, b/111897855), or with the meta
at the very end (b/120086693). There shouldn't be error
in ExifInterface.
Change-Id: I37ac57823b26f03bb0ba555ee6213cf999942d21
2018-11-30 15:37:03 -08:00
Orion Hodson
9b909c3b70 Remove ScopedBytes use
The libnativehelper ScopedBytes class is being deprecated. It's use in
android_media_AudioTrack.cpp is unnecessary because the JNI method
takes a direct buffer as an argument whereas ScopedBytes classes exist
to mask the difference between byte arrays and byte buffers.

Bug: 119840313
Test: m -j32
Change-Id: I2a6478dbaa861c5391cc298871df0f8cd1f1439c
2018-11-27 17:54:05 +00:00
Andrew Solovay
0db8a96a7c Merge "docs: Fixing typos." into pi-dev
am: 94a49c90a7

Change-Id: I21aeb887a0bc4001ce4926909e1ce197fc0eb85f
2018-11-19 09:57:19 -08:00
Andrew Solovay
bcaedc102d docs: Fixing typos.
Doc is staged to:

http://go/dac-stage/reference/android/media/audiofx/AudioEffect
http://go/dac-stage/reference/android/media/audiofx/AudioEffect.OnControlStatusChangeListener
http://go/dac-stage/reference/android/media/audiofx/AudioEffect.OnEnableStatusChangeListener

Bug: 119656338
Change-Id: I813610941ae0f317944a75687f354cc9f66e8600
Exempt-From-Owner-Approval: Doc-only change
Test: make ds-docs
2018-11-16 15:40:04 -08:00
mtk33169
51a8342f5f Merge "The JE about "android.process.media" will pop up when you eject the SD card after you set SD as internel phone storage" am: 83269acba7
am: a10effa6d4

Change-Id: Ibae7dcc2c76062b5a64a6d0825abafc8fa015eea
2018-11-12 19:52:47 -08:00
mtk33169
03ae44a8ff The JE about "android.process.media" will pop up when you eject the
SD card after you set SD as internel phone storage

This JE is happening due to null pointer access in makeEntryFor() in
MediaScanner.Java.
Before accessing the cursor, check if cursor is available and not null.
It is a safe check.

Bug: 119392250
Test: manual, ran test 20 times and it passed every times.
Change-Id: I23039281b63a0a6a411860eb5989cf20a5663c8f
2018-11-12 10:49:55 +00:00
Marco Nelissen
2ed56610e8 Merge "Add key for sample rate and bits per sample" am: f7c4c728fc
am: f4f1adbf8f

Change-Id: I64ceb88b1d7b40e8019fb11ce47307cf7c18df65
2018-11-03 18:21:30 -07:00
Daniel Bonnevier
56a9a6631a Add key for sample rate and bits per sample
Add new keys for sample rate and bits per sample.
This makes it possible to indicate the specification of
the music files on application.

Bug: 112986969
Test: Check if sample rate and bits per sample can be retrieved

Change-Id: Ie5a90800297a0a7c2dd6f3a2bdf9e88c9221bee1
2018-11-02 19:49:48 +09:00
Chong Zhang
194a3a7587 Merge "Add keys to retrieve color aspects from metadata" am: 6636b0227d
am: a2ec9e32c6

Change-Id: I20dd7e842ae0a8172a188b4d1889daea759e14b2
2018-10-24 20:27:47 -07:00
Chong Zhang
e8c39f3ba0 Merge "Color aspects keys information stored database" am: e4c918ba8e
am: 89c615866a

Change-Id: Ida5168cf1cea927dd79a9c2bacee0a156af60b76
2018-10-24 20:22:18 -07:00
Chong Zhang
6636b0227d Merge "Add keys to retrieve color aspects from metadata" 2018-10-25 02:04:48 +00:00
Nathan Harold
41e2d7494f Merge "Move some members to the "Q blacklist"." am: f5cf9f24ed
am: 13c9e7e2f3

Change-Id: Ia2419cce28d26d9464da2a5172cb332b629e943e
2018-10-24 16:14:06 -07:00
Chong Zhang
65a4a60827 Merge "Fix data source for HEIF exif extractor" am: 31bbb473ce
am: e655bf6d4b

Change-Id: I72f1593d281f3c9aca56d9cc87fe13b08c36316b
2018-10-24 16:04:34 -07:00
Toshikazu Saito
92ccb271ce Merge "Change caught exception in MediaScanner when ExifInterface is created" am: 0915931939
am: 544c774381

Change-Id: Ie3c04473e274b49b6c4bb7cb40f4d675453efd5c
2018-10-24 15:58:40 -07:00
Toshikazu Saito
26b3de310f Add keys to retrieve color aspects from metadata
Add keys to retrieve color standard, color transfer and color range from
MediaMetadataRetriever.

Bug: 114329709
Test: put hdr/non-hdr contents and check media db

Change-Id: Ifa90f12a572b330f87acd6ef06e1e83ddceb8483
2018-10-23 23:37:31 +00:00
nobuhiko saitou
839cc00889 Color aspects keys information stored database
Add keys for color aspects to VideoColumns in MediaStore.
And standard, transfer and range is stored to database.

Bug: 114329709
Test: put hdr/non-hdr contents and check media db

Change-Id: Id4bf27a35720f5cf5a60f08eb3f30314e1a1a167
2018-10-23 22:03:30 +00:00
Nathan Harold
f5cf9f24ed Merge "Move some members to the "Q blacklist"." 2018-10-23 21:53:51 +00:00