Commit Graph

6932 Commits

Author SHA1 Message Date
Mathew Inwood
345a4af9af Merge "Code reformatting for upcoming automated code changes." am: 43f3f60ec0 am: d9b640cbc2
am: 17ea268961

Change-Id: Ia86c739b9e02e963f3c74b25d67b7663860518bd
2018-08-16 18:44:12 -07:00
Mathew Inwood
d9b640cbc2 Merge "Code reformatting for upcoming automated code changes."
am: 43f3f60ec0

Change-Id: Id11efe22dffc7edd46d5dc2244b7121f664fba4d
2018-08-16 16:56:06 -07:00
Treehugger Robot
43f3f60ec0 Merge "Code reformatting for upcoming automated code changes." 2018-08-16 07:45:35 +00:00
Mathew Inwood
3ef2a833ba Merge "Add @UnsupportedAppUsage annotations"
am: 9feefd2f5f

Change-Id: Id93bdaf74cf2e9077f3af8367189ae98e8a2f95a
2018-08-15 06:52:39 -07:00
Gerry Fan
4f8c0a3d2b Merge "Add Nullable to MediaHTTPService's mCookies." am: 7955aec0ea am: 293800c9c9
am: d8a13d8215

Change-Id: Ibde8fec798d965ac6a2ecaf297008f93439f1419
2018-08-15 04:43:45 -07:00
Mathew Inwood
9feefd2f5f Merge "Add @UnsupportedAppUsage annotations" 2018-08-15 11:37:37 +00:00
Mathew Inwood
217f30b3a4 Merge "Add @UnsupportedAppUsage annotations" 2018-08-15 10:03:53 +00:00
Jeff Sharkey
d4be638911 Merge "Change MEDIA_TYPE through Files table." 2018-08-15 04:14:28 +00:00
Gerry Fan
293800c9c9 Merge "Add Nullable to MediaHTTPService's mCookies."
am: 7955aec0ea

Change-Id: Ic2073e516495b37d6e22867180eb687afebaf7f8
2018-08-14 20:19:50 -07:00
gfan
73371d7503 Add Nullable to MediaHTTPService's mCookies.
Bug: 29321867
Test: manually tested with ndk sample native-audio
Change-Id: Ic30fe7c28db0111ee5bcb91b037b7c4536dcfd06
2018-08-14 15:10:49 -07:00
Jeff Sharkey
fac57e600d Change MEDIA_TYPE through Files table.
As part of implementing strongly-typed storage in the Q release, we've
needed to limit the items visible in strongly-typed views.  (For
example, the Images view must only include images.)

This change fixes a place inside the OS that was implicitly relying on
update() leaking between these strong data types.  If we're changing
the media type of an already-scanned file, we need to do that through
the Files table first, and then we can update the details at the
strongly-typed Uri.

Bug: 112467162
Test: atest android.media.cts.MediaScannerTest
Change-Id: I61c8b62e04f6542882745a20e9aed96275427b5f
2018-08-14 15:07:32 -06:00
Wei Jia
7f0e9e3dfe MediaPlayer2: add MEDIA_INFO_DATA_SOURCE_REPEAT
Test: cts
Bug: 109928575
Change-Id: Id628d88f3115e034d6d17523399ecb3f6a9bd249
2018-08-10 17:35:15 -07:00
Mathew Inwood
f82c47fc72 Merge "Add @UnsupportedAppUsage annotations" am: 3610ca221d
am: 72667caaa6

