3684 Commits

Author SHA1 Message Date
Dongwon Kang
8c6e4b3980 Merge "TIF: Add getDescription() method to TvTrackInfo." 2015-03-16 23:58:05 +00:00
Mike Lockwood
0caf689ab4 MidiDeviceInfo: Fix NPE for devices with no port names
Change-Id: I703709f84b6b1951b67918c9762bb84a142d855c
2015-03-16 16:03:17 -07:00
Andreas Gampe
6ec9fd8b3b am c3228a9d: am 3d33314e: Merge "Frameworks/base: Use equals for Integer comparison"
* commit 'c3228a9d400bcacd15fbbdf136ee1f9cf56de2d0':
  Frameworks/base: Use equals for Integer comparison
2015-03-16 20:26:32 +00:00
Ronghua Wu
0e22acb635 Merge "media: add MediaFormat.KEY_PRIORITY." 2015-03-16 16:38:25 +00:00
Andreas Gampe
5c5978985a Frameworks/base: Use equals for Integer comparison
Integer == is dangerous, as equal objects may not be identical
objects. In fact, MediaFormat.setInteger was creating a new object
every time.

Change MediaFormat.setInteger and setLong to use valueOf, which
may reuse returned objects.

Change-Id: Iedcc6003adbf05c0c870aa4b3ada7f181a5b870e
2015-03-15 15:45:15 -07:00
Ronghua Wu
c33958833f media: add MediaFormat.KEY_PRIORITY.
Change-Id: I82e2adb3dfac90952a11e2253fe06a2d9be1bc09
2015-03-14 01:21:42 +00:00
Mike Lockwood
3ae6acda81 Merge "Add MidiManager to public API" 2015-03-14 00:49:00 +00:00
John Spurlock
78d08ee44a Merge "VolumePolicy: Debounce adjustments from vibrate->silent." 2015-03-13 18:41:50 +00:00
Mike Lockwood
81b9f7d325 Add MidiManager to public API
Also made some small API changes based on feedback from the lint tool.

Change-Id: Ibcf1e9107d86d3a364f811ce47a13aa0da653366
2015-03-13 11:00:57 -07:00
Mike Lockwood
4011e20921 Merge "MidiDeviceInfo meta-data improvements:" 2015-03-13 17:27:37 +00:00
John Spurlock
07e72432ac VolumePolicy: Debounce adjustments from vibrate->silent.
Disallows volume adjustments (lower) from vibrate to silent
until a small period of time after an adjustment from normal
to vibrate.

This provides for enough time for the user to see the state change
to vibrate and feel the associated haptic feedback before yet
another state change to silent.

Bug: 19260237
Change-Id: I5843a1c144d56146a83db194f352832c8d85159d
2015-03-13 12:42:47 -04:00
John Spurlock
b6e19e3e0f AudioService: Define minimum levels for volume streams.
- Set a floor of 1 for voice call + bluetooth sco, otherwise 0.
 - All api calls validated to ensure a floor of the min level.
 - Volume UI updated to shift the seekbar by the min value.
 - Remove duplicate static max method in AudioService.
 - Ensure streams with a min level > 0 are not considered muteable.

Bug: 19260237
Change-Id: I213180c9c277f51bd3897b7f777e5f88ed1db125
2015-03-13 11:02:01 -04:00
John Spurlock
63b9e8200e Merge "Volume policy updates." 2015-03-13 00:59:34 +00:00
Marco Nelissen
a80ac05f85 resolved conflicts for merge of 42f55d1e to master
Change-Id: I9c26861c5b0e26bb55e50b2133b7561348a01aec
2015-03-12 16:17:45 -07:00
Mike Lockwood
f2cd802402 MidiDeviceInfo meta-data improvements:
Add property for user visible device name
Add names for input and output ports
Rename "model" to "product" to match USB specification.

