5699 Commits

Author SHA1 Message Date
Narayan Kamath
1163568d7c Merge "Properly guard access to CloseGuard in finalizers." 2017-04-04 12:27:02 +00:00
Jean-Michel Trivi
9eab2eaed8 Merge "Audio focus: API for external audio focus policy" into oc-dev am: 4d52ae9707
am: 23e6cea555

Change-Id: Ica9bca5dde505616999eafded3f0861ce0fcffff
2017-04-04 02:52:15 +00:00
TreeHugger Robot
4d52ae9707 Merge "Audio focus: API for external audio focus policy" into oc-dev 2017-04-04 02:40:02 +00:00
Dongwon Kang
10b9632eac Merge "TIF: use integer for constants instead of string" into oc-dev am: b43a5305bd
am: 2227541021

Change-Id: Ib3661309d1969e5b6407c739e4112d9c2a83e00d
2017-04-04 01:26:33 +00:00
TreeHugger Robot
b43a5305bd Merge "TIF: use integer for constants instead of string" into oc-dev 2017-04-04 01:10:44 +00:00
Hangyu Kuang
60024fca06 Merge "media: unhide mediarecorder's setVideoEncodingProfileLevel api." into oc-dev am: 99442d3427
am: 958a284426

Change-Id: I0df6e5b0ba764b5b1f80e3e96b9ab7ecaf756a61
2017-04-04 00:50:07 +00:00
TreeHugger Robot
99442d3427 Merge "media: unhide mediarecorder's setVideoEncodingProfileLevel api." into oc-dev 2017-04-04 00:33:46 +00:00
Dongwon Kang
c83a1628a2 Merge "TIF: Rename COLUMN_APP_LINK_INTENT_URI to COLUMN_INTENT_URI" into oc-dev am: 64731b1d41
am: 2e7a92f1a5

Change-Id: I1a7ab67424478c92ab879a39b3b54aeb31ee9f95
2017-04-03 22:07:47 +00:00
Jean-Michel Trivi
126cf03f7c Audio focus: API for external audio focus policy
System API for an external audio focus policy. Extends
 the system focus listener with interception of
 focus requests and abandons. Adds method for the focus
 policy to dispatch focus grants and losses.

Test: gts-tradefed run gts -m GtsGmscoreHostTestCases -t 'com.google.android.gts.audio.AudioHostTest#testFocusPolicy'
Bug: 30258418
Change-Id: If408569a2dce07a774e0e2f1be9f1af8e426d2d3
2017-04-03 14:44:47 -07:00
Hangyu Kuang
9ef7fe43c9 media: unhide mediarecorder's setVideoEncodingProfileLevel api.
Test: GoogleCmaera app.
bug: 35151543
Change-Id: I37dee948298a14d338bca670af0bc01450c83529
2017-04-03 12:56:39 -07:00
Dongwon Kang
f9bbac1daf TIF: use integer for constants instead of string
Test: cts-tradefed run cts -m CtsTvTestCases
Bug: 36395855
Change-Id: I9f0d62acb73883f543219a1ee4ed961140221a11
2017-04-03 12:51:53 -07:00
Dongwon Kang
70fb40c17a TIF: Rename COLUMN_APP_LINK_INTENT_URI to COLUMN_INTENT_URI
Test: cts-tradefed run cts -m CtsTvTestCases
Bug: 35856179
Change-Id: I284cb1b764203c646e3edb3f105d90d59a7688d1
2017-04-03 12:51:52 -07:00
Narayan Kamath
492e9e851c Properly guard access to CloseGuard in finalizers.
CloseGuard instances are allocated in constructors and usually
assigned to final fields. This implies they're non-null in finalizers
except in the case where the constructor throws. We add a null check
to make sure we can continue cleaning up other state in the finalizer
(if applicable).

Also, this change decouples closeguard warnings in constructors
from other state based logic. This because the logic there is usually
duplicated with the call to close().

