6685 Commits

Author SHA1 Message Date
Glenn Kasten
d35d3687c7 Merge "Turn off execute bit for ordinary media files" 2012-12-17 12:12:40 -08:00
Andrew Hsieh
eba8254c8c Fix typo
Changed ANDROID_BITMAP_RESUT_SUCCESS -> ANDROID_BITMAP_RESULT_SUCCESS

Change-Id: I3d5525d7dacbf8f007e3230e1ca87b69245a96b1
2012-12-12 11:27:44 +08:00
Glenn Kasten
28d4cf50e7 Merge "AudioTrack error checks" 2012-12-06 16:34:48 -08:00
Glenn Kasten
91c7bc2a8d Merge "Allow more APIs before write in static buffer mode" 2012-12-06 13:48:34 -08:00
Glenn Kasten
e1a2c9f944 Merge "Use the utility logging methods and single tag" 2012-12-06 12:47:17 -08:00
Glenn Kasten
ee88bc8ab9 Merge "Document that ByteBuffer position not updated" 2012-12-06 12:00:44 -08:00
Glenn Kasten
678210251c Merge "Remove dead method native_get_session_id()" 2012-12-06 11:41:34 -08:00
Eric Laurent
942de41bb1 Merge "more fixes on safe volume warning message" 2012-12-06 11:26:40 -08:00
Glenn Kasten
f0336d11f5 Merge "Remove whitespace at end of line" 2012-12-06 11:14:05 -08:00
Glenn Kasten
f94942f1b9 Merge "Import only what's needed" 2012-12-06 08:37:37 -08:00
Eric Laurent
fde16d5879 more fixes on safe volume warning message
Fixes the following problems with safe headphone volume warning message:
- Do not display the warning dialog when screen is off.
- Use the same 3 second timeout as for the volume slider to dismiss the dialog.
- Do not dismiss the warning dialog when touching outside of the slider window
but inside the warning window.
- Disable the volume slider when the warning message is displayed.
- When setting volume directly (touching the volume slider), and the warning
is displayed, save the requested volume and apply it if acknowledged by the user.
- Do not display the warning message when restoring safe volume after 20h of
cumulative listenening

Bug 7658641.

Change-Id: Ib3d1315193a433dad918aa5df78fa071062b2394
2012-12-05 17:59:39 -08:00
Glenn Kasten
a501b5b8d5 AudioTrack error checks
getMinBufferSize():
  Simplify native_get_min_buff_size error checks and handle more errors.

setPlaybackHeadPosition():
  Disallow for streaming mode [underlying AudioTrack C++ requires this].
  Disallow setPlaybackHeadPosition before write().
  Remove unnecessary synchronization around native_set_position().

setLoopPoints():
  As setLoopPoints() is effectively a variant of setPlaybackHeadPosition(), do the same error checks.

write():
  Don't set "write completed" state if write() parameters are invalid or native write fails.
  It was setting "write completed" flag too early, and ignoring native write return value.
  Detect integer overflow.

reloadStaticData():
  Disallow reloadStaticData() before write().

Change-Id: Iec36fc0ea67095e18a2c238b148dad5545c102c1
2012-12-05 17:08:48 -08:00
Glenn Kasten
9c1d2de177 Merge "Make mInitializationLooper final" 2012-12-05 15:44:07 -08:00
Glenn Kasten
4e71faec0c Merge "Simplify throw statements" 2012-12-05 15:35:39 -08:00
Glenn Kasten
0fc11dd059 Merge "Remove redundant AudioTrack. qualifiers" 2012-12-05 15:28:06 -08:00
Glenn Kasten
df3cb52798 Remove redundant AudioTrack. qualifiers
Symbols of the current class don't need to be qualified.

Change-Id: Ic89ce568771165d01d4b5bcf835c591ca0b86541
2012-12-05 15:24:40 -08:00
Andreas Huber
08067d376e Make it clear that non-optional MediaFormat keys are required
Also mark KEY_CHANNEL_MASK optional.

Change-Id: I569087f564dc60a89b15a3440a9b1c538927f610
2012-12-05 11:12:26 -08:00
Eric Laurent
526b035bc5 Merge "Allow mute when playing over fixed volume device" 2012-12-04 18:25:37 -08:00
Glenn Kasten
1e821372be Merge "Replace hard-coded sample rate values by constants" 2012-12-04 16:32:41 -08:00
Eric Laurent
3ef7549876 Allow mute when playing over fixed volume device
Modified AudioService to add the possibility to mute/unmute music
with volume keys while playing over fixed volume devices (HDMI, digital dock).
VOL- forces volume to 0 and VOL+ forces volume to maximum.

Bug 7377764.

Change-Id: Ibaf805d76c30e3c0e395547cd3ce0087dbfb9f30
2012-12-04 14:29:24 -08:00
Marco Nelissen
a5c9fd93cc Merge "Fix default ring/alarm/notification insertion" 2012-12-03 15:39:42 -08:00
Marco Nelissen
4ecfce6f6f Fix default ring/alarm/notification insertion
Before directly inserting an item that is the default ringtone, alarm or
notification, flush the MediaInserter, since a parent of the inserted item
might not have been flushed yet.