Change-Id: I8dc50da935f26825ffc73de456d34e7933aa987c
2015-03-12 12:05:47 -07:00
Ronghua Wu
67cf4a06c7 Merge "drm: add EVENT_SESSION_RECLAIMED for resource manager." 2015-03-12 18:05:47 +00:00
John Spurlock
a48d779dad Volume policy updates.
- Make volume policy settable by the volume UI instead
   of hardcoded in AudioService.
 - Add status bar icon for silent mode.
 - Limit unmute-on-volume-adjust behavior to tvs.
 - Ensure all changes to device volume are sent through
   setIndex so no change events are missed.

Bug: 19260237
Change-Id: Iea070a7a6f90ff620e39629f2da3f33f87223d72
2015-03-12 13:57:08 -04:00
John Spurlock
9087433753 AudioService: Write base stream volume changes to the event log.
- Add a new volume_changed event, reported at the stream level.
 - Only include changes to base streams (no aliases).
 - Include the caller for each change.  A caller is either:
   -  a pkg name (for external calls or known media sessions)
   -  a system server class's log tag (for internal calls,
      disambiguates "android")

Bug: 19599935
Change-Id: Ia61b68ff1e7e2907a24972790ec052bfe099e665
2015-03-12 09:54:10 -04:00
Mike Lockwood
57baee2e12 Merge "MidiManager: Add MIDI device status notifications" 2015-03-11 19:43:49 +00:00
Mike Lockwood
70bea13774 Merge "MidiDevice: Add support for making direct connections between ports" 2015-03-11 19:43:31 +00:00
Mike Lockwood
5ff9e2a171 MidiManager: Add MIDI device status notifications
MidiManager clients can be notified of device status changes via a new MidiDeviceStatus object.
MidiDeviceStatus contains the busy status of the device's input ports and number of
connections to the output ports.
MidiDeviceService now has an optional callback for receiving notifications when its ports change as well.

Change-Id: I1600df4464d82724bc026c27b9633ae9c412d3f0
2015-03-11 10:19:45 -07:00
Mike Lockwood
46326e59a0 MidiDevice: Add support for making direct connections between ports
The output port of one device can be connected to the input port of another
device using the new MidiDevice.connectPorts() method.
This allows an application to direct the output of one device directly
to the input port of another without having to copy data from one to another.

Change-Id: I4d361c4e0950b9b9516b0c2f0c158677b1aca208
2015-03-11 10:19:37 -07:00
Marco Nelissen
926ebb860a Fix context leak
Using an activity context with AudioManager could cause that context
to be held on to longer than desired, for example if the caller
acquired audio focus but never abandoned it. Fix acquire/abandon in
VideoView, and use the application context in AudioManager to mitigate
the issue for other misbehaving code.

Bug: https://code.google.com/p/android/issues/detail?id=152173
Change-Id: I0fb8390207422c784800dda25b1f2c03d4574bcd
2015-03-11 10:00:28 -07:00
Mike Lockwood
22e78c65be Merge "Add MidiReceiver.send() and MidiReceiver.getMaxMessageSize()" 2015-03-11 10:55:43 +00:00
Mike Lockwood
0c7342f015 Add MidiReceiver.send() and MidiReceiver.getMaxMessageSize()
Change-Id: I10d4f5e2400fcaf41f455e56ca25bbc0c781a042
2015-03-11 03:51:38 -07:00
Dongwon Kang
071b2c72a8 TIF: Add getDescription() method to TvTrackInfo.
This is useful when language is not enough for describing the track.
E.g. main audio track(eng) vs audio commentary(eng)

Bug: 19302103
Change-Id: Iebffb943d2c0b5f7a7a12820ff3475b66e0130e8
2015-03-11 10:26:47 +09:00
Narayan Kamath
c9a245a45e am debf5a09: am c2826fb9: am 3d333c74: Merge "Fix typos in AudioManager javadoc"
* commit 'debf5a09e46027f29c26b6502d4aa6508dd3e4b5':
  Fix typos in AudioManager javadoc
