Add permission annotations on audio focus @SystemApi methods.
Ignore REQUIRE_PERMISSION error (125) for:
- deprecated abandonAudioFocus() method: the check is on the
request call
- isHdmiSystemAudioSupported() method, it's not clear if it's
being used.
Test: remove "-hide 125" in Android.mk and make, verify no errors\
on AudioManager.java
Bug: 62343127
Change-Id: I62526db0c6dabcc34224c589506d611519de6abc
Bug: 64686424
Test: Connect to carkit and see that NowPlayingChanged only gets sent when
the queue changes, run cts test
Change-Id: I58c9dd0bf976485a2efefd042cd667ee433e07e1
New class AudioEventLogger to store a configurable number of the
last audio events. It hosts a circular buffer of lightweight
event objects, an abstract class whose implementations are
event-specific, and does the heavier string manipulations
at the time of the dump, not during normal operation.
Add logging for:
- phone state (a.k.a. audio mode) changes
- wired device connections
- playback activity monitor
- force use
Test: adb shell dumpsys audio
Bug: 64470715
Change-Id: I8dbd936e2ffec39134f1a8837191c74f5cb9fc56
MtpService has been changed to a singleton service
running in user 0, so the original context will
be that of user 0. Accesses to MediaProvider and
MediaScanner should use the new passed in user context
in order to access user data, while the broadcast
receiver for battery data will use the original context.
Bug: 64822515
Test: Use Mtp and switch users.
Change-Id: Ic181258337944db7dc6f6097c967cb104df938d3
Verified that nobody should be using these APIs, and they've been
deprecated long enough that we can remove them.
Bug: 62341924, 62263907, 62264550
Test: make -j32 update-api && make
Change-Id: I9a2333ca13e4984b71374aa7ffed081e5106c67e
IllegalArgumentException can happen, if unbindService() is called
after the service is stopped.
Bug: 63439915
Test: Passed MediaBrowserTest
Change-Id: I70ecb9e907af66b9b65960dd4029e55e81639c03
If the caller of MediaPlayer.setDataSource has installed its own
CookieHandler when cookies are provided, MediaPlayer.setDataSource
requires that the CookieHandler has to be of CookieManager type.
Bug: 63638018
Test: manual
Change-Id: I1539d1fa83440ddfb00cc958cd46b9917fe3a296
Consider this VirtualDisplay (VD) scenario:
HostActivity creates a VD which holds SettingsActivity. When EditText
on SettingsActivity is tapped, it gains focus.
On eventual taps, it loses focus i.e. the Window in VD loses focus and
the host activity in primary display gets the focus instead. This
happens because WM's TaskTapPointerEventListener.onPointerEvent()
is called on the default display only.
Root cause:
1. Tap detector isn't registered for non-default display.
2. Tap detector has no info on which displayId touch was received.
3. InputFlinger doesn't deliver InputMonitor events for
non-default displays (fixed in a separate CL)
Fixing above results in onPointerEvent(MotionEvent) to deliver the
Touch events successfully to VD. We restrict these changes to physical
multi-displays and VR VirtualDisplays (which uses virtual touch device).
[VrManagerService calls WMInternal.setVr2dDisplayId(int)]
In future, displayId should be part of InputEvent. Bug: 64258305
Bug: 62033391
Test: bit FrameworksServicesTests:com.android.server.wm.DisplayContentTests
Change-Id: I3626f4de5aa9bcf905da9abd39f3ab1baefc4c48
ExifInterface reads the first 5000 bytes of an image file to
determine what type of image it is, and throws an EOFException
if the file is smaller 5000 bytes. This CL removes the throwing
action.
Bug: 64133582
Test: Run ExifInterfaceTest.java with <5kb file
Change-Id: I2b2026f06d70a4fe2986d2e8c410679ba9bf3f7f
Limitation: When two apps make sound simultaneously while one uses a BT
route and the other uses the default route, switching activities between
the two different apps will not change the BT A2DP status until one of
the apps changes its playback status to inactive.
Bug: 32958908, Bug: 35567695, Bug: 33186346
Test: Passed MediaRouter/MediaSession test, and manually varified that
the b/33186346 is fixed.
Change-Id: I1da97dcb74fa2095425b311ad62cdd00f8118cea
(cherry picked from commit b3658569e9)
Instead of selecting default route, select the fallback route to avoid
making sound via the default route while a BT route is available.
Bug: 63582431
Test: manual
Change-Id: I2cb8fbf6c518294fcec2bf14a5d8175c7302396f
Default music volume is changed from 3/4 of max to 1/3 of max to
reduce initial volume over headphones percieved as too agressive.
Also add a property ro.config.media_vol_default to modify this
default value.
Bug: 62608451
Test: verify default music volume over headphones after factory reset.
Change-Id: Icadb99e1bafe88984d3a3a05014d4d4648830693
This is becoming a common pattern (keeping track of which processes
are cached and not allowing them to do stuff in that state), so I
am turning this in to a general mechanism for monitoring this state
through the activity manager's IUidObserver. Now we can just have
AudoService implement its own IUidObserver to get this state and
update which uids it is blocking.
This required making some changes to uid change reports so that
the integer is now a bit mask instead of an enumerations, but that
is what it was already turning in to anyway. (This gets rid of
the crazy GONE_IDLE constant that we'd needed to add before because
it wasn't a bit mask).
Eventually the power manager should be changed to be told about
these changes to cached state instead of listening to every proc
state change, but we'll do that later, it is more disruption than
I want to take for now. However, while working on this, I noticed
that the power manager had regressed in the cached uids it would
actually block, because the activity manager was no longer telling
it about all uids that are idle. (I think this happened when I had
to change the default idle state of UidRecord to true.) So I am
adding a bit of new code to keep track of what idle state we last
reported to observers, to make sure we tell it about newly created
uids that are idle but have never actually become active.
Test: runtest -c com.android.server.am.ActivityManagerServiceTest frameworks-services
Change-Id: I7bfd46bacadd4cab2a69f40e6e52afb4e67b456a
Make it clear that setAudioPolicyFocusListener is required when external
focus control is desired (as opposed to previously mentioned
setAudioPolicyStatusListener).
Test: Inspection of the code.
Change-Id: I6d933feb3bf998d10a10b58ec6804dbab34e2036