5541 Commits

Author SHA1 Message Date
Edwin Wong
4d1d84e8a0 Pass application packagename to drm plugin.
Get the application packagename to be used as part of a unique
identifier for drm plugin.

Test: Stream movies through Play Movies, Netflix and
Gts MediaCodecCencPlayer tests.
Verify the application's packagename is reachable in the drm plugin's
debug log.

bug: 27101531

Change-Id: I6473b58d78bc34191aca5896bb1f5fb79107ae47
2017-01-07 23:59:40 -08:00
TreeHugger Robot
677e297537 Merge changes from topics 'List parent profile custom ringtones from managed profile', 'Add/delete custom ringtones from storage'
* changes:
  [RingtoneManager] Option for cursor to list parent sounds
  [RingtoneManager] API to delete custom ringtones
  [RingtoneManager] API to add custom ringtones
2017-01-06 19:35:59 +00:00
Julia Reynolds
bb983d20d2 Use internal volume controller and status bar.
Remove code that let these components be replaced by external
processes.

Bug: 33006669
Bug: 34106436
Test: manual. reboot device, play music, change volume,
view notifications
Change-Id: I458f11537ab9db6f23735487513815553004613f
2017-01-06 15:59:45 +00:00
Andre Lago
dc50b548ff [RingtoneManager] Option for cursor to list parent sounds
Modify RingtoneManager.getCursor so that the cursor returned also
retrieves the parent profile's ringtones, adding the parent's id to
those ringtones

Test: manual (use ringtone picker in associated CL)
Bug: 30658854
Change-Id: I3b52b0dc41a5a3ff1a71a89fd8a0d33023021aba
2017-01-05 19:06:35 +00:00
Andre Lago
178693a5df [RingtoneManager] API to delete custom ringtones
Given a Uri, if it is a media file in one of the external ringtone
storages, this API deletes its file and database entry.

Test: manual - associated CL
Bug: 30658854
Change-Id: I987bd18577960f9a2b02ce37a4a2d5d033d7a969
2017-01-05 19:06:34 +00:00
Andre Lago
7c8ccb3ce4 [RingtoneManager] API to add custom ringtones
So far, the only way for users to add custom ringtones was to either use
a 3rd party app or copy files to a specific directory in the storage,
and there was no API to make it easier to add custom ringtones.

This CL creates a hidden API in RingtoneManager that allows adding any
audio file as a custom ringtone, by copying that file into the ringtone
storage and asking MediaScanner to scan that file.

This API is not intended to be used by existing apps, but an associated CL
uses it in RingtonePickerActivity

Test: make && vendor/google/tools/flashall, plus manual testing with associated CL
Bug: 30658854
Change-Id: I2b291847c5430e1fc2c3fc6a351b6111a49fcbf3
2017-01-05 19:06:14 +00:00
TreeHugger Robot
6e3c246e2b Merge "Fix typo in comment in IAudioService.aidl" 2017-01-04 20:02:28 +00:00
TreeHugger Robot
d61d501a06 Merge "Player activity notification: move some intialization server-side" 2017-01-04 18:37:43 +00:00
Jean-Michel Trivi
359b91dc68 Fix typo in comment in IAudioService.aidl
Test: none, typo in comment
Change-Id: I6f8803d3d551649fc322414980b2b4bf7d437d9d
2017-01-04 10:20:14 -08:00
qinzhichao
e5fb79bb2d Merge "Fix NullPointerException in MediaPlayer" am: c7c899bbe2 am: 15c9c1f8d1 am: 80713e98f7
am: cec9c42498

Change-Id: I19ca9ac969eca57981fd00dcc89f6fa1c724650a
2017-01-04 17:41:53 +00:00
qinzhichao
80713e98f7 Merge "Fix NullPointerException in MediaPlayer" am: c7c899bbe2
am: 15c9c1f8d1

