11101 Commits

Author SHA1 Message Date
qinzhichao
30d4a498c4 Fix NullPointerException in MediaPlayer
Issue detail:
https://code.google.com/p/android/issues/detail?id=231417

setSubtitleAnchor() is a synchronized method and has checked
mSubtitleController. So checking for null pointer is not
needed in scanInternalSubtitleTracks() method.

Signed-off-by: qinzhichao <qinzhichao@xiaomi.com>
2017-01-04 14:51:33 +08:00
Pavlin Radoslavov
44a4ef0aa9 Add a mechanism for configuring the A2DP Source codecs
* Added a new class BluetoothCodecConfig that contains codec-related
  configuration or capabilities: codec type, priority, sample rate,
  bits per sample, channel mode, and codec specific fields.

* Extended the Bluetooth A2DP AIDL interface to get/set the current
  codec configuration

* Added new call handleBluetoothA2dpDeviceConfigChange() to the Media
  Framework that is called when there are changes in the
  Bluetooth A2DP device configuration - e.g., the A2DP codec is changed.

Test: A2DP streaming to headsets, TestPlans/71390
Bug: 30958229
Change-Id: I9a82716cbc2a5efbe77352a031ac80c88f6a2459
2017-01-03 17:52:52 -08:00
Alex Klyubin
abdc2b47b3 Make users of MtpServer fill in DeviceInfo field values
This is part of weaning apps off accessing system identifiers via
system properties API. Apps should use android.os.Build API instead.

Bug: 33700679
Test: Enable MTP mode then check that mtp-detect output same as before this commit
Change-Id: I4e6696cdee18b9c3e987c432c095911e85a997db
2016-12-21 13:56:28 -08:00
George Burgess IV
5572d1607b Fix a memory leak.
This was caught by clang's static analyzer. Warning:
frameworks/base/media/mca/filterfw/native/core/shader_program.cpp:1031:3:
warning: Potential leak of memory pointed to by 'attrib.owned_data'
    return StoreAttribute(attrib);

Bug: None.
Test: The static analyzer no longer complains.
Change-Id: Ibef0368dfa48ba57e38019a5a3e33d5bacd847a2
2016-12-13 15:32:00 -08:00
Jerry Zhang
bb598ee16f Modify UsbDeviceManager stack to allow MtpServer to use FunctionFS drivers.
Functionfs requires MtpServer to write descriptors before the device can be
configured. This adds a new configure call that will occur only when
functions are changed (new argument added to updateUsbStateBroadcast for this)
and be called after sys.usb.config is changed but before the waitForState
call to ensure compatibility with configfs devices.

Bug: 30976142
Change-Id: I7e94a5847d3b19c0fd75139e1b15a3f2a1cea01d
Test: Manual
2016-12-12 11:05:32 -08:00
Sungsoo Lim
582e612fdc Merge "ExifInterface: fix NegativeArraySizeException"
am: c57b472d67

Change-Id: Ifbe9af9b62837923e6e56159759da6c59795b3aa
2016-12-05 04:41:30 +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
George Burgess IV
4cfb0f020f Merge "Fix static analyzer warnings."
am: 9c69c41b95

Change-Id: I62b951aa16a714343f155fa3af86f58933212ebb
2016-11-23 02:52:13 +00:00
Treehugger Robot
9c69c41b95 Merge "Fix static analyzer warnings." 2016-11-23 02:45:54 +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
Marco Nelissen
1d10b88f40 Merge "Use libaudioclient"
am: 0a05c49248

Change-Id: I134c9c5b95e446fcc18e2b35a3eca2a4a794e8c8
2016-11-07 17:22:36 +00:00
Marco Nelissen
74abdda6a0 Use libaudioclient
Test: build/boot
Change-Id: I7c730bfd47297f311e00798b5927888ddc3f5062
2016-11-04 19:31:54 -07:00
John Reck
946d11d216 Merge "Re-unite sources with their headers"
am: e43444a00b

Change-Id: I8f3ef6a1ddcf78d28f7444b6e83c552b8305fd8c
2016-11-04 21:47:34 +00:00
John Reck
03b5d506bc Re-unite sources with their headers
Move all the includes for androidfw under
a common base path for that library instead
of frameworks/base/includes.

