5703 Commits

Author SHA1 Message Date
NIEJuhu
dbe99b56ec ExifInterface: fix NegativeArraySizeException
The IFD entry has a 4-byte field COUNT. It is read as int type
and is used as array size by ExifInterface. If a crafted JPEG
file contains a negative value, a NegativeArraySizeException
occurs.

Test: passed ExifInterface CTS
Change-Id: Ief29936400f04636928df09e7f357cbf25345383
Signed-off-by: NIEJuhu <niejuhu@xiaomi.com>
2016-12-05 09:18:58 +09:00
Jean-Michel Trivi
d29d66c787 Merge "Stream types are for volume control" 2016-12-02 17:33:54 +00:00
NIEJuhu
8708c80cde ExifInterface: fix NegativeArraySizeException
The IFD entry has a 4-byte field COUNT. It is read as int type
and is used as array size by ExifInterface. If a crafted JPEG
file contains a negative value, a NegativeArraySizeException
occurs.

Change-Id: Ief29936400f04636928df09e7f357cbf25345383
Signed-off-by: NIEJuhu <niejuhu@xiaomi.com>
2016-12-02 06:42:58 +00:00
Wei Jia
400752a790 Merge "MediaPlayer: enable same seek modes as in MediaMetadataRetriever." 2016-12-01 22:08:11 +00:00
Wei Jia
ebc2b694d1 MediaPlayer: enable same seek modes as in MediaMetadataRetriever.
Test: manually check result of mediaplayer.seekTo
Bug: 32557491
Change-Id: Ib507fbfb86a24fcf9b42758e89e595a4a58d33b5
2016-12-01 12:32:34 -08:00
Jean-Michel Trivi
2f7511fd06 Stream types are for volume control
Deprecate methods where stream types are not used for
  volume control operations.
Add a warning in the logs about the use of stream
  types to encourage migration to audio attributes.
Since STREAM_ACCESSIBILITY is added in O for the
  volume of a11y audio, throw an exception when
  trying to use it for playback.

Test: make offline-sdk-docs
Bug: 30955183

Change-Id: I7fcf79f1de68f217a9b19561aa1325ade169dfcf
2016-11-30 09:54:23 -08:00
Jean-Michel Trivi
8e0bc783e9 Javadoc and AudioManager update for A11Y stream
AudioManager:
  - add missing references to STREAM_ACCESSIBILITY
  - add STREAM_ACCESSIBILITY in getDevicesForStream() method
  (this method is only ever called for STREAM_MUSIC)

Test: make offline-sdk-docs
Bug: 30448020
Change-Id: I449082ff01e9822e7e7dca69762c197468237d67
2016-11-25 10:22:23 -08:00
Jean-Michel Trivi
ac48767f91 Conditional behavior for a11y stream volume
VolumePolicy: define two a11y modes: 1/ legacy where
  a11y volume aliases to media volume, 2/ a11y where
  the a11y volume is independent from any other stream
  type volume.
Refactor accessibility service listening to accomodate
  communicating to the volume controller when the
  a11y service is running.
Make accessibility stream alias conditional on a11y
  service running. Reflect the behavior in the
  volume controller.

Test: enable Talkback and verify logs in Vol controller
Bug 30448020

Change-Id: I80535ba259a22b6d93e62a7b3ca462a19d4c84b7
2016-11-23 16:31:38 -08:00
Jean-Michel Trivi
6d5723fe4e Merge "Define stream type for accessibility volume control" 2016-11-22 16:28:48 +00:00
Jean-Michel Trivi
3f0945a608 Define stream type for accessibility volume control
New stream type for accessibility volume.
Add related appOps.

Test: see added CTS tests in AudioManagerTest & Stub
Bug 30448020

Change-Id: I34f96713b22fedf75322b8ffe2b96a7c566f5009
2016-11-21 15:15:45 -08:00
Jeff Tinker
66f6547ba9 Merge "Removing widevine classic" 2016-11-21 17:53:18 +00:00
Sungsoo Lim
cab79f7d59 Revert "MediaBrowserService: Add a constant for suggestion keywords"
This reverts commit 43635ca3f7d12be129feba9256da9fb878e65bb2.