Change-Id: Ie078503a741307be16ce19587b6b29cf6fa32d01
2018-08-10 08:29:10 -07:00
Mathew Inwood
d237a74ff4 Add @UnsupportedAppUsage annotations
For packages:
  android.service.wallpaper
  android.service.vr
  android.service.voice
  android.service.trust
  android.service.textservice
  android.service.restrictions
  android.service.resolver
  android.service.quicksettings
  android.service.power
  android.service.pm
  android.service.persistentdata
  android.service.oemlock
  android.service.notification
  android.service.media
  android.service.gatekeeper
  android.service.fingerprint
  android.service.euicc
  android.service.dreams
  android.service.diskstats
  android.service.chooser
  android.service.carrier
  android.service.battery
  android.service.autofill
  android.service.appwidget
  android.service

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
Change-Id: I50fb66b55bbc82cc505b483c98f8bd09ae0b5020
Merged-In: I51645d8a8cdce3015749fc27e34830e822ef41ae
2018-08-10 09:58:47 +01:00
Mathew Inwood
e3807372f7 Add @UnsupportedAppUsage annotations
For packages:
  android.service.wallpaper
  android.service.vr
  android.service.voice
  android.service.trust
  android.service.textservice
  android.service.restrictions
  android.service.resolver
  android.service.quicksettings
  android.service.power
  android.service.pm
  android.service.persistentdata
  android.service.oemlock
  android.service.notification
  android.service.media
  android.service.gatekeeper
  android.service.fingerprint
  android.service.euicc
  android.service.dreams
  android.service.diskstats
  android.service.chooser
  android.service.carrier
  android.service.battery
  android.service.autofill
  android.service.appwidget
  android.service

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
Change-Id: I51645d8a8cdce3015749fc27e34830e822ef41ae
2018-08-10 09:51:03 +01:00
Mathew Inwood
c97c5c04f1 Add @UnsupportedAppUsage annotations
For packages:
  android.mtp

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
Change-Id: I6af7c9405b0ac3c2d30307dd04d6d330cd22bda4
Merged-In: Id97d70dc1003cd7c6ed585d647bf0df0fd7a946a
2018-08-09 17:29:53 +01:00
Mathew Inwood
d99b96e0f8 Add @UnsupportedAppUsage annotations
For packages:
  android.mtp

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
Change-Id: Id97d70dc1003cd7c6ed585d647bf0df0fd7a946a
2018-08-09 17:22:11 +01:00
Mathew Inwood
a44c098996 Code reformatting for upcoming automated code changes.
Adding annotations to individual fields cannot be easily done when there
are two fields defined in a single statement. Put each definition in a
statement of its own.

See go/UnsupportedAppUsage for more context.

Bug: 110868826
Test: m
Change-Id: I7c521973bd8856414b2d2e39573d887e426c69fc
2018-08-08 15:25:51 +01:00
Ari Hausman-Cohen
971cac75f7 Merge changes from topic "dynamic_stream_effects_master"
* changes:
  Add Dynamic Stream Effects
  Add permission for dynamic AudioEffect attachment
2018-08-02 23:10:52 +00:00
TreeHugger Robot
f15bbe2e8d Merge "MediaPlayer2: fix MEDIA_INFO_DATA_SOURCE_* events" 2018-08-01 17:57:07 +00:00
Wei Jia
08827e4b9a MediaPlayer2: fix MEDIA_INFO_DATA_SOURCE_* events
Test: cts test
Bug: 109928575
Change-Id: Id333c9447f3621147afff21ee375340e0e6be5ce
2018-07-31 17:05:13 -07:00
Jeff Tinker
17716ac974 Fix typo in MediaDrm.java
bug:78248792
Change-Id: I584762c2b2febb4abf05361062bdd3d7d78f49e7
2018-07-30 15:21:22 -07:00
Wei Jia
de9c74d0f4 MediaPlayer2: clean up setNextDataSource/s
Test: cts tests
Bug: 109928575
Change-Id: I3e8c0113b35d8b5f4e95ef3748d056aa3b162038
2018-07-27 15:29:01 -07:00
Ari Hausman-Cohen
7d54c5d838 Add Dynamic Stream Effects
Adds support for adding/removing effects to the list of
default effects for a given stream usage.

Bug: 78527120
Test: Builds, manually tested with app that adds stream effects,
additionally tested by Android Things integration tests making use
of this API.
Change-Id: I9fc262260c08046e59d57710ee2028499b0c2b94
2018-07-27 12:41:47 -07:00
TreeHugger Robot
306afa8652 Merge "Fix data source for HEIF exif extractor" 2018-07-27 02:16:42 +00:00
Chong Zhang
c139d46910 Fix data source for HEIF exif extractor
Do not allow the source to read past available bytes, since
the underlying input stream may not be able to seek after that.

