11799 Commits

Author SHA1 Message Date
Hyundo Moon
644e1375e8 ExifInterface: Accept decimal values for RATIONAL formats
Prior to android N, ExifInterface.setAttributes() accepted the
decimal values for SRATIONAL/URATIONAL formats. However in android N,
decimal values for RATIONAL formats are rejected. Since this behavior
breaks the backward compatibility, we should make setAttributes()
accept decimal values as before.

Bug: 34269464
Test: flashed modified build on angler and tested with an app
Change-Id: I9a77ce341c8c8c3ea74c8592b5a821243eb0257d
2017-01-23 10:59:37 +09:00
Jean-Michel Trivi
e963003887 PlayerBase: unregistration in player release
The player state of PlayerBase was not kept in sync with its
  corresponding AudioPlaybackConfiguration. This caused
  the configuration to never be removed and gc'd because
  the state of PlayerBase when released was always the
  unitialized state of 0 == released state.

Test: use a MediaPlayer then call release, verify the player
  is not showing in the AudioService dumpsys
Bug: 30258418

Change-Id: I9a6704147949e1e45752e646648c8c882376752f
2017-01-21 15:53:11 -08:00
Jerry Zhang
13bb2f4dda Add support for MTP perceived device type property.
Property value is based on the particular device.
This allows some hosts (windows) to apply a device
specific icon in file explorer.

Test: Connect device to windows, verify new icon
Bug: 25360563
Change-Id: I9d3468ca8c01a6f0d42ad543aef11ed265b6c825
2017-01-19 11:26:35 -08:00
Hangyu Kuang
9deb7b5e73 Merge "media: Add new API to set next output file." 2017-01-19 18:17:45 +00:00
Paul Duffin
56a2ae1056 Merge "Prepare for removal of legacy-test from default targets" am: c74ccf1588
am: ab62fd67d8

Change-Id: I923de1762a15fca7dc255f9dfe0ecce6f54d333c
2017-01-19 11:44:56 +00:00
Paul Duffin
ccb0445027 Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

(cherry picked from 6387604f9e672ece85e07c4bcbd7be396867f06f)

Bug: 30188076
Test: make checkbuild
Merged-In: I13e88297731253420e4e5f5291d503f13a39a156
Change-Id: I58446eb8c45d8ac2bcdbc9fa40d1321e811bdd4b
2017-01-19 09:43:05 +00:00
Paul Duffin
648abd31e8 Merge "Prepare for removal of legacy-test from default targets" 2017-01-19 09:34:19 +00:00
Hangyu Kuang
e176ee1222 media: Add new API to set next output file.
Only support recording to MP4 file now. When the recorded file is approcaching
file size limit, application will receive
MEDIA_RECORDER_INFO_MAX_FILESIZE_APPROACHING callback from mediarecorder.
Application could use setNextOutputFile to set the next output file before or
after receiving this callback. Upon reaching filesize limit, recorder will swap
the output file internally and notify application with
MEDIA_RECORDER_INFO_NEXT_OUTPUT_FILE_STARTED.

Test: Hack camera app to record more than filesize limit.
Bug: 28150626
Change-Id: I2daf8f798fe3631d6b7ef48ebea3a64ab4566f2d
2017-01-18 17:32:17 -08:00
TreeHugger Robot
cc2a4210d7 Merge "Revert "MediaBrowserService: Add a constant for suggestion keywords"" 2017-01-18 23:35:29 +00:00
Paul Duffin
8aeb59ebcd Prepare for removal of legacy-test from default targets
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.

Bug: 30188076
Test: make checkbuild
Change-Id: I13e88297731253420e4e5f5291d503f13a39a156
2017-01-18 16:39:34 +00:00
Jean-Michel Trivi
70efb52691 System API for a proxy for registered players
PlayerProxy is a wrapper on IPlayer for system components
  to control players.

Test: use vendor/google_toolbox/team/audio/cmds/ClPlaybackActivity
Bug 30258418

Change-Id: I6a40290c7f711fc0242597a5c016fc71cb4baa10
2017-01-17 15:42:42 -08:00
Jean-Michel Trivi
c1fdd5df4a Merge "AudioPlaybackConfiguration has a player control interface" 2017-01-14 23:39:12 +00:00
Jean-Michel Trivi
9dc22c227c AudioPlaybackConfiguration has a player control interface
An AudioPlaybackConfiguration contains an IPlayer
  interface for system control of a player. It is not
  exposed to non-system signature components.
AudioService, through PlaybackActivityMonitor, is monitoring
  the death of the IPlayer so the matching player can get
  unregistered  in case it meets its maker.

Test: use vendor/google_toolbox/team/audio/cmds/ClPlaybackActivity
Bug: 30258418

Change-Id: Ibf3bceba91882ff16bffbf1219c55a1f89ccb13f
2017-01-13 23:49:29 +00:00
Mark Salyzyn
db15537e6e resolve merge conflicts of 082a1721b516 to master
Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I17f178f425975c1c0dbd48091d25b101956d505e
2017-01-11 08:30:17 -08:00
Mark Salyzyn
ef8ccc8510 Merge "Replace cutils/log.h and log/logger.h with log/log.h" am: e7fcbcb991
am: 6143cbf1e5

Change-Id: Id192d8dd973fe9e70acab72bae9856bc8a62ac75
2017-01-11 15:40:24 +00:00
Mark Salyzyn
52eb4e01a4 Replace cutils/log.h and log/logger.h with log/log.h
Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I578b15b48f0fc2807a92abbc69a377c3d2191496
2017-01-09 14:31:34 -08:00
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
George Burgess IV
56489bd5d0 Merge "Fix a memory leak." am: 1715678a89 am: 8f9c005fa9 am: 85785b557a
am: 9dfed40bd8

Change-Id: I35b03837734c4bab706faf99e8f9d3596e7ead92
2016-12-15 00:31:03 +00:00
George Burgess IV
85785b557a Merge "Fix a memory leak." am: 1715678a89
am: 8f9c005fa9

Change-Id: I29afa8d1394feb57574ed527cda102405571fd65
2016-12-14 23:41:26 +00:00
Eino-Ville Talvala
52d600769c Merge "Camera: Updates in preparation for HIDL" 2016-12-14 23:08:14 +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
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
Marco Nelissen
b10837952a Merge "Remove AmrInputStream" am: 70b262b0f2
am: e57b37e423

Change-Id: Ia95832144e831b91ba0f163db1da8ef8e7033446
2016-12-13 23:28:55 +00:00