Change-Id: I328f7e0add71c54cc4806810f784732ff17a16bb
2016-11-21 04:48:51 +00:00
Hyundo Moon
af18c40b70 Merge "Fix wrong JavaDoc parameter names of ExifInterface.getJpegAttributes()" 2016-11-17 04:49:12 +00:00
Hyundo Moon
89779299f1 Fix wrong JavaDoc parameter names of ExifInterface.getJpegAttributes()
Test: By comparing the parameter names manually.
Change-Id: I3f67e43174754a73d498be6bf2882481cd80a648
2016-11-17 11:44:12 +09:00
Jeff Tinker
d2e9a52b1d Removing widevine classic
bug:30505334
Change-Id: I21ae4808c04b15a5b298c604494b17de436fb250
2016-11-16 02:12:08 +00:00
Jean-Michel Trivi
8e48c6939b Refactor SoundPool for appOps handling through PlayerBase
Modified the signature of the abstract volume methods so
  it is clear at the subclass level whether the volume
  command is for a mute or a volume control.
  Changed the implementations in the subclasses
  accordingly.
Removed appOps handling inside SoundPool and made it
  inherit from PlayerBase.
Moved handling of the camera sound restriction from
  SoundPool to PlayerBase.
Added support in SoundPool native implementation for
  muting, as each player has its own volume.

Test: play a long file with SoundPool and enter DnD mode

Bug: 30955183
Bug: 28249605

Change-Id: I0fcd7480f9a455c06aa4f7092486f5c65bc9d7db
2016-11-14 09:36:11 -08:00
Marco Nelissen
fd91fcc970 Merge "Make AmrInputStream use MediaCodec" am: 866658261f
am: 618c1a9ae6

Change-Id: Ic6723d4e2ce7ab401908ca955a785463612509bb
2016-11-11 20:16:00 +00:00
Marco Nelissen
618c1a9ae6 Merge "Make AmrInputStream use MediaCodec"
am: 866658261f

Change-Id: Id25833efb8baa54e729bdc823e5849819c53cd64
2016-11-11 20:10:00 +00:00
Marco Nelissen
01d023e966 Make AmrInputStream use MediaCodec
Bug: 32114618
Test: ran CTS test
Change-Id: I9fe77689bf0bcd1bc8f6c5a4d62135271c7bef8b
2016-11-11 10:53:09 -08:00
Jeff Sharkey
0a17db1cc5 Detect non-oneway calls leaving system_server.
To protect system stability, any Binder calls leaving the
system_server must carefully be performed using FLAG_ONEWAY (or
the 'oneway' verb in AIDL) which prevents the call from blocking
indefinitely on the remote process.

In this CL, the system_server uses the new Binder.setWarnOnBlocking()
method to enable detection by default for all remote Binder
interfaces.  It can also use Binder.allowBlocking() to allow
blocking calls on certain remote interfaces that have been
determined to be safe.

This CL adds the 'oneway' verb to several interfaces and methods
where it should have been added, and marks a handful of system
ContentProviders as being safe to call into.  Also, we assume that
any services obtained from ServiceManager are part of the core
OS, and are okay to make blocking calls to.

Test: builds, boots, runs with minimal logs triggered
Bug: 32715088
Change-Id: Ide476e120cb40436a94b7faf7615c943d691f4c0
2016-11-07 17:03:37 -07:00
Jean-Michel Trivi
5d1828ee40 MediaRecorder: Fix some audio source descriptions
voice recognition: it is always available
camcorder: "main microphone" doesn't mean anything
communication: there is no requirement for this source
  to behave like the default preset.

Test: make offline-sdk-docs
Bug: 32451872

Change-Id: I1a2f196977e547feebb031a98b0f0e560f0557d5
2016-11-03 18:00:50 +00:00
Andy Hung
0564ec9d68 resolve merge conflicts of ffe502b to cw-f-dev am: 3dd656c624
am: c6e0d5f125