2015-03-11 00:23:35 +00:00
Narayan Kamath
c2826fb922 am 3d333c74: Merge "Fix typos in AudioManager javadoc"
* commit '3d333c745f928ca1595aca111d9938fa3cf3e282':
  Fix typos in AudioManager javadoc
2015-03-10 15:23:06 +00:00
Eemi Haukkala
bc68256fea Fix typos in AudioManager javadoc
The ACTION_HDMI_AUDIO_PLUG constant's description
had spelled "HDMI" as "HMDI" and was missing a
period. Fixes issue 93726.

Change-Id: Idfd5352dba022afcd81bc9e50864fc6e95c661db
Signed-off-by: Eemi Haukkala <eemi.haukkala@gmail.com>
2015-03-10 15:10:05 +00:00
Mike Lockwood
7f602b75ee Merge "MIDI Manager changes:" 2015-03-10 02:03:00 +00:00
Eino-Ville Talvala
62d9670e98 Merge "Add DEPTH image formats, support in ImageReader" 2015-03-10 00:16:16 +00:00
Eino-Ville Talvala
805f3c9428 Add DEPTH image formats, support in ImageReader
- Add an explicit mapping between public ImageFormat/
  PixelFormat enums and internal HAL format/dataspace.
- Add DEPTH16 and DEPTH_POINT_CLOUD formats
- Wire up mapping layer to ImageReader to support depth
  formats

Change-Id: I8197eccef900cc91baddcfcb934ccd4d8c972eff
2015-03-09 16:42:25 -07:00
Eric Laurent
00a009204e enable FM tuner and hotword capture for system apps.
AudioRecord constructor with AudioAttributes and session ID as well
as HOTWORD and RADIO_TUNER audio sources are now system APIs.
Renamed MediaRecorder.AudioSource.FM_TUNER to
MediaRecorder.AudioSource.RADIO_TUNER.

Change-Id: I231c20c21e3e8cffe1837482976ebe284c9af541
2015-03-09 13:06:05 -07:00
Mike Lockwood
be215dd572 MIDI Manager changes:
Add CloseGuard support to MidiDevice and MidiDeviceServer
Make MidiDevice.close() thread safe
Make non-subclassable API classes final
Other misc cleanup

Change-Id: I7a5d31b06b8c2403cfbc5597c5c1395f0ac90194
2015-03-09 11:58:04 -07:00
Mike Lockwood
4a3d7ed45d MIDI Manager: Add explicit close mechanism for input and output ports
Relying on errors from closing the file descriptor is not reliable
and was resulting in file descriptor leaks in device servers.

Change-Id: Ib5cc22dba493eae6608a12cc6d4178d8390da77b
2015-03-06 12:17:12 -08:00
Mike Lockwood
eebc98ff18 MidiDeviceService: Add getDeviceInfo() accessor method
so service implementations can access their own device info object.

Change-Id: I93e0c449e72d76568d7b4c9f7f7db00a846b5a33
2015-03-06 08:17:33 -08:00
Mike Lockwood
35110d1ed7 Add MidiDevice.close() method so we can clean up our ServiceConnection
Change-Id: I65cd4cfd940b02709daeffef6dab814305b8a6b0
2015-03-04 20:38:42 -08:00
Mike Lockwood
3b7664589b Make MidiSender and MidiReceiver abstract classes, rename MidiReceiver.post() to receive()
Change-Id: I1cef3bd48ca0acf2968c9de223f78445f3434404
2015-03-04 20:38:37 -08:00
Mike Lockwood
20821ecbe8 Eliminate MidiPort base class for MidiInputPort and MidiOutputPort
Change-Id: I628c0468ac980eee909add53a4d6e55e9b358603
2015-03-04 16:15:45 -08:00
Mike Lockwood
c623ec973b Merge "MidiManager: Virtual MIDI devices are now implemented as Services" 2015-03-05 00:01:33 +00:00
Ronghua Wu
a6d72095ed drm: add EVENT_SESSION_RECLAIMED for resource manager.
Bug: 19265536
Change-Id: Ifa15a4c7d3a7c20cb00bd4aefb57d239c0efaafa
2015-03-04 15:26:42 -08:00
John Spurlock
75328b703f Merge "Audio: Remove the concept of master volume." 2015-03-04 22:59:41 +00:00
John Spurlock
ee5ad729b9 Audio: Remove the concept of master volume.
- Remove two config resources (use master volume, and volume ramp).
- Remove master volume adjustments / getters / intents.
- Retain @hidden setMasterMute, needed for device admin
- Remove master volume logic in AudioService.
- Remove master volume logic in VolumePanel.
- Rename "getMasterStreamType" to "getUiSoundsStreamType" to avoid confusion.