NOTE: This change is not a "complete" fix. Many of these finalizers
are broken in the case where <init> throws. The only objective of
this change is to make such errors more obvious.

Note that some of these classes don't have CTS tests.

Test: make, CtsMediaTestCases.
Bug: 35609098

Change-Id: I24d9e0215f80e44914dba8ab99b6312fd6ed1fc0
2017-04-03 18:12:04 +01:00
Chulwoo Lee
d529dfc8ac Merge "Add TYPE_PREVIEW in the javadoc of Channels.COLUMN_TYPE" into oc-dev am: 0a198d1034
am: b1cd4c5478

Change-Id: I976ef410f41cce40fc12ea6d2d76c2860ce112d8
2017-04-01 03:08:35 +00:00
TreeHugger Robot
0a198d1034 Merge "Add TYPE_PREVIEW in the javadoc of Channels.COLUMN_TYPE" into oc-dev 2017-04-01 03:01:04 +00:00
Dongwon Kang
3b7ab2a4df Merge "TIF: Remove redundant modifiers in TvContract" into oc-dev am: 32e45042c9
am: bf9f80219c

Change-Id: I36f91c211b1fe69ff887e207b15b165ae9e563a1
2017-03-30 23:35:23 +00:00
TreeHugger Robot
32e45042c9 Merge "TIF: Remove redundant modifiers in TvContract" into oc-dev 2017-03-30 23:20:55 +00:00
Dongwon Kang
c871434468 TIF: Remove redundant modifiers in TvContract
Test: build
Bug: 36138179
Change-Id: I313bdf421bc2af956a8b08933e5a86141a90a52f
2017-03-29 13:35:20 -07:00
Oliver Woodman
c0f79de1cf Merge "Avoid unnecessary object allocation in CryptoInfo.set" 2017-03-29 20:09:24 +00:00
Oliver Woodman
5f5ec7b8d5 Avoid unnecessary object allocation in CryptoInfo.set
This is causing a large number of unnecessary small object allocations
during encrypted playbacks, which presumably all need to be GC'd.

I wasn't sure whether the zero pattern should be static; that might
be objectionable in the platform (unsure?), since it would live
forever from the point of the class being classloaded. It doesn't
make much/any difference in practice in any case.

Test: Safe refactoring CL.
Change-Id: I9ee5fe284b0f854d672d83b97fc51116b0416f91
2017-03-29 19:08:40 +01:00
Jean-Michel Trivi
ba6cb09e57 Merge "AudioAttributes: make getVolumeControlStream() non static" into oc-dev am: bf6b4efa6d
am: 4c51b4470c

Change-Id: Ibdf82f804c29a786173584833f1796ed399bea3b
2017-03-29 17:53:56 +00:00
TreeHugger Robot
bf6b4efa6d Merge "AudioAttributes: make getVolumeControlStream() non static" into oc-dev 2017-03-29 17:40:01 +00:00
Chulwoo Lee
5e038e5428 Add TYPE_PREVIEW in the javadoc of Channels.COLUMN_TYPE
Adding missing value in the javadoc.

Test: build
Change-Id: I1904c36b8fcc39acaf404101b198bafa7d92fbdc
2017-03-29 02:22:42 +00:00
Conrad Chen
59eb223783 Merge "TIF: open transient columns to public" into oc-dev am: 438be2af18
am: edafff3ed0