Change-Id: I80b908142bb4dbd2af8c9f3627ecfd5e3df1963c
2016-10-18 20:18:05 +00:00
Andy Hung
c6e0d5f125 resolve merge conflicts of ffe502b to cw-f-dev
am: 3dd656c624

Change-Id: I8217da44238234d4ba4c34ea76f5bd78fd7b87d2
2016-10-18 20:11:21 +00:00
Andy Hung
3dd656c624 resolve merge conflicts of ffe502b to cw-f-dev
Change-Id: Id392b2e1990dc50b5d2d552f283a11a648d849a1
2016-10-18 11:55:04 -07:00
Andy Hung
ffe502bd61 Ringtone: clear the MediaPlayer listener upon completion
This breaks a local refcount cycle and allows the Java gc to finalize
the Ringtone and MediaPlayer objects quickly.

Bug: 31811091
Change-Id: I0e5a4a78fdc02cc0c8b7811a1f1a45db3c90a0ff
2016-10-17 18:12:35 -07:00
Philip P. Moltmann
b828b77985 Properly close USB device connection in Mtp device
Test: Built
Fixes: 32073045
Change-Id: I05179377532c1bd4dff1f4a4e0e837cb645317e3
2016-10-17 11:19:58 -07:00
Marco Nelissen
e1a81fcc65 Make AmrInputStream use MediaCodec
Bug: 32114618
Test: ran CTS test
Change-Id: I9fe77689bf0bcd1bc8f6c5a4d62135271c7bef8b
2016-10-14 14:52:10 +00:00
TreeHugger Robot
1bbdac5eb2 Merge "resolve merge conflicts of 3fc6b8f to master" 2016-10-14 02:50:58 +00:00
Sungsoo
4d3a4132c2 resolve merge conflicts of 3fc6b8f to master
Change-Id: I004b34699fd997805d6c37753c48fe1f1d226095
2016-10-14 08:17:19 +09:00
Sungsoo
3fc6b8fd0f ExifInterface: Provide backward compatibility am: 2dbe166801 am: bc813cd510 am: 36f64a2f0c
am: b68d0855c4

Change-Id: I40df333d3b19911be333e5c466dfe01a3db4bd70
2016-10-13 22:21:47 +00:00
Sungsoo
b68d0855c4 ExifInterface: Provide backward compatibility am: 2dbe166801 am: bc813cd510
am: 36f64a2f0c

Change-Id: Ibc82a2ddd80dff7d98880db0a179fbb1540ac6f8
2016-10-13 22:11:58 +00:00
Sungsoo
36f64a2f0c ExifInterface: Provide backward compatibility am: 2dbe166801
am: bc813cd510

Change-Id: I0aa6d33baeec8dd991561d964bfce16915c0553d
2016-10-13 22:06:01 +00:00
Sungsoo
bc813cd510 ExifInterface: Provide backward compatibility
am: 2dbe166801

Change-Id: I53f2bfb056d955c6693cb65c9cb9a21859ff7535
2016-10-13 21:57:22 +00:00
Jean-Michel Trivi
46d5b820d7 Audio stream types: javadoc fix to indicate they're for volume
Fix javadoc for stream types to indicate they are only used for
  volume, not to identify streams of audio.
Do not reference AudioSystem in SDK doc.

Test: make offline-sdk-docs

Change-Id: Id7b84db1f22841c47e9d580c9f71f7765c498b9d
2016-10-13 21:38:44 +00:00
Sungsoo
2dbe166801 ExifInterface: Provide backward compatibility
ExifInterface.saveAttribute() didn't throw UnsupportedOperationException
before. Use IOException instead of UnsupportedOperationException for
backward compatibility.

Bug: 30936376, Bug: 32068647, Bug: 31319086
Change-Id: Ifb478db3af820eb846c5373d3a284367da3495a0
2016-10-13 13:06:24 +09:00
Erik Wolsheimer
fdc44dc732 Fix memory leak in Ringtone am: 76ed4ddca0
am: 8d135d53cc

Change-Id: Ieed5a2e27ba53142ceb02a4e6812509beaabb414
2016-10-11 18:31:32 +00:00
Erik Wolsheimer
8d135d53cc Fix memory leak in Ringtone
am: 76ed4ddca0

