967 Commits

Author SHA1 Message Date
Christopher Tate
405d089863 DO NOT MERGE: Fix loss of focus after wakeup into incall screen
Because of the asynchronous behavior of keyguard, and incall explicitly
disabling keyguard, sometimes the window manager would wind up in a state in
which the "correct" app and activity window were shown, but focus was
recalculated "too soon," at a time when keyguard was just about gone but not
quite, and incall was not yet fully shown.  In this case there was no currently
valid event target, but the final show of the incall window would not prompt a
focus recalculation, so that "no current focus" state would incorrectly persist,
resulting in spurious ANRs until some other phone activity forced a focus
update.

We now detect the problematic case when windows are shown, and make sure to
recalculate focus explicitly thereafter.  This change does *not* fix the
underlying race conditions that have been resulting in mismatched state within
the window manager, but it does force a validation pass that puts things in
order so that normal operation can continue.

Change-Id: I8e7f5f0795f0042a0da074aeed385e3fbc210360
2009-10-28 11:52:58 -07:00
Mike Lockwood
dd9668ec63 PowerManagerService: Animate LCD backlight changes due to autobrightness support.
Change-Id: I9c242127df801125c30f399198d1f7e9c8579612
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-27 15:47:03 -04:00
Mike Lockwood
2d155d264e PowerManagerService: Fix bug resulting in backlights turning on while screen is off.
Fixes bugs b/2216879 and b/2197060

Change-Id: I5de3cbdbc0601dd7950dba74cacfff06d41ad18e
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-27 09:47:50 -04:00
Mike Lockwood
809ad0fce3 PowerManagerService: Clear Binder calling identity around calls to Sensor Manager.
This fixes a problem that resulted in bogus battery statistics for the prox and light sensors
due to the sensors being enabled in an app's context and disabled in the system context.

Fixes problems reported in bug b/2211960

Change-Id: Ib0d3d9d06f043b386d3b8d494b9bad5bd40bb6e1
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-26 22:12:06 -04:00
Mike Lockwood
86328a99bd LocationManagerService: clear calling identity in mock provider calls.
Fixes bug b/2198028 (testDirectionsFromScratchByTyping fails because of android.permission.ACCESS_WIFI_STATE)

Change-Id: I44e95981d805189ed6d906d388c5189ee788802f
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-26 16:18:58 -04:00
Mike Lockwood
3333fa4f3d PowerManagerService: Ensure that recent changes do not effect the hardware ALS case.
Change-Id: I42d2d1331c2a6234dfbdaa99f0cc8ab249f7ce22
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-26 14:52:00 -04:00
Mike Lockwood
6eb14c3038 PowerManagerService: Do not enable light sensor if hardware backlight management is being used.
Change-Id: Ic652ac22ec3256d71d12504148927349dfbd3384
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-24 19:43:38 -04:00
Dianne Hackborn
7580493b01 Implement feature #2117336: Create event communication APIs for live wallpaper
Note: currently only implements an async version (no result), and not yet
actually tested.

Change-Id: Id47ed045a4b0eb309ea8c58daf41a0e03eff1d3a
2009-10-22 20:10:53 -07:00
Android (Google) Code Review
94f2c52421 Merge change I63c2d9ed into eclair
* changes:
  Update the names of the widgets when the locale changes.
2009-10-22 18:38:29 -04:00
Eric Fischer
63c2d9ed9c Update the names of the widgets when the locale changes.
Bug 1814373, Bug 2152730
2009-10-22 15:28:05 -07:00
Mike Lockwood
3c9435a205 PowerManager: Don't poke user activity in setKeyboardVisibility unless the state actually changed.
Fixes bug b/2158297 (lock screen should time out after 7 seconds)

Change-Id: Ia3f7ef6464129ab78283923dbfd7f7472136e676
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-22 15:45:37 -04:00
Android (Google) Code Review
fee0f57733 Merge change I99dc6477 into eclair
* changes:
  Add WindowManagerPolicy.allowKeyRepeat() method for disabling key repeats.
2009-10-22 07:07:04 -04:00
Android (Google) Code Review
eadb97b482 Merge change I53f83502 into eclair
* changes:
  PowerManagerService: Ignore user activity while the screen is animating off.
2009-10-22 07:06:51 -04:00
Mike Lockwood
3d0ea72dd7 Add WindowManagerPolicy.allowKeyRepeat() method for disabling key repeats.
Part of a fix for bug b/2198537

