Commit Graph

6017 Commits

Author SHA1 Message Date
TreeHugger Robot
619503b279 Merge "Add equal overloads to some MediaDescription and MediaQueue objects (2/3)" into oc-mr1-dev 2017-08-28 19:26:41 +00:00
Jean-Michel Trivi
26ae15f487 AudioManager: permission annotations
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
2017-08-25 19:20:49 -07:00
Jerry Zhang
4de4655f0d Merge changes from topic "mtp-user" into oc-mr1-dev
* changes:
  Add additional context to MtpDatabase
  Reset functions to null when user changes.
2017-08-24 22:13:40 +00:00
TreeHugger Robot
9961d6968e Merge "Audio event logging" into oc-mr1-dev 2017-08-24 19:04:47 +00:00
Ajay Panicker
6edb68bea6 Add equal overloads to some MediaDescription and MediaQueue objects (2/3)
Bug: 64686424
Test: Connect to carkit and see that NowPlayingChanged only gets sent when
      the queue changes, run cts test
Change-Id: I58c9dd0bf976485a2efefd042cd667ee433e07e1
2017-08-24 17:37:38 +00:00
Jean-Michel Trivi
011f39e7c7 Audio event logging
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
2017-08-24 09:05:20 -07:00
Jerry Zhang
5f0139d2e8 Add additional context to MtpDatabase
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
2017-08-23 11:10:51 -07:00
TreeHugger Robot
ad3a36b13b Merge "Image: fix typo" into oc-mr1-dev 2017-08-23 00:20:12 +00:00
Yin-Chia Yeh
43edf1e51d Image: fix typo
Test: none (doc only fix)
Bug: 64648913
Change-Id: I98aa7ac1588e52e8dae0cbbda806159f378110ca
2017-08-21 15:33:38 -07:00
Chong Zhang
6e18ccee2a heif: add new file and mime types to MediaScanner -- DO NOT MERGE
bug: 64077740
Change-Id: I6d36c2394a5ae527026c98c83786009e70b20958
2017-08-19 00:05:06 +00:00
Lajos Molnar
0aeb1875e4 media: handle AVC constrained profiles
Bug: 64691727
Change-Id: I71b21c0951babccc9b4521bd5c26d35a6d62b426
2017-08-14 15:19:52 -07:00
Jeff Sharkey
50421b58e5 Someone is still using these APIs.
Which is totally lame.

Change-Id: Iaabfc1f5ac69ed99e714e89344bde116c340c376
2017-08-12 18:23:48 +00:00
Jeff Sharkey
c2e09129e0 Merge "Remove a bunch of deprecated @SystemApi." into oc-mr1-dev 2017-08-12 03:21:01 +00:00
Cindy Kuang
b39042790c Merge "docs: corrected grammar mistake in Class Overview" into oc-dev am: dc12cb1fb2
am: f125024688

Change-Id: If510d503dc91c2bfd6a7a282dbf7210cbc7f2698
2017-08-11 21:42:58 +00:00
Cindy Kuang
f125024688 Merge "docs: corrected grammar mistake in Class Overview" into oc-dev
am: dc12cb1fb2

Change-Id: I297557eb072b1fce0395c93c2a770623b5ba1642
2017-08-11 21:14:33 +00:00
Jeff Sharkey
8478911f5e Remove a bunch of deprecated @SystemApi.
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
2017-08-11 14:45:47 -06:00
TreeHugger Robot
67744e4696 Merge "Add permission check before setMain()" into oc-mr1-dev 2017-08-10 06:39:31 +00:00
Paul Mclean
bca04acac5 Merge "Update isWiredHeadsetOn() to support USB headsets." into oc-dr1-dev
am: 75384f617d

Change-Id: I693a3cf37c55085eee470091edf5fff0bc62ece8
2017-08-09 22:13:48 +00:00
Cindy Kuang
2e98cc555e docs: corrected grammar mistake in Class Overview
Test: make ds-docs

Bug: 17533073
Change-Id: Iaf22ad26794e2aac454a736efc746bca6f48eb82
2017-08-09 14:49:19 -07:00
Shubang
60d3925f5b Add permission check before setMain()
Test: make; cts-tradefed; run cts -m CtsTvTestCases;
Bug: 64489430
Change-Id: I1365165eb1ba76b3a54a3141cc19e8245c99f279
2017-08-09 14:30:00 -07:00
Paul McLean
145c95342c Update isWiredHeadsetOn() to support USB headsets.
Bug: 64250808
Test: Manual from an App (UsbDescriptors app)
Change-Id: Ic979636025e871d69853a7460befce4e1b1a6ed8
2017-08-09 13:07:18 -06:00
TreeHugger Robot
d3cef1bf7c Merge "media: Address api council comments." into oc-mr1-dev 2017-08-07 21:20:54 +00:00
Jin Seok Park
48dad606c5 Merge "ExifInterface: Remove throwing exception" into oc-mr1-dev 2017-08-04 00:43:02 +00:00
Sungsoo Lim
1d66ccde36 Merge "Catch IllegalArgumentException when disconnect" into oc-mr1-dev 2017-08-04 00:22:00 +00:00
Hangyu Kuang
51cb826529 media: Address api council comments.
Bug: 64338602
Test: CTS test.
Change-Id: I7e1db5a6aea3d63b37a2554ec2a21a0fe40f6e03
2017-08-03 13:52:56 -07:00
Sungsoo Lim
c012f6edd8 Catch IllegalArgumentException when disconnect
IllegalArgumentException can happen, if unbindService() is called
after the service is stopped.