b/7650557

Change-Id: Icdd25bd9cac8b43a75e63318b936246562744c59
2012-12-03 15:15:47 -08:00
Andreas Huber
1adc5975fa am 800c8ab6: am 2644494a: Merge changes I8462f040,Ie471f40f
* commit '800c8ab68d695f1b6c5332c80a32316cdca69954':
  MediaCodec: Allow getting the codec info directly
  MediaCodec: Allow getting the chosen component name
2012-11-30 14:28:14 -08:00
Andreas Huber
800c8ab68d am 2644494a: Merge changes I8462f040,Ie471f40f
* commit '2644494a9841c1f842d790b60911699f09eb63d1':
  MediaCodec: Allow getting the codec info directly
  MediaCodec: Allow getting the chosen component name
2012-11-30 14:26:16 -08:00
Andreas Huber
2644494a98 Merge changes I8462f040,Ie471f40f
* changes:
  MediaCodec: Allow getting the codec info directly
  MediaCodec: Allow getting the chosen component name
2012-11-30 13:26:51 -08:00
Eric Laurent
b686eceac9 am b46857d2: am b1f45c4a: am c3eb57b2: Merge "AudioService: improve initial safe volume delay" into jb-mr1.1-dev
* commit 'b46857d228edc53878e738ffd484dea1acf44baf':
  AudioService: improve initial safe volume delay
2012-11-30 09:33:01 -08:00
Eric Laurent
b46857d228 am b1f45c4a: am c3eb57b2: Merge "AudioService: improve initial safe volume delay" into jb-mr1.1-dev
* commit 'b1f45c4a587e5adda39774a867c78b56682c5f0d':
  AudioService: improve initial safe volume delay
2012-11-30 09:31:03 -08:00
Eric Laurent
c3eb57b22f Merge "AudioService: improve initial safe volume delay" into jb-mr1.1-dev 2012-11-30 09:26:30 -08:00
Eric Laurent
05274f348e AudioService: improve initial safe volume delay
AudioService relies on a valid mmc in order to enforce the headset
volume limitation or not. There is a timeout to enforce the limitation
if no mcc is configured after boot.
Until this timeout is reached or a valid SIM is detected the headset
volume is not limited.

This change makes that the last known volume limitation state (enforced or
not) is persisted so that next time we boot, last known state is applied until
a new mcc is configured if any. In most cases, the mcc does not change from one
boot to the next and we do the right thing. If teh mcc does change, the correct
policy will be enforced when the mcc is detected or after the timeout.

Also fix a bug where the volume panel was not displayed if the limitation mechanism
is triggered at the first press on VOL+ key.

Bug 7455275.

Change-Id: Id0f2996d893d38c6a14f4f9e4a0e9e3be17ef127
2012-11-29 17:46:05 -08:00
Glenn Kasten
f4e58051e2 Simplify throw statements
Conventional throw statement syntax does not require parentheses

Change-Id: I9cb3e76d60d688d2e0b77a18674527a87548e297
2012-11-29 16:47:37 -08:00
Glenn Kasten
ad67c95464 Replace hard-coded sample rate values by constants
Change-Id: If561dd4d336a70dfda3b741d4e50e289a978580c
2012-11-29 16:32:23 -08:00
Glenn Kasten
3b4df62704 Allow more APIs before write in static buffer mode
There's no need to prohibit these APIs before the first write()
which sets up the PCM data to be played.

Change-Id: Iffbb799e7a588250dbb90a4a4575cfef143a8966
2012-11-29 15:42:11 -08:00
Glenn Kasten
b09707a041 Make mInitializationLooper final
This emphasizes that it doesn't change after construction,
and will prevent accidental modification in the future.

Change-Id: I18a2cecda79bd936967de26cdaaa7b731559545d
2012-11-29 15:30:45 -08:00
Glenn Kasten
1f61d01508 Use the utility logging methods and single tag
Change-Id: I5bfc66562a4a0630d520390ae886bd19de3327cb
2012-11-29 15:24:11 -08:00
Glenn Kasten
089f6ccac8 Remove dead method native_get_session_id()
Change-Id: Ibab9eef28d6b85d622de310b31ee7d070e543c6b
2012-11-29 14:37:52 -08:00
Adam Powell
03919d4084 am 2a1f11e9: am 57c23a46: am 10479a29: Merge "Clean up behavior of type arguments for MediaRouter#getSelectedRoute" into jb-mr1.1-dev
* commit '2a1f11e9750951d072d04155cfe3b7b7f7b96bb7':
  Clean up behavior of type arguments for MediaRouter#getSelectedRoute
2012-11-29 14:33:00 -08:00
Glenn Kasten
9121a032bb Import only what's needed
Change-Id: I93e86e36569496b4bd08f58a8681e6471341ad3d
2012-11-29 14:30:50 -08:00
Adam Powell
2a1f11e975 am 57c23a46: am 10479a29: Merge "Clean up behavior of type arguments for MediaRouter#getSelectedRoute" into jb-mr1.1-dev
* commit '57c23a464a8428f089531a5d3cab20c81eb6ccee':
  Clean up behavior of type arguments for MediaRouter#getSelectedRoute