Change-Id: Ib3c60be6635cc5be95f7a1322a6c0d8fb79a6723
2017-03-29 00:59:02 +00:00
Jean-Michel Trivi
e67bc4d484 AudioAttributes: make getVolumeControlStream() non static
In AudioAttributes class:
 - deprecate static getVolumeControlStream(AudioAttributes) method,
 - add non-static getVolumeControlStream() method.

Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioAttributesTest
Change-Id: Ic2276cb7367e0bcb0c07e1fe63de68dafddbccb5
2017-03-28 21:37:35 +00:00
Conrad Chen
e710843fc7 TIF: open transient columns to public
Test: build
Bug: 36557756
Change-Id: Ieb45ee5e6bd27fb33d84799ec1510a410ff7b027
2017-03-28 18:41:45 +00:00
TreeHugger Robot
186c0d1d91 Merge "Add RAW_DEPTH image format" 2017-03-28 07:17:11 +00:00
Phil Weaver
668c34444d Merge "Fix permission checking for a11y volume." 2017-03-28 03:58:16 +00:00
TreeHugger Robot
b567b580a8 Merge "Sync the constants in HAL and framework" 2017-03-28 00:02:23 +00:00
Shubang
39f285d5a7 Sync the constants in HAL and framework
Test: Build and flash device

Bug: 36233336
Change-Id: Ie81862825b601bdafd7653564d7393686d54f531
2017-03-27 15:15:46 -07:00
Phil Weaver
f1a9aff962 Fix permission checking for a11y volume.
Adding new permission for changing accessibility volume
to allow system UI to change it. Also providing audio
manager with a whitelist of bound accessibility service
uids so it can allow servics to change the volume.

Bug: 36569297
Test: Adding CTS test in linked CL.
Change-Id: I4f327e3a251fc3780c5957f41217c2ef5bb8b16e
2017-03-27 14:59:26 -07:00
Jaewan Kim
92dea33bfe Simplify the media button handling logic
Here's the new media handling logic.

1. If the foreground app consumes the media key event
  (Activity.onKeyDown/Up() or Activity.setMediaController()),
  we stop here.
2. Find the media app whose AudioPlaybackConfiguration becomes
  PLAYER_STATE_STARTED lastly across the boot. The media app is the app
  with the media session.
  - If its session is still alive, send the media key event
    to the media session.
  - If its session has been released but the session set the media
    button receiver, send the media key event through the media button
    receiver.
  - If it has multiple media sessions, pick the media session whose
    PlaybackState matches with the AudioPlaybackConfiguration's player
    state.
3. Stop here. Don't try revive any other app.

This approach has two limitations.
1. If an app has multiple AudioPlaybackConfigurations and/or
   media sessions, the MediaSessionService may pick the wrong media
   session to send media key events.
2. If an app with a media session plays sound effects differently from
   the SoundPool class, the MediaSessionService would consider the app
   as the lastly played media app.

Bug: 33032080
Test: Manual tests as follows
  1. Checked that the lastly played app receives the media key events
     although the app's media session doesn't report its playback state.
  2. Checked that the lastly played app receives the media key events
     although the app's media session is released.
  3. Checked that the lastly played app doesn't receive the media key
     events if its playback is remote.
Change-Id: I1fd6f9eee0750da4dea9fcc7401fdb1c3f249a72
2017-03-27 14:58:43 -07:00
TreeHugger Robot
b3544c1565 Merge "MediaCas: rethrow MediaCas specific exception" 2017-03-27 20:17:15 +00:00
Chong Zhang
dadee0c33e MediaCas: rethrow MediaCas specific exception
Translate ServiceSpecificException from aidl to CAS-specific
exceptions. Also, throw CAS specific exception for descramble().

bug: 22804304

Change-Id: I6d68c335c87fbb95fd8cc227e432eed4e5951550
2017-03-24 14:28:43 -07:00
Emilian Peev
f7fec7397e Add RAW_DEPTH image format
- Add support for opaque RAW_DEPTH image format.
- Add support for RAW_DEPTH in ImageReader.