Change-Id: I99dc64772fa7644b12432d5549603025196ea3e2
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-21 23:08:13 -04:00
Mike Lockwood
f003c0c15d PowerManagerService: Ignore user activity while the screen is animating off.
Fixes bug b/2202165 (Often I when pressing power to turn off I get the lock screen)

Change-Id: I53f8350203d57fbb5f143edc44985879caadd78f
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-21 23:06:56 -04:00
Android (Google) Code Review
0737b16430 Merge change I959a6f46 into eclair
* changes:
  Fix bug	2194213: Non-default system IMEs are enabled, but not initially shown in input method switcher.     - Ensure system IMEs are put on the enabled list at startup/install.     - If the default IME is not installed, choose another one whenever building input method list.
2009-10-21 22:58:39 -04:00
Brandon Ballinger
6da35a0c12 Fix bug 2194213: Non-default system IMEs are enabled, but not initially shown in input method switcher.
- Ensure system IMEs are put on the enabled list at startup/install.
    - If the default IME is not installed, choose another one whenever building input method list.
2009-10-21 18:24:29 -07:00
Android (Google) Code Review
8d9ddbe2aa Merge change I1f30f3f1 into eclair
* changes:
  Fix #2201615: getCallingPackage returns calling process instead of calling package
2009-10-20 19:14:20 -04:00
Android (Google) Code Review
5b48223d0e Merge change I14e833fa into eclair
* changes:
  If we fail to persist the current settings and fall back to the back settings file when reading settings in PackageManager, we might rename the corrupted settings to backup(in case of power failure between the earlier write failure and file deletion) and end up loosing both files. So just clear up the corrupted current settings file if we have backup. The backup wouldn't exist if everything went well with persisting the earlier settings.
2009-10-20 18:51:06 -04:00
Dianne Hackborn
9bbcb916c5 Fix #2201615: getCallingPackage returns calling process instead of calling package
Change-Id: I1f30f3f1ce8928796c1ab502d0c2dc02de86e8e7
2009-10-20 15:42:38 -07:00
Suchi Amalapurapu
14e833faa0 If we fail to persist the current settings and fall back to the back settings file
when reading settings in PackageManager, we might rename the corrupted settings to
backup(in case of power failure between the earlier write failure and file deletion)
and end up loosing both files.
So just clear up the corrupted current settings file if we have backup.
The backup wouldn't exist if everything went well with persisting the earlier settings.

We do this in both read and write just in case.
2009-10-20 13:26:37 -07:00
Android (Google) Code Review
61462b4370 Merge change I1864d098 into eclair
* changes:
  Improve wallpaper offset handling.
2009-10-20 14:27:55 -04:00
Android (Google) Code Review
359f0b0998 Merge change Ib5736616 into eclair
* changes:
  Fix issue #2191572: Difficulties drawing window shade
2009-10-20 14:22:37 -04:00
Mike Lockwood
fa68ab4fb0 PowerManagerService: Add missing synchronization in mAutoBrightnessTask.
Change-Id: Ie9b93253e991f709b223b28a9148be3b254fb273
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-20 11:08:49 -04:00
Mike Lockwood
6c97fcabbc Power Manager light sensor fixes:
Fix problem with ignored sensor events right after screen turns on.
Do not flash button backlights when device is booting.
Process the first light sensor change after waking the screen immediately rather than debouncing.
Cancel mAutoBrightnessTask when light sensor is disabled.

Change-Id: Iffc5e090b239432b7643812fa8ecb5f69da1679d
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-20 08:56:52 -04:00
Mike Lockwood
d7786b41b7 Power Manager support for light sensor backlight management.
Change-Id: I470e2d7d12abf0dbfd31d84859b06bfae3cb36a1
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-19 22:30:34 -04:00
Dianne Hackborn
73e92b4291 Improve wallpaper offset handling.
Fiddle around with the offsets of wallpapers to have better defaults, and
update the offset when the currently wallpaper target is not setting an
offset itself.

Change-Id: I1864d098fb4813fb0c67857af8ebf398b35e6876
2009-10-19 15:53:45 -07:00
Dianne Hackborn
dc95372cb5 Fix issue #2191572: Difficulties drawing window shade
The touch location filtering hacks had a little problem.

