Stabilize mapping between ringer-mode=silent and zen=priority
by keeping track of two ringer modes:
- Internal ringer mode: Used for underlying stream muting
- External ringer mode: Reported to clients
The mapping between external ringer mode + zen is:
- normal = all
- vibrate = all
- silent = priority (read-write) or none (read)
Changes include:
- Remove "zen check" from audio service, back to audio
service having no knowledge of zen.
- Maintain a new external ringer mode in audio service,
this is the ringer mode reported through AudioManager
to callers, also mapped to the change intent.
- Introduce a "ringer mode delegate" to the local
audio manager interface, responsible for observing
external / internal mode changes, and making changes
if necessary.
- Internal ringer mode changes are still interesting
to the volume dialog, wire up a callback through
the existing IVolumeController interface.
- On devices without vibration, the mapping is the same
but since no ringer mode change is possible, disable
the icon toggle and remove the mute icon when volume=0.
- On devices with vibration, volume down presses should
pulse the vibrate icon (and vibrate) as a hint that this
is as low as the device can go using the keys. Since
the mechanics are similar to the existing zen=none hint,
pull into shared helper.
- Log ringer mode changes to the zen log, include calling
package information for issue diagnosis.
- Include whether vibration is supported in the audio service
dump.
- Update the status bar icon policy to use the internal ringer
mode, not the external mode (for vibrate icon).
- Update the "Muted by <x>" logic, include current suppressor
in dumpsys, ensure suppression icon is enabled & !clickable,
regardless of zen mode.
Bug: 17884168
Bug: 15471679
Bug: 16824970
Change-Id: Ia7d3bb23ce6d1e37b24fb6521d1c1ab9bb8f60c0
Allow setPlaybackHeadPosition and setLoopPoints in STATE_NO_STATIC_DATA
for consistency with other setters and older Android versions (JB).
Bug: 18217633
Change-Id: Id8ada3056540c4dfcb89f8afa887159e48db0263
Don't refer to classes as structs and view versa -- causes warnings in
clang (in code built with -Werror)
Change-Id: I4d7f461bcf6fe4e43a14ad2f28ee0e0ddea95abc
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
This will delay all calls to onConnected from the MediaBrowserService
until a session token has been set. This also requires making it an
exception to try setting the session twice.
bug:18052336
Change-Id: Iecf186c53364183e1696af83a855c8db3294a5d0
New API for a registered AudioPolicy to lock/unlock the audio
focus stack and prevent any new grant of focus, similar to
the way phone calls behave.
Bug 16010554
Change-Id: If34a58ca9bd43d5479e94a2a7b540750b4c6efe9
Some JNI functions ignore the JNI environment and class information, but
still take the parameters -- causing a build failure with clang (and gcc
with -Wextra enabled). Ignore this.
Change-Id: I049fcf65991b19d2416fce105699311803b43cfc
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
Remove unused variables and static functions clang complains about,
disable warnings about unused parameters (needed for clang and for gcc
with -Wextra enabled)
Change-Id: I76a22cd0158b3c7375c54e3d4d15bc1ac448591e
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
When creating the AudioRecord instance for a dynamic mix, convert
the output channel mask of the mix to an input channel mask
to be used by the AudioRecord instance through which the
mixed audio is rerouted.
Bug 16009464
Change-Id: I3addbe85339f6f06b69acc3f9b8e2a765e5d7305
C++11 defines a real char16_t, which is not implicitly convertible to
uint16_t (and by extension jchar). Add casts as needed.
Bug: 18300613
Change-Id: I00752002ef2e938bdb57f70947e8fd53ec103293
This scales down any MediaMetadata bitmaps that are sent to the system
through MediaSession.
bug:18114918
bug:18084448
Change-Id: Ib7b040cd8245108ad2dd56afe2499290d2b49f51
Background: because the hole-punching code lives only in SurfaceView,
the overlay view can be covered by the application if the TV input
changes the position of SurfaceView via Session.layoutSurface().
This change punches a hole as large as TvView so that the underlying
overlayview can be shown properly.
Bug: 18420642
Change-Id: If9a829367083ce2002a4c4a4e4a4bbb623f7ad96
We weren't passing volume events to the master volume correctly on
devices that only use a master volume. This fix checks if the device
only has a master volume and adjusts the master volume instead of the
stream's volume if that's the case.
bug:18305790
Change-Id: Iec35e0a7dc59e6d73c9dfc88da324660bb15b1f3