For input streams from files, the available bytes is usually the
file size, and we usually don't have problem when the file is
of decent size. But when the file is very small, some of the
extractors (other than mp4) would request bytes past the end
of the file, which goes over the available range. Once that
condition is hit, we can't reset to the offet needed for
mp4 extractor and heif parsing would fail.

bug: 111897855
test: open heic files of various sizes in Files (Downloads) app,
check that ExifInterface shouldn't encounter any exceptions.

Change-Id: I668ff900f4155dc310cb7ea8977bbe091791c5d7
2018-07-26 17:01:28 -07:00
Jaewan Kim
4f5e805907 MediaSessionManager: Prevent volume keys from being ignored
When the volume key is pressed and the foreground activity doesn't
handle the event, the foreground activity tells the MediaSessionService
for adjusting system volume with its package name returned by
Context#getPackageName().

However, if the foreground process runs on another application's process
by specifying android:process in the AndroidManifest.xml. (e.g.
ApnSettingsActivity in the Settings), its package name wouldn't match
with the UID returned by the Binder.getCallingUid(). Because of the
mismatch, the app ops check in the AudioService will fail and
SecurityException will be thrown.

This fixes the issue by two ways
  1. Use Context#getOpPackageName() for sending package name.
  2. Use system service's package name and UID when adjusting volume
     with the hardware volume key presses.

Bug: 110525559
Test: Verified manually that the issue doesn't happen.
      And run all media CTS
Change-Id: I8bba691a36cbe442212aab3f0b23c97533009052
2018-07-25 08:58:23 +00:00
TreeHugger Robot
bd2a8811f3 Merge "Replace streams with Lists in MtpStorageManager" 2018-07-25 06:16:27 +00:00
TreeHugger Robot
cc74108336 Merge "Update Dolby surround sound display names" 2018-07-19 23:31:35 +00:00
Jerry Zhang
9a018747be Replace streams with Lists in MtpStorageManager
Streams are dispreferred in Android java, so
use Lists for all cases instead.

Test: Mtp works and MtpStorageManager tests pass
Change-Id: I0579013fca690346c6c2561fe3079fd50f215833
2018-07-16 18:21:47 -07:00
Robert Shih
507537ee16 Merge changes from topic "am-9e4fa925-b00a-40e6-8fb0-e5a4244e6284" into oc-dev am: e43837e258 am: dccb62bcca am: 64cb4be887 am: c450d1401e
am: deb8dbad23

Change-Id: I15c3a600ff4e4802254bb41d4903eec10583febc
2018-07-16 14:20:21 -07:00
Robert Shih
deb8dbad23 Merge changes from topic "am-9e4fa925-b00a-40e6-8fb0-e5a4244e6284" into oc-dev am: e43837e258 am: dccb62bcca am: 64cb4be887
am: c450d1401e

Change-Id: I7aba9ed971773ac2ea8cc7df5fe42ed9c022a5ab
2018-07-16 13:58:38 -07:00
Robert Shih
c450d1401e Merge changes from topic "am-9e4fa925-b00a-40e6-8fb0-e5a4244e6284" into oc-dev am: e43837e258 am: dccb62bcca
am: 64cb4be887

Change-Id: Id7d4599c5d7d7c803e86afa88be582773c80741f
2018-07-16 13:38:43 -07:00
Robert Shih
64cb4be887 Merge changes from topic "am-9e4fa925-b00a-40e6-8fb0-e5a4244e6284" into oc-dev am: e43837e258
am: dccb62bcca

Change-Id: I9e6762b25f001e31da7df0bb25984856989b9fd9
2018-07-16 13:13:13 -07:00
Robert Shih
dccb62bcca Merge changes from topic "am-9e4fa925-b00a-40e6-8fb0-e5a4244e6284" into oc-dev
am: e43837e258

Change-Id: Ib0ef741f0188ff3e6edc52e20eae997e9dba56e4
2018-07-16 12:51:28 -07:00
Chong Zhang
71ffe730af Merge "Fix broken javadoc link in MediaFormat" into pi-dev am: 15ae72085f
am: 741bcbee62