Bug: 19582978
Change-Id: Id02c8fa4898cff3b913147f5ac1b4038e2e7cc24
2015-03-04 17:51:44 -05:00
Mike Lockwood
11fd96d6ff MidiManager: Virtual MIDI devices are now implemented as Services
To implement a virtual MIDI device, include a subclass of MidiDeviceService in
your application.  This service is identified by an intent filter and meta-data
in the application's manifest to allow the MIDI manager to register the virtual device
without actually running the application. Instead, the application's MidiDeviceService
subclass is started on demand when MIDI manager clients want to open the device.

Here is an example of how the MidiDeviceService might be described in the application manifest:

    <service android:name="VirtualDeviceService">
        <intent-filter>
            <action android:name="android.media.midi.MidiDeviceService" />
        </intent-filter>
        <meta-data android:name="android.media.midi.MidiDeviceService"
            android:resource="@xml/device_info" />
    </service>

and the device_info.xml meta-data:

<devices>
    <device manufacturer="Sample Manufacturer" model="Sample Model" private="false">
        <input-port name="my input port" />
        <output-port name="my output port" />
    </device>
</devices>

(note that the <input-port> and <output-port> names are not currently used, but support for these
will be added in a subsequent change)

Client's of the virtual device will bind directly to the hosting application's MidiDeviceService subclass.
To support this, MidiManager.openDevice() now returns the MidiDevice asynchronously via a callback.

This change also adds a utility class called MidiDispatcher, which is a MidiReceiver
that dispatches all data it receives to a list of other MidiReceivers.
We now use this internally in MidiInputPort and MidiDeviceServer, but developers
may use it for other purposes as well.

Change-Id: Ic3009f06d56f3d5edbd87de3f0c330b51a1c217d
2015-03-04 13:45:38 -08:00
Wei Jia
d93fcf4002 MediaPlayer: add setPlaybackRate JAVA API.
Bug: 19196501
Change-Id: I43daced7d9b53bcaca4e6a8d81ca729b32efc79f
2015-03-03 14:43:55 -08:00
John Spurlock
08c7116ab9 Remove unused imports in frameworks/base.
Change-Id: I031443de83f93eb57a98863001826671b18f3b17
2015-02-28 14:47:49 -05:00
Chong Zhang
cff41ae363 Merge "MediaRecorder: pass capture fps in float" 2015-02-24 22:22:11 +00:00
Mike Lockwood
b673770f71 Add MIDI Manager API tweaks:
- Change the package name from android.midi to android.media.midi

- Add option for specifying a Handler for DeviceCallback notifications

Change-Id: Ia9e9817a651c06299f4e02ee1da3c9666ff64cb9
2015-02-23 14:32:23 -08:00
Chong Zhang
fbdee2c04b MediaRecorder: pass capture fps in float
bug: 19460202
Change-Id: I4723c8ed44b4de399de2f3bf051b2d1a4e881910
2015-02-23 22:00:39 +00:00
Paul McLean
ceb47aae5a Changing AudioManager.listAudioDevicePorts to take a ArrayList<AudioDevicePort> argument.
Change-Id: Ide9a2f58a7544e263600e100ba4274403201c5fa
2015-02-19 15:33:34 -08:00