Change-Id: I313f483e69e098252cf1b753aa5f6b38945d9669
2017-01-04 17:32:20 +00:00
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
858ab99071 Merge "Add a mechanism for configuring the A2DP Source codecs" am: 63270f2b96 am: 8b46f87e7e am: da3de76bdb
am: 62c5226e9c

Change-Id: I14d4cc2dc91cb1ab431eda32d5066ac8f471c3a6
2017-01-04 03:54:18 +00:00
Pavlin Radoslavov
da3de76bdb Merge "Add a mechanism for configuring the A2DP Source codecs" am: 63270f2b96
am: 8b46f87e7e

Change-Id: I39e4b90491f646887200649954b652d9f5439925
2017-01-04 03:44:40 +00: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
Jean-Michel Trivi
44a8f53f94 Player activity notification: move some intialization server-side
Make beginning of player tracking synchronous, init uid/pid/piid
  on the server side, and return the piid.
Anonymize configurations in the getter of active configurations
  when the client isn't privileged.

Test: run cts -m CtsMediaTestCases -t android.media.cts.AudioPlaybackConfigurationTest
Bug: 30955183

Change-Id: I1610ae0067fd26d297057663352e679c8963a2d7
2017-01-03 14:45:26 -08:00
Jean-Michel Trivi
791c48458e MediaPlayer: do not crash when there is no context
Prevent NPE when the instance is running without a context.
  This enables writing command-line test apps.

Test: vendor/google_toolbox/team/audio/cmds/ClMediaPlayer
Change-Id: Ie74112334675c5d9d3efdb28c7178c49d8729acb
2017-01-03 12:53:36 -08:00
Jean-Michel Trivi
0c8855d0f2 New AudioAttributes usage for "assistant" use case
Define USAGE_ASSISTANT for new use cases involving audio help,
  query responses and more.

Test: make offline-sdk-docs
Bug: 30947943

Change-Id: Idf93ce4c0f014dbc9b491244cbad9e643cc03413
2016-12-29 12:09:15 -08:00
Jean-Michel Trivi
807313917f New player type values for Open SL ES
Define new player types to describe the two types of AudioPlayer
  in OpenSL ES: those with a buffer queue source, those that
  play from a given URI or FD.
Add a warning in the interface description of AudioService
  that changes should be reflected in the native interface too.

Test: make, NDK tests to follow
Bug: 30955183
Change-Id: I7b530ea6e3b13f238f662ce8b9612e7df574a9c5
2016-12-26 16:03:22 -08:00
Jean-Michel Trivi
c0a0c2bdd1 Merge "Notification of playback activity" 2016-12-22 22:08:21 +00:00
Alex Klyubin
f271c6d266 resolve merge conflicts of b53d984 to master
Change-Id: I3fe63a5c0193c720b8ec4ca53834096de8433f26
2016-12-22 12:00:24 -08:00
Alex Klyubin
8e23aa4ee6 Merge "Make users of MtpServer fill in DeviceInfo field values" am: 933ea68aca
am: e988e8f1f6

Change-Id: Icce6e31723d4dac12cf2c2e389e69c067dd66a91
2016-12-22 19:22:46 +00:00
Jean-Michel Trivi
292a6a4e99 Notification of playback activity
AudioService keeps track of status of implementations of PlayerBase.
AudioService's PlaybackActivityMonitor maintains a list of
  playback configurations for each PlayerBase, and a list
  of clients that want to receive updates about the playback.
Playback activity clients can query the playback configuration
  of the system through AudioManager, or register a callback
  for updates. For clients with MODIFY_AUDIO_ROUTING permission
  (system), the playback configurations contain more information
  about each player (player type, uid, pid, state), and can see
  all players, not just the "active" ones. The act of stripping
  off data about the players that is not supposed to be seen
  by non-system clients, is referred to as "anonymization". It
  is implemented in system server, so no system data is ever
  sent to playback activity clients without system permission.