Change-Id: I87362a09b014b48ca1d8317d59bd355064cb463f
2018-07-16 12:33:46 -07:00
Chong Zhang
741bcbee62 Merge "Fix broken javadoc link in MediaFormat" into pi-dev
am: 15ae72085f

Change-Id: Id7af6bea28f60e93ce1a1cce94f053b9484ceb37
2018-07-16 12:25:32 -07:00
Dean Wheatley
1ba2d5ea79 Update Dolby surround sound display names
Bug: 63901775
Test: make
Change-Id: I27b969067c210c1684cbc53db3fade6175795498
2018-07-13 14:22:51 -07:00
Android Build Merger (Role)
7b414ce710 [automerger] Fix TrackInfo parcel write am: 0d2dc943dc am: 00b57fc9b7 am: 1bce1217ca am: 47c831e675 am: d6143e9307
Change-Id: I67d3d47cf3ba616d8b8d963d7092895621f63200
2018-07-13 06:57:21 +00:00
Android Build Merger (Role)
47c831e675 [automerger] Fix TrackInfo parcel write am: 0d2dc943dc am: 00b57fc9b7 am: 1bce1217ca
Change-Id: I29f00c9b6dca76c5b780d659d122e08a0d7e581c
2018-07-13 06:57:08 +00:00
Android Build Merger (Role)
1bce1217ca [automerger] Fix TrackInfo parcel write am: 0d2dc943dc am: 00b57fc9b7
Change-Id: Ida72e9fed175aa9497af5c5f607640c07cb04cf5
2018-07-13 06:57:02 +00:00
Android Build Merger (Role)
00b57fc9b7 [automerger] Fix TrackInfo parcel write am: 0d2dc943dc
Change-Id: I7ea941c8cffa147d2c6a46f0428899bf001a2672
2018-07-13 06:56:56 +00:00
Robert Shih
0d2dc943dc Fix TrackInfo parcel write
Bug: 77600398
Change-Id: Ia316f1c5dc4879f6851fdb78fe8b9039579be7bc
2018-07-12 23:56:38 -07:00
Wei Jia
80f59318d2 MediaPlayer2: skip commands when in error state
Test: cts
Bug: 109928575
Change-Id: I1b2d4a2336e09856ed4ffba15f8c47577101c4b5
2018-07-12 14:52:06 -07:00
TreeHugger Robot
102dc30c29 Merge "MediaPlayer2: clean up setDataSource" 2018-07-11 17:52:31 +00:00
Wei Jia
67d1dd8439 MediaPlayer2: clean up setDataSource
Test: cts
Bug: 109928575
Change-Id: Ib50e99599e8c27c9d9c9340e0517bd81a4e6b2d2
2018-07-10 14:26:28 -07:00
Chong Zhang
55135d5d5f Fix broken javadoc link in MediaFormat
bug: 74979696
Change-Id: I83965f3d1d395cb0953da9605b27861a1d84cde7
2018-07-09 11:39:35 -07:00
Dake Gu
50b816222e TvInputManager: fix leaking Context when failed create Session
If TvInputManagerService fails and returns null token, TvInputManager
does not create a Session object, so the onSessionReleased() will not
be executed. mSessionCallbackRecordMap does not clear the entry
in this case.

Bug: 110959874
Test: Create a TVView, call tune() with invalid id, run adb shell
      dumpsys meminfo and check activity count is not leaking.
Change-Id: Id0c81a99cb222bac98778e5d494ebd8665cf950f
2018-07-06 17:55:04 +00:00
Wei Jia
726db8c9a3 MediaPlayer2: merge EventHandler with TaskHandler
Test: cts
Bug: 109928575
Change-Id: I0de22e4730dcb187194d72bf912013d5ad5a48ad
2018-07-03 16:57:38 -07:00
Wei Jia
ba145fec56 MediaPlayer2: move SubtitleData listener into EventCallback
Rename onMediaTimeChanged to onMediaTimeDiscontinuity
Remove stop
Test: MediaPlayer2Test
Bug: 109928575

Change-Id: I7e81a3255360fe780f07d8478634a4a41935db8c
2018-07-02 18:12:42 -07:00