7638 Commits

Author SHA1 Message Date
Eric Laurent
10c3fc89a4 audioflinger: fix issue with camcorder and A2DP
Some audio HALs do not support well a device selection of 0 (no device)
received on an input stream.

This can happen because of a problem in the audioflinger code that handles
the forwarding of the output device selection to the record thread for use by
the pre processing modules that need it. If the output device is 0 (meaning
no op, which happens when stopping playback over A2DP) audioflinger could not
detect it was an output device selection and would forward it to the input
stream (see AudioFlinger::setParameters() and RecordThread::checkForNewParameters_l().

Issue 6179641.

Change-Id: Idae534521866538e0d12ba259a2834f402a922e2
2012-03-16 20:37:59 -07:00
Dianne Hackborn
2a29b3ad13 Debugging code for #6169553: Make Phone launch faster
The activity manager now has a tick when launching an app every
500ms, where it collects the current stack traces of the app if
it hasn't finished launching.  These traces are included as part
of dumpstate.

This is only done on non-user builds.

Change-Id: I7f09ea00aab821ac81795f48c9d68fcca65f89fe
2012-03-15 15:48:38 -07:00
Daniel Lehmann
0e87370077 Remove the country detector logging
Bug:6156714
Change-Id: Id0ff60b0530142e2bce055ee8cf8dde94e974aa5
2012-03-12 17:04:17 -07:00
Dianne Hackborn
5c607433e3 Fix issue #6073913: onActivityResult() not getting called...
...if the process is killed and restarted

Try to ensure that in all cases we deliver an activity result if one
was requested.

Change-Id: Id43e830d2ee782f98ed1e3b68e5e16f3258d4ad8
2012-02-28 14:45:23 -08:00
Dianne Hackborn
7663d80f6b Fix issue #6048808: sometimes auto-correct is inactive
My previous change to speed up the time the IME is dismissed was
fundamentally flawed.  That change basically switched the order
the application called the input method manager service from doing
startInput() and then windowGainedFocus(), to first windowGainedFocus()
and then startInput().

The problem is that the service relies on startInput() being done
first, since this is the mechanism to set up the new input focus,
and windowGainedFocus() is just updating the IME visibility state
after that is done.  However, by doing the startInput() first, that
means in the case where we are going to hide the IME we must first
wait for the IME to re-initialize editing on whatever input has
focus in the new window.

To address this, the change here tries to find a half-way point
between the two.  We now do startInput() after windowGainedFocus()
only when this will result in the window being hidden.

It is not as easy as that, though, because these are calls on to
the system service from the application.  So being able to do that
meant a fair amount of re-arranging of this part of the protocol
with the service.  Now windowGainedFocus() is called with all of
the information also needed for startInput(), and takes care of
performing both operations.  The client-side code is correspondingly
rearranged so that the guts of it where startInput() is called can
instead call the windowGainedFocus() entry if appropriate.

So...  in theory this is safer than the previous change, since it
should not be impacting the behavior as much.  In practice, however,
we are touching and re-arranging a lot more code, and "should" is
not a promise.

Change-Id: Icb58bef75ef4bf9979f3e2ba88cea20db2e2c3fb
2012-02-24 13:18:23 -08:00
Dianne Hackborn
01011c3d7c Fix issue #6037252: Screen shifts after all apps are upgraded
Two things: (1) make sure the boot message is always positioned within
the entire unrestricted display, and (2) allow the dim background to go
on top of the nav bar when being used for the boot message (this latter
is really a hack that should be more generally fixed in the future).

Change-Id: I7261b044eb802a39cadff931b50a679ff18781d6
2012-02-21 13:54:21 -08:00
Robert Greenwalt
2384386f31 Stop using shared DUN APN when tethering stops.
Backported from master, including a bug fix and a cdma enhancement.

Even if other people are sharing the connection (ie, carrier wants
default and tethered traffic on the same APN) stop using a carrier-
described APN when the tethering stops.

bug:5972599
Change-Id: I25e4831855e6b62c0c3ab3a6f4d4846aaee6ac50
2012-02-14 11:44:09 -08:00
Mike Lockwood
ece18efb35 Don't pulse LED on new notification unless notification has LED flag set
Bug: 6006131

Change-Id: I719c7d68e310bfaca227f6286159b3993784926b
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-13 20:42:19 -08:00
Kazuhiro Ondo
afd8f1820e Add OEM specific USB mode enumeration based on ro.bootmode property
This patch is adding a capability so that OEM can override USB mode
in case the device is boot up with OEM specific mode. (i.e. modem
debug, factory test etc.)

Bug:5964042
Change-Id: Ic8e23d302563ce71eedb74ce94cca8c65838a4f7
2012-02-10 12:29:12 -08:00
Robert Greenwalt
03d58bc656 Filter our v6 address from tethering dns.
Don't support IPv6 yet, and the tools crash when they see one, so
filter them out.

bug:5913888
Change-Id: Id7096aa70da4e3cc8e4702b0b489c0228a100db9
2012-01-24 16:44:50 -08:00
Eric Laurent
7eeaf3f07a Merge "AudioFlinger: refine mixer sleep time logic" into ics-mr1 2012-01-24 11:49:39 -08:00
Eric Laurent
41773d4655 Merge "DO NOT MERGE Revert "Revert "AudioFlinger: mix track only when really ready (2)""" into ics-mr1 2012-01-24 11:49:16 -08:00
Robert Greenwalt
f449ea9e96 Merge "Use the carrier-given dns addrs for tethering." into ics-mr1 2012-01-24 11:40:19 -08:00
Dianne Hackborn
47163685eb Merge "Another attempt at issue #5823276: home repaints after full-screen app is exited" into ics-mr1 2012-01-24 11:33:15 -08:00
Dianne Hackborn
b7ff51bde9 Another attempt at issue #5823276: home repaints after full-screen app is exited
This is between the two previous attempts.  I returned the part from the
original that was breaking gallery, but have some new code to detect when
something about the window params has changed that would require a
layout pass to make sure we still do a layout then, even if the window is
not currently visible.

Change-Id: I07745e1f66022583e3076b84cc8bbe8bd2acd48f
2012-01-23 19:15:27 -08:00
Eric Laurent
0609231f4f AudioFlinger: refine mixer sleep time logic
When an AudioTrack is in underrun state, the AudioFlinger mixer will
sleep for a short period of time to give the app a chance to fill the
AudioTrack buffer. If the AudioTrack is still not ready during next mixing round,
the mixer will proceed with other tracks.

If an application keeps a steady underrun condition, the AudioFlinger mixer will
alternate between ready and not ready states. In the longer term this will cause the
audio HAL to underrun.
There is a mechanism to reduce the sleep period if the mixer is not ready several times in a
row but this mechanism is defeated by the alternating ready/not ready conditions.

The fix consists in only increasing sleep time if the mixer is ready for at least two
consecutive times.

Issue 5904527.

Change-Id: Id0139bca9be8c4e425ec6d428515c4d8f718e8c9
2012-01-23 18:56:59 -08:00
Eric Laurent
0b08965558 DO NOT MERGE Revert "Revert "AudioFlinger: mix track only when really ready (2)""
This reverts commit b918035d34422a2041b6ec8c09c566bb93345b40.

Change-Id: I093bcfa56ad54a080b930208b6b79169d33581fb
2012-01-23 18:37:07 -08:00
Jim Miller
44760b106a Merge "Revert "Fix 5797764: Increase lock screen's thread priority"" into ics-mr1 2012-01-23 15:49:32 -08:00
Jim Miller
54dbbce1c3 Revert "Fix 5797764: Increase lock screen's thread priority"
This reverts commit 6d6a70a33746ef5147ab146f1802f0db424dd2f1

This doesn't appear to have a measurable impact for this issue.
2012-01-23 15:24:42 -08:00
Justin Ho
b918035d34 DO NOT MERGE Revert "AudioFlinger: mix track only when really ready (2)"
This reverts commit 71c4496a9757438afd30b4404824f296f6158a49.

Change-Id: Iff10c49ea728bb10023ddeb50a3b708db770fff2
2012-01-23 15:02:41 -08:00
Robert Greenwalt
7df80fa4e8 Use the carrier-given dns addrs for tethering.
This fixes a complaint from carriers (that we used 8.8.8.8), but also
fixes the case where there is only room for one live radio
connection: the secondary connection (tethering) doesn't have a
default route to prevent on-device traffic from slipping out on the
tethering connection, but tethered dns is proxied through dnsmasq, so
it is appearing as on-device traffic and is unroutable.  By switching
to the carrier-indicated dns servers we can use the host-routes
already set for those and kill two bugs with one fix.

bug:5898904
Change-Id: Ida8777687994f353b2d4f2c7db5d6ea4b6ac3882
2012-01-23 11:29:37 -08:00
Jim Miller
eaa11a7231 Merge "Fix 5797764: Increase lock screen's thread priority" into ics-mr1 2012-01-20 15:24:20 -08:00
Jim Miller
6d6a70a337 Fix 5797764: Increase lock screen's thread priority
This increases lock screen's thread priority from THREAD_PRIORITY_FOREGROUND
to THREAD_PRIORITY_DISPLAY to ensure it runs before other activities that
might stall lock screen when the screen turns on.

Change-Id: I14cf9f3f5c092817bc6cf2d0a254001a5d34f744
2012-01-20 14:41:55 -08:00
Dianne Hackborn
1bae80668c Merge "Fix issue #5823276 again: home repaints after full-screen app is exited" into ics-mr1 2012-01-20 12:01:51 -08:00
Jeff Brown
5d58eb06bc Merge "Fix a few memory leaks in the input dispatcher. (DO NOT MERGE)" into ics-mr1 2012-01-20 11:24:01 -08:00
Dianne Hackborn
cfbf7dedad Fix issue #5823276 again: home repaints after full-screen app is exited
Don't consider a window as a candidate for the top fullscreen window
if it is not going to be a candiate for layout.

This fix does not include the change to ignore app tokens that are
hidden.  This causes problems in some dialogs that stay hidden until
their app is ready to display, but need to perform a series of relayouts
during that time to get to the right size.  Dropping this part of
the change still (mostly?) seems to allow us to avoid the bad states.

Change-Id: Ic052cb1499d3287f47e9ffeac5cd2470ee5a308c
2012-01-20 11:01:01 -08:00
Justin Ho
170997a519 DO NOT MERGE Revert "Fix issue #5823276: home repaints after full-screen app is exited"
This reverts commit 01b02a734d2988c22b00f5df6346ad03d8bf52b6.

Change-Id: I848c01fc44eb9a51ead1116b2647ed838ec1825f
2012-01-19 15:41:33 -08:00
Jim Miller
230a709285 Merge "Fix 5863053: Add method to lock screen immediately." into ics-mr1 2012-01-18 16:44:52 -08:00
Eric Laurent
71c4496a97 AudioFlinger: mix track only when really ready (2)
This problem due to the way audio buffers are mixed when
low power mode is active was addressed by commits 19ddf0eb
and 8a04fe03 but only partially. As a matter of fact, when more
than one audio track is playing, the problem is still present.
This is most noticeable when playing music with screen off
and a notification or navigation instruction is played: in this case,
the music or notification is likely to skip.

The fix consists in declaring the mixer ready if all active tracks
are ready. Previous behavior was to declare ready if at least one track was
ready. To avoid that one application failing to fill the track buffer blocks other
tracks indefinitely, this condition is respected only if the mixer was ready
in the previous round.

Issue 5799167.

Change-Id: Iabd4ca08d3d45f563d9824c8a03c2c68a43ae179
2012-01-18 12:27:38 -08:00
Jim Miller
93c518e4f8 Fix 5863053: Add method to lock screen immediately.
This fixes a bug where the device fails to lock when DevicePolicyManagerService
requests the device to be locked and the screen was off because the user hit
the power button.

The change allows DPMS to directly invoke screen lock, bypasssing the screen state.

Change-Id: Iecdda6fc61e9c519119de495be23c69c3b983921
2012-01-17 18:11:05 -08:00
Jeff Brown
9f63f121bd Fix a few memory leaks in the input dispatcher. (DO NOT MERGE)
Bug: 5862398
Change-Id: I799ee47b6e5d6c51f45aa4296c6ab8a610b74be5
2012-01-17 14:56:50 -08:00
Dianne Hackborn
2e282f35b0 Merge "Fix issue #5823276: home repaints after full-screen app is exited" into ics-mr1 2012-01-13 12:56:40 -08:00
Christopher Tate
2cf18d2878 Merge "Streamline package-installed handling by the Backup Manager" into ics-mr1 2012-01-13 11:49:20 -08:00
Christopher Tate
0bacfd2ba6 Streamline package-installed handling by the Backup Manager
In particular, don't do O(asec_apps * installed_apps) work during the
broadcast receiver's operation.  On devices with many installed apps
and a large number of them moved to ASECs, this was causing the system
process to become unresponsive and the watchdog to fire -- which in turn
would initiate a restart loop, as the same package-installed broadcast
would then be issued again once the package manager rescanned the ASEC
containers, ad infinitum.  With this change, the expensive call to the
package manager is only made once rather than asec_apps times.

Bug 5850283

Change-Id: I14e280ea1fa6af19cebc58869a20fbb599c92c8c
2012-01-12 16:15:09 -08:00
Chia-chi Yeh
ff321d496a Merge "VPN: silence VPN notifications." into ics-mr1 2012-01-12 14:24:30 -08:00
Dianne Hackborn
01b02a734d Fix issue #5823276: home repaints after full-screen app is exited
Don't consider a window as a candidate for the top fullscreen window
if it is not going to be a candiate for layout.

Also don't consider windows a candidate for layout if their app token
is hidden.  This fixes a transient state where we are preparing to
unhide the window but have not done so yet.

Change-Id: Ife5299ffa003c1df1a4f787b7a2809cbf614ec16
2012-01-12 14:05:03 -08:00
Robert Greenwalt
4b1261f17a Merge "Disable wimax when mobile data is in Settings" into ics-mr1 2012-01-12 09:24:45 -08:00
Chia-chi Yeh
50fe709995 VPN: silence VPN notifications.
Bug: 5852859
Change-Id: I269d8de298a1fd69a8d777150ae97927537a5424
2012-01-11 14:26:24 -08:00
Danielle Millett
de7a2f3054 DO NOT MERGE - Cherry picking from master to MR1
Fix 5783857: Device Policy Manager doesn't allow Face Unlock

This makes it so that if face unlock is enabled and then a device policy
manager that requires something more secure than face unlock is installed,
the user will be forced to choose a new acceptable lock type.

This was previously fixed for the case where the device had been reset, or
the shell was restarted after setting face unlock, but not for the case where the
device remained on between setting face unlock and setting up a device policy
manager.

Also changed the function ordering of saveLockPattern() so that the overloaded
wrapper function is next to the main function.

Change-Id: Ibed8c4ab137ebbc07fb143faef6f047bc6dc4474
2012-01-10 11:40:41 -05:00
tk.mun
b97d34c7c8 Disable wimax when mobile data is in Settings
- Add wimax related code in handleSetMobileData to disable wimax when Moblie data is disabled (Settings -> Wireless & Networks - More -> Mobile Networks ->Data Enabled)

Change-Id: Ibf2d9da2eb90d161128005f26ac4b3e991526af4
Signed-off-by: tk.mun <tk.mun@samsung.com>
2012-01-06 10:32:54 -08:00
Eino-Ville Talvala
b7feb1c91f Switch camera sounds to always use the system enforced audio stream.
Instead of picking between the music stream and the enforced audio
stream, change the camera service to always play sounds through
enforced system stream. Also update the currently-hidden CameraSound
API to match.

Bug: 5778365
Change-Id: I3cc64b1d1ff567dbac8020a665d5b19846197ff3
2012-01-06 10:24:01 -08:00
Eric Laurent
72dafb20e0 audioflinger: fix clicks on 48kHz audio.
The calculation done in prepareTracks_l() for the minimum amount
off frames needed to mix one output buffer had 2 issues:
- the additional sample needed for interpolation was not included
- the fact that the resampler does not acknowledge the frames consumed
immediately after each mixing round but only once all frames requested have been used
was not taken into account.
Thus the number of frames available in track buffer could be considered sufficient although
it was not and the resampler would abort producing a short silence perceived as a click.

Issue 5727099.

Change-Id: I7419847a7474c7d9f9170bedd0a636132262142c
2011-12-22 16:08:41 -08:00
Makoto Onuki
d73b79bb31 Cherry-picking Id45abeba and Ia065dec6 for MR1
-------------------------------------------------------
MCC detection fixes for CountryDetector

- Don't get and cache phone tpe at the initialization time.  At this point
TelephonyManager is probably not ready yet.

- Refresh MCC whenever we get the service state changed callback, even when
the state hasn't actually changed, in order to make sure we get refresh
country properly when MCC changes.

- Also remove the initialization of mPhoneStateListener, which prevented us from
registering phone state listener properly.

- Also fix tests which were already failing.

Bug 5670680

-------------------------------------------------------
Add logging to country detector logic

This is for debugging purposes to verify the effects of
change Id45abeba1b1e843053ac2c946861b439ca568de4.

Bug: 5670680
Change-Id: I238d953484e2c8135f7dac70fce8662c8300a286
2011-12-13 14:02:32 -08:00
Dianne Hackborn
73ab6a49db Fix issue #5755172: Soft menu key disappears when menu is open
We need to work more like before in determining whether the menu
key is needed -- in some cases look back in the window list to
determine this if we don't know the value from the current window.

This requires adding a new private flag indicating whether the
compat menu state is known for a window, which is set by
PhoneWindow as part of its existing process of computing the flag
for its own windows.

Now we can have a new API on WindowState to determine the value
of this flag for a window, which if needed walks back in the window list
to find a window the value is known for (or stops at what the policy
has determined is the top full-screen window, so we stop like we used
to at things like the lock screen or the bottom of an application).

Change-Id: I829de6d629b5af8bcb422cb85249ee4041c7205e
2011-12-13 11:32:11 -08:00
Jeff Sharkey
d04ff11d6f Avoid NPE when missing network stats.
Bug: 5750339
Change-Id: I4b739dbd076b270a5a2b2e2a1e0f6e445d8c124e
2011-12-12 18:51:26 -08:00
Chia-chi Yeh
46a4e81dbd Merge "VPN: delete the "abort" file before starting VPN daemons." into ics-mr1 2011-12-08 17:22:16 -08:00
Chia-chi Yeh
c187273292 VPN: delete the "abort" file before starting VPN daemons.
Bug: 5714296
Change-Id: Idba41b9f3907747a84387ea4f3e930b3a185a06e
2011-12-08 16:51:41 -08:00
Irfan Sheriff
97ff789332 Merge "Fix wifi bring up at boot up" into ics-mr1 2011-12-08 15:59:26 -08:00
Irfan Sheriff
5401f0b87b Fix wifi bring up at boot up
Bug: 5719176
Change-Id: Iac879fc634f6ab6289b73c46931d754bc0af2f87
2011-12-08 15:50:47 -08:00
Irfan Sheriff
4494c90616 Handle emergency call back mode correctly
Bug: 5726996
Change-Id: I5815dd402bd73c530b9ba6d545d8956064949aa2
2011-12-08 11:31:52 -08:00