Also fixes -Werror issues that resulted in
no longer being -isystem.

Test: builds
Change-Id: Ic4312eb61b197af114dded5691d5ae1ec82923f7
Merged-In: Ic4312eb61b197af114dded5691d5ae1ec82923f7
(cherry picked from commit f6113af2d6f6eebee68d3ac510fe96d38a7a39e9)
2016-11-04 13:27:37 -07:00
George Burgess IV
315c936a87 Fix static analyzer warnings.
This patch fixes multiple static analyzer warnings:

frameworks/base/media/mca/filterfw/jni/jni_gl_environment.cpp:66:10:
warning: Potential memory leak
frameworks/base/media/mca/filterfw/jni/jni_native_frame.cpp:38:10:
warning: Potential memory leak
frameworks/base/media/mca/filterfw/jni/jni_native_program.cpp:31:10:
warning: Potential memory leak
frameworks/base/media/mca/filterfw/jni/jni_shader_program.cpp:50:12:
warning: Potential memory leak
frameworks/base/media/mca/filterfw/jni/jni_shader_program.cpp:57:12:
warning: Potential memory leak
frameworks/base/media/mca/filterfw/jni/jni_vertex_frame.cpp:27:10:
warning: Potential memory leak

Note that the changes in jni_gl_frame are purely cosmetic; those aren't
fixing any warnings. I'm happy to back them out if anyone wants.

Bug: None.
Test: All of the static analyzer warnings mentioned above are now gone.
Change-Id: I49dc6d7c789233d6497f8bcc766ca66aec72b27b
2016-11-01 16:20:40 -07: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
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
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
Neil Fuller
3649f7cb70 Merge "Remove .mk lines that are just setting the default" am: 8873c3821d am: 6a3c315b25
am: c611842e1c

Change-Id: Ib71490ac084c706b53ae83278f3f8fcd302fc0f2
2016-10-06 08:49:37 +00:00
Neil Fuller
c611842e1c Merge "Remove .mk lines that are just setting the default" am: 8873c3821d
am: 6a3c315b25

Change-Id: I24bd59700cd8b362691115e725cbf11e6accdedc
2016-10-06 08:43:42 +00:00
Neil Fuller
8873c3821d Merge "Remove .mk lines that are just setting the default" 2016-10-06 08:31:34 +00:00
Neil Fuller
b04b5f697d Remove .mk lines that are just setting the default
1.8 is now the default unless targeting an old SDK.

Bug: 31944681
Test: make checkbuild
Change-Id: Ic8a50cfd332da8b84eb87207a3c2d2c9a9a58e99
2016-10-05 13:38:36 +01:00
Colin Cross
e9b5b70114 Merge "Fix struct vs. class mismatch in forward definitions" am: 8f1011d584 am: 6d0b466935
am: 95311818f0

Change-Id: I45b57d37d08699afc070699d07485cb83c51850a
2016-10-03 20:32:01 +00:00
Colin Cross
95311818f0 Merge "Fix struct vs. class mismatch in forward definitions" am: 8f1011d584
am: 6d0b466935

Change-Id: I9602684e0ac91f7c08dafe70309433bb233ceeaf
2016-10-03 20:27:46 +00:00
Colin Cross
08f5f1f03a Fix struct vs. class mismatch in forward definitions
The warnings were being hidden by the use of -isystem to include
frameworks/native/include.

Bug: 31752268
Test: m -j
Change-Id: Ib7227295e7b94c79cdc52e19c71be4066a11cedc
2016-09-30 21:07:26 -07: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
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
Sungsoo
139f1e3742 Make dispatchAudioRoutesChanged be called when BT A2DP status changed
am: 71f3563c39

Change-Id: I1ed4f2bfe61feb150091b16817547538539c3285
2016-09-29 11:04:56 +00:00
Sungsoo
96942eb2ef Revert "Disable selecting the default audio route when a BT route is avaiable"
am: fa6f70e225