Change-Id: Ib57366169c87f83af1adcc8b6a00dadc01582339
2009-10-19 15:52:22 -07:00
Amith Yamasani
f37447bad3 Proper fix for zero signal strength and no_service. Fixes #2176141
Track phone service state changes and use a separate timer for out-of-service
since the hunting can timeout on some devices.

Store the timeout value in the config.xml, as it is device/network specific.

Settings App will also change to use the hunting duration to compute the cost
of zero signal.
2009-10-19 15:16:26 -07:00
Android (Google) Code Review
c75348a938 Merge change Ib897cff1 into eclair
* changes:
  do not merge Return valid package info for packages that have been uninstalled with an option to retain data and resources using the flag GET_UNINSTALLED_PACKAGES These packages do not have a package setting. just check the flag and return the required info from PackageParser.generatePackageInfo
2009-10-16 15:36:40 -04:00
Android (Google) Code Review
0b08abe1b8 Merge change I9521cf8b into eclair
* changes:
  Register for light sensor events if non-hardware based auto-brightnees is enabled
2009-10-16 12:29:39 -04:00
Android (Google) Code Review
f55aa972f9 Merge change I01935be3 into eclair
* changes:
  Remove PowerManager.setAutoBrightness()
2009-10-16 12:29:15 -04:00
Mike Lockwood
8738e0c040 Register for light sensor events if non-hardware based auto-brightnees is enabled
Change-Id: I9521cf8b315306bdafa70c1500f2e4af83d94ec3
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-16 08:40:23 -07:00
Mike Lockwood
dc3494e3d8 Remove PowerManager.setAutoBrightness()
We will use the System.SCREEN_BRIGHTNESS_MODE Settings value instead.
Add SCREEN_BRIGHTNESS_MODE_MANUAL and SCREEN_BRIGHTNESS_MODE_AUTOMATIC constants.

Change-Id: I01935be3fcb48cf76392d2c594205cb47babc5b2
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-16 07:42:26 -07:00
Android (Google) Code Review
034cd0be57 Merge change I486fdb55 into eclair
* changes:
  Fix bug 2183179 - Hitting the back key repeatedly makes the notification shade jump up and down
2009-10-15 23:32:39 -04:00
Joe Onorato
486fdb5596 Fix bug 2183179 - Hitting the back key repeatedly makes the notification shade jump up and down
This thing needs to be rewritten.  It's grown too complicated for what it's doing,
and I don't like the physics anyway.

Also, this leaves the bug where if you press back while it's animating down, the
animation is ignored.  However it no longer jumps down all the way, it just
essentially ignores the back key.

Also, this makes the collapse get executed on the back key up event, so it works
with the swipe on the soft keys at the bottom of the screen.
2009-10-15 20:31:33 -07:00
Suchi Amalapurapu
b897cff1ef do not merge
Return valid package info for packages that have been uninstalled with
an option to retain data and resources using the flag GET_UNINSTALLED_PACKAGES
These packages do not have a package setting. just check the flag and return
the required info from PackageParser.generatePackageInfo
2009-10-15 20:20:00 -07:00
Mike Lockwood
37a13208c9 Add separate configuration flag for hardware ALS support.
A new flag config_hardware_automatic_brightness_available indicates
that the device has hardware support for automatic screen brightness management,
while config_automatic_brightness_available now indicates that automatic
brightness mode is available in general.

If config_automatic_brightness_available is true but config_hardware_automatic_brightness_available is false,
then automatic brightness mode support in PowerManager support will be used.

Bug b/2015734 (Ambient light sensor support in power manager)

Change-Id: I6cd888252043dd63df3c25a1d14c21a04a91ad28
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-15 19:58:33 -04:00
Dianne Hackborn
f2ddfb1528 Another fix for #2186897: Cannot unlock the device by swiping
This was probably a side-effect of the divide by zero exception,
but we'll be safe anyway.

Change-Id: I875200febb9b3090d12f170066b2bea74c9f77f8
2009-10-13 22:47:02 -07:00
Dianne Hackborn
53cd579459 Fix issue #2186709: Can't unlock the device for a while
Change-Id: Iac5342254036cc286ad502dba943520f55ea2405
2009-10-13 19:50:51 -07:00
Android (Google) Code Review
2a21a77d5c Merge change I1369e9ab into eclair
* changes:
  Work on issue #2144454: Inconsistent swipes...