Bug: 36015382
Test: testPDStats
Change-Id: Id77b8e9fb22c2616a938c394c9ddc6c34bfff655
2017-03-24 16:23:35 +00:00
TreeHugger Robot
4750321738 Merge "MediaBrowser: Add a disconnecting state" 2017-03-24 05:57:32 +00:00
Sungsoo Lim
17142506bb Merge "Set volume handling of the default route properly" 2017-03-24 04:40:40 +00:00
Conrad Chen
ca47020270 Merge "TIF: Make COLUMN_LOCKED of channels table public" 2017-03-23 22:31:09 +00:00
Conrad Chen
3afa1de7ab TIF: Make COLUMN_LOCKED of channels table public
Test: cts-tradefed run cts -m CtsTvTestCases
Bug: 31340604
Change-Id: I5bf155cb2bdea02f0841ecba0872077cc6609c06
2017-03-23 10:53:58 -07:00
Jean-Michel Trivi
ce48965cf2 Merge "Audio focus: SDK/System API updates" 2017-03-23 15:11:53 +00:00
Sungsoo
01d3c73576 MediaBrowser: Add a disconnecting state
By adding a CONNECT_STATE_DISCONNECTING, we could prevent
the ConnectionCallback to be called after disconnect().

Bug: 36106103
Test: manual using Support4Demos
Change-Id: Ia6f9864dce90b1e58437c07bbcaf6300e162ab92
2017-03-23 13:50:38 +09:00
TreeHugger Robot
0f04917d21 Merge "Revisit logging in MediaRouter and MediaSessionRecord" 2017-03-23 02:34:31 +00:00
TreeHugger Robot
55c85cadf6 Merge "Add missing type for USB headset devices" 2017-03-23 02:22:54 +00:00
Jaewan Kim
742e379863 Revisit logging in MediaRouter and MediaSessionRecord
This limits excessive logs from MediaRouter and MediaSessionRecord
- MediaRouter: Leave log only if there's change in the audio route.
- MediaSessionRecord: Leave log for the controller callback instead of
    dumping verbose stack traces.

Bug: 36497125
Test: Manual test
Change-Id: Ie0fe9f33388d1aa9f25c26b3b3f7c71fec409ba8
2017-03-23 09:39:35 +09:00
Jean-Michel Trivi
50750ff162 Audio focus: SDK/System API updates
Addressed API council notes: document some missing default values
  of AudioFocusRequest builder, remove getters on lister and
  handler.
Fix missing support of custom Handler for focus listener.
Integrate focus lock feature from AudioManager SystemAPI into
  new AudioFocusRequest class and builder. Deprecate system
  methods for focus requests that don't use AudioFocusRequest
Switch to a ConcurrentHashMap in AudioManager instead of a
  lock and HashMap to maintain the list of focus listeners
  for each AudioManager instance.
Clean up: all local IAudioService references can be made final.
  Add missing @Override for the Stub implementations.

Test: cts-tradefed run cts -m CtsMediaTestCases -t android.media.cts.AudioFocusTest
Bug: 30258418

Change-Id: I9e903379a607c723a2620821200547de679231d1
2017-03-22 15:12:05 -07:00
Jean-Michel Trivi
a00f86009e 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
2017-03-22 08:39:42 -07:00
Sungsoo
bd6118ffb4 Set volume handling of the default route properly
The volume handling of the default route of the devices which use
fixed volume should be set PLAYBACK_VOLUME_FIXED instead of
PLAYBACK_VOLUME_VARIABLE.

Bug: 36492333
Test: passed CTS of MediaRouterTest
Change-Id: I4bc42063b71ae9087b36f1529b7689b96d9e53e7
2017-03-22 13:53:35 +09:00
Jerry Zhang
e30d5723e4 Merge "Add support for MTP perceived device type property." am: b6ed343e85 am: 7644b885c7
am: 136f37b88f

Change-Id: I446cd52e5fd8cda48e9af46ee3faee5578cae286
2017-03-20 21:54:28 +00:00
Jerry Zhang
7644b885c7 Merge "Add support for MTP perceived device type property."
am: b6ed343e85

Change-Id: I58417625aa6c669eb82af3a11a4e35c77952f539
2017-03-20 21:39:17 +00:00
Eric Laurent
2eb39497bc Add missing type for USB headset devices
Change-Id: Ib3195442bfefd00edf46592e743617fe37b81a33
Test: audio playback and capture regression tests
2017-03-17 17:25:15 -07:00