Change-Id: Ie3ceb852d7b78eeb7f7492cafbda205f6f313398
2016-09-29 11:04:07 +00:00
TreeHugger Robot
e2782906b5 Merge changes Ic1e2f5e8,Ida4a3fc1 into nyc-mr1-dev
* changes:
  Make dispatchAudioRoutesChanged be called when BT A2DP status changed
  Revert "Disable selecting the default audio route when a BT route is avaiable"
2016-09-29 10:54:20 +00:00
Sungsoo
71f3563c39 Make dispatchAudioRoutesChanged be called when BT A2DP status changed
Bug: 28517884, Bug: 31398128
Change-Id: Ic1e2f5e828a772c667caf1408ebfc9b0d7c3f7d4
2016-09-29 10:16:19 +09:00
Sungsoo
fa6f70e225 Revert "Disable selecting the default audio route when a BT route is avaiable"
This reverts commit 0d33113196e0070829104bf178f3139262b1f33f.

Bug: 28517884, Bug: 31398128
Change-Id: Ida4a3fc1f6f0aae09a5c4463bca8619412f3db58
2016-09-29 10:15:54 +09:00
Sungsoo
4e236046ae ExifInterface: Update javadoc for saveAttributes am: abf5b4cbf3 am: d0a8a69034
am: 0a31d58d14

Change-Id: I33726dd0a1bf2f30309e4abd74b8633c809afada
2016-09-28 00:22:55 +00:00
Sungsoo
855b9126e1 ExifInterface: Update javadoc for saveAttributes am: abf5b4cbf3 am: d0a8a69034
am: 6e8eba7238

Change-Id: Ifffb86693778c77a57b2a22387495c0d6cbd1e12
2016-09-28 00:22:53 +00:00
Sungsoo
6e8eba7238 ExifInterface: Update javadoc for saveAttributes am: abf5b4cbf3
am: d0a8a69034

Change-Id: I1d3369e609d668dc402d4b30eb0c4247980e6e47
2016-09-28 00:18:44 +00:00
Sungsoo
0a31d58d14 ExifInterface: Update javadoc for saveAttributes am: abf5b4cbf3
am: d0a8a69034

Change-Id: I4df5b4855ec9f1e38fab504f3a895c4744cc287e
2016-09-28 00:15:51 +00:00
Sungsoo
d0a8a69034 ExifInterface: Update javadoc for saveAttributes
am: abf5b4cbf3

Change-Id: Icdd289f513f2a576b50d0f3ddf278a1c1710d8b5
2016-09-28 00:08:52 +00:00
Sungsoo
abf5b4cbf3 ExifInterface: Update javadoc for saveAttributes
Bug: 31319086
Test: Checked the created javadoc with "make docs"
Change-Id: I97c77ba4f00a95bc5eedf1dcee942aebd2d89ccb
2016-09-27 02:04:35 +00:00
Eino-Ville Talvala
0b0b740e6a Docs: Note that a Surface acts like a weak reference am: c4faf0cb13
am: ca7f4217b8

Change-Id: I42b145bb9139058d2ea349dbb556cd8a2f88724b
2016-09-17 00:47:03 +00:00
Eino-Ville Talvala
c4faf0cb13 Docs: Note that a Surface acts like a weak reference
This causes frequent programming errors, when developers assume
that holding onto a Surface will keep its associated SurfaceTexture,
ImageReader, etc, also alive.

Bug: 31551063
Test: m offline-sdk-docs, manual viewing of result
Change-Id: I5fb5bb3e3c80c7d5d735417b1697e0fe9a62fc46
2016-09-16 22:58:11 +00:00
Wei Jia
e9c90cea19 MediaPlayer: add comments of restriction for setNextMediaPlayer. am: 295e727545
am: bff3f8a337

Change-Id: I86366b9ac51539ae4000810418b9d3a688231d4e
2016-09-16 01:48:44 +00:00
rago
addb7af2c0 resolve merge conflicts of a80bdc3 to nyc-mr1-dev-plus-aosp
Change-Id: If5b6322e611cc1171f767d48001d9672bfd0024d
2016-09-15 18:38:16 -07:00
Wei Jia
bff3f8a337 MediaPlayer: add comments of restriction for setNextMediaPlayer.
am: 295e727545

Change-Id: Ie1fa26a735bfd1167a94796ca379f5b860e959b4
2016-09-16 00:30:13 +00:00