History log of /frameworks/base/media/java/android/media/PlayerBase.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
aee6ee94675d56e71a42d52b16b8d8e5fa6ea3ff 10-May-2017 Jean-Michel Trivi <jmtrivi@google.com> IAppOpsCallback has weak reference to PlayerBase

The implementation of the IAppOpsCallback interface was an inner class
that implicitly held a strong reference to the PlayerBase
instance, preventing subclasses of PlayerBase to be GC'd.
The fix consists in making the IAppOpsCallback implementation be a static
class and hold a weak reference to PlayerBase.

Test: see bug
Bug: 35359144

Change-Id: Ic97d07dad0be2376eef160d01ff4e4a9e5ee0bcd
/frameworks/base/media/java/android/media/PlayerBase.java
cf1b224a789f8412211d22fba9551ce01e54be14 09-May-2017 Jean-Michel Trivi <jmtrivi@google.com> IPlayer has weak reference to PlayerBase

The implementation of the IPlayer interface was an inner class
that implicitly held a strong reference to the PlayerBase
instance, preventing subclasses of PlayerBase to be GC'd.
The fix consists in making the IPlayer implementation be a static
class and hold a weak reference to PlayerBase.

Test: see bug
Bug: 35359144
Change-Id: I5f7d658f4bda07c92cfdb437b42d3f78213ab552
/frameworks/base/media/java/android/media/PlayerBase.java
c4c13b44b816540af7fe99b40b276c1c6979a44c 02-May-2017 Jean-Michel Trivi <jmtrivi@google.com> Message about audio stream deprecation as warning

The message indicating the use of stream types for operations
other than volume control is deprecated shouldn't be an
error but a warning

Test: use apps that request audio focus with a stream type, check log
Bug: 37887058
Change-Id: Iaafae8aa599984688dae448e868de81317add4d3
/frameworks/base/media/java/android/media/PlayerBase.java
a00f86009eb84a96a2086d3e3e065bd812cdcee3 22-Mar-2017 Jean-Michel Trivi <jmtrivi@google.com> PlayerBase: more general exception catching in release

When stopping AppOps watching in the player release, catch
any exception to be safer.

Test: see bug repro steps
Bug: 36240191
Change-Id: I8e11cfc12c305878699dc57131e35e2a98eb7b16
/frameworks/base/media/java/android/media/PlayerBase.java
0fbcb86389623e57689fcc3956ef94084ab9ceab 23-Feb-2017 Jean-Michel Trivi <jmtrivi@google.com> PlayerBase: reference to IAppOpsService may be null

The reference to IAppOpsService may be null for a player
that failed to be initialized correctly, account for this.

Test: see bug
Bug 35415129

Change-Id: I9da40b87736a7890fcb63640eeabd17d0da3d5d3
/frameworks/base/media/java/android/media/PlayerBase.java
035d4ec772b0cde2a8d4b05d2daa9b9cbe11e117 24-Jan-2017 Andy Hung <hunga@google.com> VolumeShaper: Initial implementation

The VolumeShaper is used to apply a volume
envelope to an AudioTrack or a MediaPlayer.

Test: CTS
Bug: 30920125
Bug: 31015569
Change-Id: If8b4bed29760aa3bd15a4b54cae60e40b4f518ee
/frameworks/base/media/java/android/media/PlayerBase.java
99489ccf740d369193a8ffc7eeb4bbde6919bd65 26-Jan-2017 Jean-Michel Trivi <jmtrivi@google.com> Notification playback synchronized with audio focus

PlayerProxy: more control options (pan, delayed start),
remove exceptions in method signatures.
Use delayed start on notification playback for better sync
between media apps and notifications
Disabled for now: support for AudioService (through
MediaFocusControl and PlaybackActivityMonitor) to enforce
audio ducking of focus owners losing audio focus with
AUDIOFOCUS_LOSS_TRANSIENT_CAN_DUCK, and who don't
play audio that has a content labelled as CONTENT_TYPE_SPEECH.
This feature will be enabled when setting a VolumeShaper
on a player works.

Test: play music and play notification
Bug 30258418

Change-Id: I4e4d911645306bbde17f74288f3b61781fe0e3fe
/frameworks/base/media/java/android/media/PlayerBase.java
e9630038872065874c66c8f120555cf09d1ee060 22-Jan-2017 Jean-Michel Trivi <jmtrivi@google.com> 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
/frameworks/base/media/java/android/media/PlayerBase.java
9dc22c227cb5c01136a6aa1b52c7dfa3383c0bd7 06-Jan-2017 Jean-Michel Trivi <jmtrivi@google.com> 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
/frameworks/base/media/java/android/media/PlayerBase.java
44a8f53f94808fdc5ac35a249d21ff2ba23e9419 02-Jan-2017 Jean-Michel Trivi <jmtrivi@google.com> 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
/frameworks/base/media/java/android/media/PlayerBase.java
292a6a4e9934a94eea97b018befde3baed895f7d 01-Dec-2016 Jean-Michel Trivi <jmtrivi@google.com> 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
/frameworks/base/media/java/android/media/PlayerBase.java
2f7511fd065aa121287da3d4b5b8bea3e528b0bc 29-Nov-2016 Jean-Michel Trivi <jmtrivi@google.com> 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
/frameworks/base/media/java/android/media/PlayerBase.java
8e48c6939bd81dcbc596f0a4b11bfaea73aed00b 19-Oct-2016 Jean-Michel Trivi <jmtrivi@google.com> 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
/frameworks/base/media/java/android/media/PlayerBase.java
1293c060c81de1124887ddc05603eb3f98b50cba 13-Jul-2016 Jean-Michel Trivi <jmtrivi@google.com> Optimize audio playback restriction check

Order the playback restriction checks from the most likely
restriction to the least likely.

Bug 30073948

Change-Id: I6431d15a2ed8b5831f937eab8db940d942082b0e
/frameworks/base/media/java/android/media/PlayerBase.java
3c86a343dfca1b9e2e28c240dc894f60709e392c 09-Apr-2016 Jean-Michel Trivi <jmtrivi@google.com> Player superclass for handling AppOps features

Add a new class to group media/audio player features under one
interface. Currently only used for audio-related AppsOps
restrictions. In the future can group routing, audio focus
handling by the framework...
MediaPlayer inherits from PlayerBase, and overrides the methods
that are needed to delegate the handling of the restrictions
in a separate class.
When AppOps restrictions change (as triggered through the
callback in PlayerBase), reset the volume to its value intended
by the application (when unmuting) or the framework (0 when
enforcing the restriction).

Bug 28069414

Change-Id: I2f38e4b9b3c029778836868cf78f4d15d7603247
/frameworks/base/media/java/android/media/PlayerBase.java