Change-Id: I7c1167593ba2cc960dbb0b57385c574f5c22f2ad
2016-10-11 18:25:39 +00:00
Erik Wolsheimer
76ed4ddca0 Fix memory leak in Ringtone
BUG: 31938615
Change-Id: Ic736f3494b4da95460bdc0cb7857cc9fcc746ab9
2016-10-11 10:13:23 -07:00
Philip P. Moltmann
7db3055bba Do not access MTP devices when disabled. am: 5201f1e61c
am: c950703424

Change-Id: I9fdf980a9f60ae97eab64019b6f8e7f5b0e67e2b
2016-10-06 20:05:48 +00:00
Hangyu Kuang
6c08cfff6b Merge "media: Unhide mpeg2ts format for streaming output format support." 2016-10-04 17:10:23 +00:00
Mikhail Naganov
1fefc3c75f Merge "MIDI: fix building of properties for the native side" 2016-10-01 01:11:14 +00:00
Philip P. Moltmann
5201f1e61c Do not access MTP devices when disabled.
The USB data transfer is disabled we should not allow access MTP devices
(e.g.
usb sticks). We have two ways of accessing them: Either by mounting them
or by creating a MTPDevice in an app.

Of course an app could implement implement their own MTPDevice
implementation. In this case we cannot enforce the policy without
completely suppressing all MTP USB devices which would be too
restrictive.

Note: When the policy is set we do _not_ disconnect already connected
MTP devices

Fixes: 31472955
Change-Id: I6080c48c49657102774b2b3b4d89ff030245a266
2016-09-30 22:24:23 +00:00
Hangyu Kuang
5b168a0c54 media: Unhide mpeg2ts format for streaming output format support.
Test: Run the camera recorder and output correct mpeg2ts stream.

Bug: 21620607
Change-Id: Ic79758d568e984d55e822d4b6af8716b856dd7da
2016-09-30 13:25:22 -07:00
Mikhail Naganov
33603ae9c5 MIDI: fix building of properties for the native side
A couple of MIDI device's properties (related to ALSA) are of int type
and can't be transferred as a string. Fixed the code.

As we whitelist properties that can go into native, there is no need to
expect other type of properties besides ints and strings.

Bug: 25945784
Change-Id: I008731d0ffee60c31be0bfddb15dcd1425e4b88e
Test: using a PoC app
2016-09-29 17:15:22 -07:00
TreeHugger Robot
a92a8cf905 Merge "[RingtoneManager] Remove user id from internal Uri" 2016-09-29 14:03:36 +00:00
Andre Lago
760d27149d [RingtoneManager] Remove user id from internal Uri
Prevent system ringtones from leaking with user id's on them

Test: manual
Change-Id: Ia4492c75211f9637e075450763f201bf24c5bf03
2016-09-29 13:19:21 +01:00
Sungsoo
909371b6f6 Make dispatchAudioRoutesChanged be called when BT A2DP status changed am: 71f3563c39 am: 139f1e3742
am: 220f348fb3

Change-Id: I34ebeddffe313747008ed6f7d941097bd67d7b9b
2016-09-29 11:27:02 +00:00
Sungsoo
69e48e6181 Revert "Disable selecting the default audio route when a BT route is avaiable" am: fa6f70e225 am: 96942eb2ef
am: 727ecf0264

Change-Id: I104fb3405e1841a2120edd546c55b28b85e02550
2016-09-29 11:26:11 +00:00
Sungsoo
220f348fb3 Make dispatchAudioRoutesChanged be called when BT A2DP status changed am: 71f3563c39
am: 139f1e3742

Change-Id: I381779ef9ac0d285a35984b3e92948edb7a3fa8e
2016-09-29 11:17:52 +00:00
Sungsoo
727ecf0264 Revert "Disable selecting the default audio route when a BT route is avaiable" am: fa6f70e225
am: 96942eb2ef

Change-Id: Ic6a882104fd7e78886dd0e241a548a94141c653e
2016-09-29 11:17:09 +00:00