More information about the AudioPlaybackConfiguration is
  available in the SystemApi (uid, pid, player type, player state).

Test: run cts -m CtsMediaTestCases -t android.media.cts.AudioPlaybackConfigurationTest
Bug: 30955183

Change-Id: I85997594c0378216419f5f0fdaa0714996fd3573
2016-12-21 13:58:08 -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
Sungsoo Lim
48d25dc7bd Merge "MediaBrowser: Introduce the search API" 2016-12-15 06:40:03 +00:00
Marco Nelissen
d194a782ba Merge "Revert "Remove AmrInputStream"" am: e2d8581529 am: 01cb199bed am: 8b1eed4ee8
am: 10cb330d3e

Change-Id: I5c97e47ff9a5f193645660c195ddd707b86ad025
2016-12-14 17:19:46 +00:00
Marco Nelissen
8b1eed4ee8 Merge "Revert "Remove AmrInputStream"" am: e2d8581529
am: 01cb199bed

Change-Id: Icafcabcc2b99dac4d897e0d68725c53e84fdd5c5
2016-12-14 17:05:59 +00:00
Marco Nelissen
a4efbf863b Revert "Remove AmrInputStream"
This reverts commit 0c3518cc7724df29b790d9d81af9a105e7958cf7.

Change-Id: I250d86d2d6ce462cb5f29bc6c312d88a49ac24a4
2016-12-14 16:44:12 +00:00
Marco Nelissen
0c57bd90b6 Merge "Remove AmrInputStream" am: 70b262b0f2 am: e57b37e423 am: b10837952a
am: 688fa0e9f0

Change-Id: I95947386bda60d69b5fb76dc00b2e7fb82d55878
2016-12-13 23:42:21 +00:00
Marco Nelissen
b10837952a Merge "Remove AmrInputStream" am: 70b262b0f2
am: e57b37e423

Change-Id: Ia95832144e831b91ba0f163db1da8ef8e7033446
2016-12-13 23:28:55 +00:00
Marco Nelissen
0c3518cc77 Remove AmrInputStream
Bug: 32114618
Change-Id: I55328e6f003377f4d3c2ba2266844047b1422f49
2016-12-13 13:31:10 -08:00
Jerry Zhang
d9291d55f6 Merge "Modify UsbDeviceManager stack to allow MtpServer to use FunctionFS drivers." am: 1975240f17 am: 830874dbe7 am: 88672d7d29
am: 11dc0eccfb

Change-Id: Ibafebe4877052595cb34626bde9ac6fba1983fb0
2016-12-13 01:02:55 +00:00
Jerry Zhang
88672d7d29 Merge "Modify UsbDeviceManager stack to allow MtpServer to use FunctionFS drivers." am: 1975240f17
am: 830874dbe7

Change-Id: I930f006ffd7a429379638aa4f8268ed443a3696b
2016-12-13 00:37:12 +00: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
8fb6addcbe MediaBrowser: Introduce the search API
Bug: 28210241
Test: passed cts test (MediaBrowserServiceTest and MediaBrowserTest)
Change-Id: I73c58f5385637c626da1503d27e518b4f0c9ea80
2016-12-12 11:27:33 +09:00
Sungsoo Lim
52dd278eb3 Merge "ExifInterface: fix NegativeArraySizeException" am: c57b472d67
am: 582e612fdc

Change-Id: I671ef98f05431e7c4baa2a7b84f6cb04a82c5d9d
2016-12-05 04:47:33 +00:00
Sungsoo Lim
582e612fdc Merge "ExifInterface: fix NegativeArraySizeException"
am: c57b472d67

Change-Id: Ifbe9af9b62837923e6e56159759da6c59795b3aa
2016-12-05 04:41:30 +00:00
TreeHugger Robot
9593f04fb2 Merge "ExifInterface: fix NegativeArraySizeException" 2016-12-05 02:22:46 +00:00
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