2009-10-13 14:45:56 -04:00
Dianne Hackborn
1411d1c822 Work on issue #2144454: Inconsistent swipes...
This introduces some hacks in the framework to try to clean up the
data we are getting from the touch screen.  There are two main things
being done here:

1. Look for changes in position that are unreasonably large, and
ignore them.  This is intended to eliminate the spurious jumps that
often happen when releasing.

2. Add some simple adaptive averaging of the touch data.  If the
difference between the last and next point is large enough, we
disable the averaging; otherwise we average up to the last 5 points.
The goal is to get rid of the noise of small movements so that things
like taps don't look like short flings, while still responding quickly
to rapid movement.

For averaging pressure, we also weight each averaged coordinate by
the reported pressure at that point.  This is intended to keep the
coordinates closer together during a release, when the pressure is
going down and the accuracy decreasing.  It may also result in some
other interesting artifacts, but hopefully nothing problematic.

Change-Id: I1369e9ab015c406946a45c2d72547da9c604178f
2009-10-13 11:44:29 -07:00
Robert Greenwalt
f1acb2ddcd Add a little logging to diagnose wifi cycle bug
Hiroshi approved (with serious code review).
bug: 2171575
2009-10-13 08:20:55 -07:00
Android (Google) Code Review
6abf7c8fcc Merge change Iad66a274 into eclair
* changes:
  Fix race condition in WindowManagerService.disableKeyguard()
2009-10-12 14:14:44 -04:00
Mike Lockwood
dd8846886a Fix race condition in WindowManagerService.disableKeyguard()
TokenWatcher.acquire() synchronizes on mTokens, not this,
so we need to synchronize on mKeyguardDisabled in disableKeyguard()
to synchronize properly with reenableKeyguard().

This should fix b/2180142 (Stuck in enable keyguard when receiving phone call)

Change-Id: Iad66a2748c7fbf2c516fdb8a00988696719ea80c
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-11 17:07:55 -04:00
Dianne Hackborn
aa80b60b59 Fix issue #2179931: Power key to wake up frequently ignored when in dock app
The dock app is forcing the screen to a particular brightness level.  This
causes the window manager to often call into the power manager with the
new brightness.  This causes us to go in to updateLightsLocked() to figure
out and apply the real brightness to use.  When the screen is off the
real brightness always remains 0, but even if it didn't change from the
last one we would start an animation which would when done put the system
to sleep and fight with the user trying to turn the device on.

Now, if the new target brightness is the same as the last one, we leave the
animation as-is -- either running or not as appropriate.

Change-Id: I067d55ea2b39e294c5d5291587a4d8727c0b8083
2009-10-09 17:38:26 -07:00
Robert Greenwalt
98e0b146b8 Make PhoneStateListeners not call TelephonyManager
Since the StatusBarPolicy is run in the System Process and shouldn't therefore call into
the Telephony process we decided to make sure all the needed info was passed along with the
original notifications.

bug: 2173053
2009-10-09 00:54:31 -07:00
Dianne Hackborn
2c6c5e6e49 Fix issue #2176944: Need API so browser, others can determine memory size of device
Change-Id: I65d91cdb70df91b67fe84297dd6a94d26a785131
2009-10-08 18:43:47 -07:00
Dianne Hackborn
3612487d61 Fix issue #2174566: HOT STABILITY: NPE in activity manager
- Don't crash if the service's app process doesn't have a thread (this
  can happen if we are currently starting the process and then try to
  start the service again).
- Be more robust about deciding to start a service's process: try each
  time it is started; the startProcess call will take care of ignoring
  it if the process is already started.
- Fix some issues where we would leave dead processes on the low memory
  list.

Change-Id: I490e01ba7b45adc191bab7ace377b6873e284897
2009-10-08 16:22:03 -07:00
Mike Lockwood
03d246779e GPS: Fix problem with SUPL when SUPL APN is already active.
Use ConnectivityManager.CONNECTIVITY_ACTION broadcast in LocationManagerService
to notify GPS when SUPL connection is ready instead of TelephonyIntents.ACTION_ANY_DATA_CONNECTION_STATE_CHANGED,
which is not sent in all cases.
Expand LocationProvider.updateNetworkState() to include NetworkInfo object.

Fixes bug b/2155661

Change-Id: Iee227ace7d536b36cf7973e3e6a8b7a621ce6565
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-10-08 17:24:21 -04:00