2012-11-29 14:26:57 -08:00
Glenn Kasten
5e958ed0cd Remove whitespace at end of line
Change-Id: Ie421899ddcb3c488902648ccbf628c075af05a91
2012-11-29 14:14:33 -08:00
Adam Powell
1cf2ca8358 Clean up behavior of type arguments for MediaRouter#getSelectedRoute
MediaRouter's policy so far has been around a single selected route,
but when route types are entirely orthogonal this should not be the
case. However we still don't want to get into a situation where we
have multiple, very different routes selected for different types at
the same time, we still want to have more of an element of
predictability.

Behavior of getSelectedRoute is now:

* If the selected route matches at least one type with the requested
  type flags, it is still considered selected for that request.

* If the caller specifically requested the selected user route and the
  currently selected route is not a user route, return null.

* If the requested type flags do not match any types with the selected
  route, return the default system route.

Note that this is "any" behavior instead of "all" - this matches
existing usage of the method. We may consider adding an "all" variant
later on.

Bug 7588042

Change-Id: I3a79d8153ca6b882fd3ef6b9b1de8f538873dec2
2012-11-28 11:22:01 -08:00
Jean-Michel Trivi
0572954507 am 015ec39d: am 5985d106: am c7dd6640: Merge "Fix audio focus evaluation order for display update" into jb-mr1.1-dev
* commit '015ec39dffe54687781357f9ef751b6218159c5d':
  Fix audio focus evaluation order for display update
2012-11-20 18:07:10 -08:00
Jean-Michel Trivi
015ec39dff am 5985d106: am c7dd6640: Merge "Fix audio focus evaluation order for display update" into jb-mr1.1-dev
* commit '5985d106f784388f979f86598408cb7c8615ebee':
  Fix audio focus evaluation order for display update
2012-11-20 18:05:09 -08:00
Jean-Michel Trivi
4dd3fb3e2c Fix audio focus evaluation order for display update
Change 1f9196a8e5de9b004e61afabc70b18caf7cf9c7e introduced
 an issue when trying to ignore audio focus entries in the
 stack that don't use the music stream, or are for transient
 audio focus gain, for remote control display updates.
The bug was that the audio focus stack traversal was not
 starting from the top, as it should. It was using
 the iterator order, which, in the case of a stack, starts
 with the bottom-most entry.
The fix consists in traversing the stack from the top, i.e.
 from the last element of the vector used to hold the stack
 entries.

Bug 7311023

Change-Id: I0c1900dbf98599a621a420ab55531a3eee838fe5
2012-11-20 17:59:34 -08:00
Marco Nelissen
68cc52cf67 am 803db164: am aeb62686: Merge "Fallback to fallbackring if ringtone can\'t be played."
* commit '803db1646aedb451b76d33a4f30b16942c5d3ca4':
  Fallback to fallbackring if ringtone can't be played.
2012-11-16 13:07:04 -08:00
Marco Nelissen
803db1646a am aeb62686: Merge "Fallback to fallbackring if ringtone can\'t be played."
* commit 'aeb6268645d571dfc9f2d387a7ad2471039ddb54':
  Fallback to fallbackring if ringtone can't be played.
2012-11-16 13:03:33 -08:00
Oscar Rydhé
1c25a21ffc Fallback to fallbackring if ringtone can't be played.
If the specified ringtone file exists but cannot be played
the Ringtone will try to play the ringtone in a remote player.
But since the file is corrupt it will not be played in the
remote player either.
According to the documentation it should attempt to
fallback on another sound. This commit will do that.

Change-Id: I0216d61ca874eef0f168ad4d5bfb07491e01e654
2012-11-16 14:22:14 +01:00
Glenn Kasten
3766755665 Turn off execute bit for ordinary media files
Change-Id: Idbb4f793307d4e1c4af289f855bd4a1a781722db
2012-11-15 15:34:43 -08:00
Martin Storsjo
93077a2902 MediaCodec: Allow getting the codec info directly
This saves the caller from manually iterating through the
MediaCodecList for finding the right codec.

This adds new public API.

Change-Id: I8462f040573427542d86d1b957a5aef53dd55e8e
2012-11-14 20:52:01 +02:00
Andreas Huber
f7f2357338 am 35de4831: am d1e8f467: am 99a86d06: Clarify that MediaFormat.KEY_IS_ADTS only applies to decoding AAC audio content
* commit '35de48317f51a1331e2c6f279c5a2e76b65469ad':
  Clarify that MediaFormat.KEY_IS_ADTS only applies to decoding AAC audio content
2012-11-14 10:45:56 -08:00
Andreas Huber
35de48317f am d1e8f467: am 99a86d06: Clarify that MediaFormat.KEY_IS_ADTS only applies to decoding AAC audio content
* commit 'd1e8f467602307090f36a899b47f5088d0bc0201':
  Clarify that MediaFormat.KEY_IS_ADTS only applies to decoding AAC audio content
2012-11-14 10:24:24 -08:00