Bug: 63439915
Test: Passed MediaBrowserTest
Change-Id: I70ecb9e907af66b9b65960dd4029e55e81639c03
2017-08-03 14:38:36 +09:00
Sungsoo Lim
be87b68039 Do not call ItemCallback after disconnected
Bug: 64119114
Test: Passed MediaBrowserTest
Change-Id: Icf3283710abe7c03f4a73532b33ec2a306d2280b
2017-08-03 04:48:48 +00:00
Sungsoo Lim
c0fe5b2d88 Merge "Check CookieHandler in setDataSource with cookies" into oc-dr1-dev
am: 6a2ee3b180

Change-Id: Ia42104e2fb75d867279fe8d553c807d5dcfac06d
2017-08-03 01:03:48 +00:00
Sungsoo Lim
6a2ee3b180 Merge "Check CookieHandler in setDataSource with cookies" into oc-dr1-dev 2017-08-03 00:52:27 +00:00
Sungsoo Lim
09d62021d9 Check CookieHandler in setDataSource with cookies
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
2017-08-03 09:48:01 +09:00
Tarandeep Singh
9c4115a562 Merge "Fix keyboard focus in VR" into oc-dr1-dev
am: 986995d481

Change-Id: I693c1256583dc1081c6402668401c6aab2337d16
2017-08-02 22:59:51 +00:00
TreeHugger Robot
26a4940296 Merge "media: Add scaled video thumbnail extractor api." into oc-mr1-dev 2017-08-02 19:14:23 +00:00
Tarandeep Singh
e1cfcf4c4d Fix keyboard focus in VR
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
2017-08-02 10:46:22 -07:00
Jin Park
d113478931 ExifInterface: Remove throwing exception
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
2017-08-02 08:48:17 +00:00
Hangyu Kuang
0552036bc8 media: Add scaled video thumbnail extractor api.
Bug: 62198298
Test: CTS test
Change-Id: Ic78e2dac38b596a10d2fae76bc22f8c43fadf444
2017-07-27 13:31:46 -07:00
Sungsoo
972f27b938 Restore the selected route when an app starts to make sound
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)
2017-07-26 11:02:21 +09:00
Previr Rangroo
307da62b1c Add new Dolby Vision Profile types
Test: build

Change-Id: I475a0ec5b510523434e0c53c5085c58908e4ed83
Signed-off-by: Previr Rangroo <prang@dolby.com>
2017-07-21 18:18:08 +00:00
TreeHugger Robot
789f86907e Merge "Remove logspam of MediaRouter" 2017-07-20 01:31:54 +00:00
Sungsoo Lim
e8de514b10 Merge "MediaRouter: Introduce and use getFallbackRoute method" into oc-dr1-dev am: 7b3bd1d547
am: 4dec845d52

Change-Id: I07d405b81ec43d720ec843a87e6a3bb07e03aea7
2017-07-20 00:32:10 +00:00
TreeHugger Robot
7b3bd1d547 Merge "MediaRouter: Introduce and use getFallbackRoute method" into oc-dr1-dev 2017-07-20 00:18:20 +00:00
Lajos Molnar
ef8d73353a Merge "media: Add constants for CBP and CHP for AVC codecs" 2017-07-19 23:43:51 +00:00
Sungsoo Lim
4bad663518 Remove logspam of MediaRouter
Bug: 62459799
Test: manual
Change-Id: Ia705a3d35625b1ec2d7cd2717f082c7d8c216099
2017-07-19 16:24:15 -07:00
Lajos Molnar
9da5f1ba58 media: Add constants for CBP and CHP for AVC codecs
Bug: 63864332
Change-Id: Ifd6b8c097df2ca8e706d5797ad9c1e7e7d02b6bc
2017-07-19 16:02:44 -07:00
Sungsoo Lim
d98427b1bc Merge "Type check before casting from CookieHandler to CookieManager" into oc-dr1-dev am: 925abb706e
am: d820ac190e

Change-Id: Ic0eab4ae3869cadc8bc1343053be94d620ebb30f
2017-07-19 23:01:54 +00:00
Sungsoo Lim
9bfb46f6ff Type check before casting from CookieHandler to CookieManager
CookieHandler.getDefault() doesn't always return CookieManager.

Bug: 63638018
Test: pass StreamingMediaPlayerTest#testHlsWithHeadersCookies
Test: manual with a test app
Change-Id: Ie7c19d38f779813f3fffb9abbcb3188a0fca3f45
2017-07-19 18:40:16 +00:00
Sungsoo Lim
59579ce59d MediaRouter: Introduce and use getFallbackRoute method
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
2017-07-17 23:21:34 +00:00
Eric Laurent
1e52eafae1 Merge "audioservice: modify default music volume" into oc-dr1-dev am: b6f946c081
am: aebf79edb4

Change-Id: I9e5ee08c8320799dd53e604005c4be57142832fb
2017-07-12 17:47:33 +00:00
Eric Laurent
403bd3429b audioservice: modify default music volume
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
2017-07-11 16:21:44 -07:00
Dianne Hackborn
3e99f654fb Fix issue #34471029: Don't allow audio use from background apps.
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
2017-07-10 17:24:20 +01:00
Scott Randolph
7934aab628 Fix typo in AudioPolicy comments
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
2017-07-05 18:20:18 -07:00