2329 Commits

Author SHA1 Message Date
Jean-Michel Trivi
04152f98ff Merge "Fix bug 2599698 Music paused by itself The NotificationPlayer sets an OnCompletionListener on the MediaPlayer it's using to play the notification. NotificationPlayer relies on the completion event to abandon audio focus. The player was started before the listener was set. The theory about the bug is that the player finished playing before the listener was called. Therefore the audio focus was never abandonned, and the music didn't resume." into froyo 2010-04-19 09:41:19 -07:00
Mike Lockwood
3110bf6df1 Merge "Fix inconsistency in how we handle light sensor when battery is low." into froyo 2010-04-19 08:18:58 -07:00
Robert Greenwalt
7171ea8179 Make ThrottleService more tamper resistant.
Use elapsed time not wall time for alarms so users can't play with the
system time to get around things.

Also using NTP servers to pull in an authoritative time - if we the build
is configured with an NTP server we will not advance to the next cycle
without it, but we also will not trottle - rather not throttle users
on an error.

Note that the poll alarm is just relative to the last poll time and real
time doesn't matter.

Defining the time-fetching API's as returning time in the system wallclock
range (correcting if we are using NTP time internally).

bug:2597530
Change-Id: I1c0ac0923314c2f8a04edd0b36c4845352eae99a
2010-04-18 10:21:20 -07:00
Mike Lockwood
48358bd5c1 Fix inconsistency in how we handle light sensor when battery is low.
In lightSensorChangedLocked we ignore the light sensor if the battery is low.
But in applyButtonState() and applyKeyboardState() we were still using the previous
mLightSensorScreenBrightness value, which resulted in a race condition that could
leave the button lights on after the screen turns off.
Now we ignore the light sensor value and button brightness override if the battery
is low so the low battery behavior is consistent.

Change-Id: I4943f8904299883211a95596ee207df69d1eaea2
BUG: 2570962

Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-17 22:29:20 -04:00
Irfan Sheriff
cf28236b37 Dont check on interface value on API
The interface check in API could be used
in future.

Bug: 2576057
Change-Id: Icfb78a88be44d1e6a8350c4b65efe70970e658d8
2010-04-16 16:53:20 -07:00
Jean-Michel Trivi
a99f5f43cd Fix bug 2599698 Music paused by itself
The NotificationPlayer sets an OnCompletionListener on the
MediaPlayer it's using to play the notification.
NotificationPlayer relies on the completion event to abandon
audio focus.
 The player was started before the listener was set. The theory
about the bug is that the player finished playing before the listener
was called. Therefore the audio focus was never abandonned, and
the music didn't resume.

Change-Id: Ic3baf359ea24de0d832a655dc47e745b25bc3dec
2010-04-16 16:40:47 -07:00
Robert Greenwalt
e80c6f49d5 Merge "Add multi-sim support to ThrottleService." into froyo 2010-04-15 17:37:55 -07:00
Robert Greenwalt
e6e9882341 Add multi-sim support to ThrottleService.
Uses the last used data until the SIM is available (if ever).  Supports data from
several SIMs for all the world travelers out there.

bug: 2576057
Change-Id: I70e34a51f1c2ccda41a480652b0233b68ff3f538
2010-04-15 17:23:59 -07:00
David 'Digit' Turner
4f99e3c284 Remove native binaries when an updated system application is upgraded through OTA.
The point of this patch is to deal with the following case:

- A system application exists in the system partition. As such its
  native code lies under /system/lib

- An upgrade for it is installed through Market and overrides the
  version on the system partition. This places its native libraries
  under /data/data/<pkgname>/lib/

- Finally, the system is upgraded through an OTA, with an even more
  recent of the system application. We thus must remove the Market
  package as well as the native libraries that are in <dataDir>/lib
  since the new versions in /system/lib will be more recent.

The patch itself removes the files in <dataDir>/lib when such a
situation is detected. Note that this directory is created by the
PackageManager service and owned by the 'system' userID. The application
cannot create files there so simply erasing the content of the directory
is enough (and avoids reparsing the market package file to list
the installed binaries).

The patch also fixes a different issue which can be reproduced with:

- have system app installed on /system partition
- install an update (e.g. adb install -r Term.apk)
- uninstall the update (e.g. adb uninstall com.android.term)

the logcat shows that the PackageManager will unpack the native libraries
from the original /system/app/Term.apk into <dataDir>/lib, while they
already are in /system/lib. The patch fixes that too.

Change-Id: I5dfe27b91b6b31972e9cd4c196d15c3692732127
2010-04-15 10:35:25 -07:00
Mike Lockwood
93597ed183 Merge "Fix wakelock leak in PowerManagerService.sendNotificationLocked()" into froyo 2010-04-15 05:45:21 -07:00
Robert Greenwalt
8090edae9e Merge "Sholes mobile iface comes/goes - handle the reset" into froyo 2010-04-14 20:23:45 -07:00
Suchi Amalapurapu
deb69370ef Revert "Add ordered broadcast when removing packages."
Couple of cosmetic fixes as well.

This reverts commit 0c1285fa979e8b8c170f31d0ef1b4e5d9ddcf6b1.

Conflicts:

	services/java/com/android/server/PackageManagerService.java

Change-Id: Ife0f9f80525f4a41b1f8c12ffc2de62e061e7d5b
2010-04-14 19:58:22 -07:00
Dianne Hackborn
b0ef144286 Merge "Fix issue #258640: Automatic propagation of FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET" into froyo 2010-04-14 19:02:00 -07:00
Suchi Amalapurapu
315a5fb91d Dont fall back to installing on sdcard when internal storage is filled up
when the install location is set to internal only. Similary if install
location is set to external only(via adb), dont fall back to installing on
internal storage if sdcard is filled up.
If nothing is specified ie install location is set to let system decide,
we just check on internal storage.
Fix tests

Change-Id: I7400ccc131782d9c45284bd9ebd0dee43a3b412b
2010-04-14 18:24:06 -07:00
Dianne Hackborn
b67fa45c26 Fix issue #258640: Automatic propagation of FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET
Make sure, if an activity is started with clear task when reset, if that
activity is finished in the middle of a stack that the behavior is retained
by propagating it to the next activity.

Change-Id: Ie31b8f968558b0e64e0ef7efa55950a722c6afa5
2010-04-14 18:01:43 -07:00
Robert Greenwalt
8c7e609b53 Sholes mobile iface comes/goes - handle the reset
The byte counter for the iface goes to zero when it comes back.  Catch that and
do the complex math to correct.

Also add a log entry telling us our desired throttle index.

Lastly, reset the sec/msec part of our reset time so that one calc will == another and not
be off by little bits.

bug:25494925
Change-Id: I99525b72a76316a8e601ceb457ca202fae040bae
2010-04-14 17:31:20 -07:00
Suchi Amalapurapu
0c1285fa97 Add ordered broadcast when removing packages.
Change-Id: I30a84068fa8f2b15564b0a164d339ac95f40e801
2010-04-14 17:13:50 -07:00
Dianne Hackborn
399cccb857 Fix issue #593153: Broadcast time out when sending...
...ordered broadcast for ACTION_EXTERNAL_APPLICATIONS_UNAVAILABLE

Turns out this was because the broadcast receiver for ContextImpl was
not correctly being created, so when it received an ordered broadcast
it would not tell the activity manager when it was done.

This is now fixed, along with a ton of superficial changes to debug
output to help track this down and a little cleanup of dealing with
error cases in dispatching broadcasts.  Also a fix for a NPE when
dumping the broadcast state.

Finally, a little fiddling with package manager to get rid of a lot
of the noise when removing and re-adding packages on the SD card.

Change-Id: I961c14836dc613d3ea8122b6e910ef866e7fcb25
2010-04-14 09:54:21 -07:00
Robert Greenwalt
22b3644ac2 Update the datause icons.
bug:2576057
Change-Id: Idf57d59aecb9bcff635dafa1e77d90a8737a0c08
2010-04-14 09:13:53 -07:00
Robert Greenwalt
9cb66e89cd Merge "Perist Throttle data across reboots" into froyo 2010-04-14 09:07:25 -07:00
Dianne Hackborn
8e1f2f8804 Merge "Fix issue #2555171: Switching to app immediately after unmounting..." into froyo 2010-04-13 18:07:27 -07:00
Dianne Hackborn
ce73c1e5bf Framework change for #2583442: Navigation dies when night mode changes
The window manager doesn't retain its keep screen on lock while
in the process of destroying and creating new activity windows during
a config change.  Now it does.

Unfortunately, this doesn't help maps, since it doesn't use our
lovely KEEP_SCREEN_ON flag. :p

Change-Id: Ida4bc0fcfe132cdff2bd4eeb7ba0ce9731504d14
2010-04-13 18:01:40 -07:00
Dianne Hackborn
ae8c2c71f7 Merge "Fix issue #2420340: if FLAG_SHOW_WHEN_LOCKED, do not show keyguard..." into froyo 2010-04-13 17:57:23 -07:00
Dianne Hackborn
53d9264de4 Fix issue #2555171: Switching to app immediately after unmounting...
...SD card causes reboot.

Add option to not include temporarily unavailable recent tasks,
for the recent tasks UI to not display them.

Change-Id: I1495ca217b4292fd56f537459b44c0624262c292
2010-04-13 17:35:22 -07:00
Robert Greenwalt
b8912f5481 Perist Throttle data across reboots
Never got SharedPreferences working for this system service.  Didn't really need it anyway.
Using a straight up file now.

bug:2576057
Change-Id: Idad926e8242a85e22718c25f3f6c03e5749badac
2010-04-13 16:42:29 -07:00
Robert Greenwalt
d3bb93f687 Add build config values for data use defaults
Don't use hard coded defaults - use build configs instead.

Iface is now ONLY set by config so gservices doesn't need to.

bug:2576057
Change-Id: I8f9e3bc51af3b1cdf8bb4290a43197d9c01e2a14
2010-04-13 15:44:34 -07:00
Suchi Amalapurapu
812b24fd9d Merge "Fix crashes related to unmounting when app on sdcard has an active notification in status bar. When unmounting sdcard, all the secure containers have to be unmounted first before invoking the MountService call back. We send a broadcast about disabled packages. Force a gc to clean up any stale asset references and then unmount the containers before invoking the MountService call back." into froyo 2010-04-13 15:30:07 -07:00
Mike Lockwood
9c90a37c6e Fix wakelock leak in PowerManagerService.sendNotificationLocked()
Change-Id: Ia5f814fe81413dc5350faaf4c79cff47de62d0ed
BUG: 2592894
Signed-off-by: Mike Lockwood <lockwood@android.com>
2010-04-13 15:40:27 -04:00
Suchi Amalapurapu
3d24425165 Fix crashes related to unmounting when app on sdcard has an active notification
in status bar.
When unmounting sdcard, all the secure containers have to be unmounted first
before invoking the MountService call back. We send a broadcast
about disabled packages. Force a gc to clean up any stale asset references
 and then unmount the containers before invoking the MountService call back.

Change-Id: I831da1ae54aeec89de3601b94a4a2fae5dc7e495
2010-04-13 11:20:57 -07:00
Dianne Hackborn
5943c200a4 Fix issue #2420340: if FLAG_SHOW_WHEN_LOCKED, do not show keyguard...
...go directly to unlock screen

Fix a problem where, when we are moving windows due to a configuration
change, our wait to have the windows get redrawn would also
inadvertently make us think their surfaces should be hidden, leading
to nasty things like the lock screen thinking it should be shown
again (and thus forcing the orientation back to portrait).

Change-Id: I79057cfbc93ff59fd3558da997d4f73796e6aabe
2010-04-12 21:36:49 -07:00
Robert Greenwalt
2a7b730378 Fix Throttle Notification intents
Now goes to the correct settings page.

bug:2576057
Change-Id: I21df0e53f7f56ae9bf71f983a3aed200c5ac217d
2010-04-12 14:56:31 -07:00
Dianne Hackborn
17de1532a9 Merge "Fix issue #2581524: Car home icon should always go to car home" into froyo 2010-04-09 16:52:41 -07:00
Dianne Hackborn
f5c5d22c47 Fix issue #2581524: Car home icon should always go to car home
Rework how switching between modes work so the caller can tell us
whether they want to go to home.  (So car home launcher can now
tell us they always want to go home.)

Change-Id: Id4a8129027d6d162b4bae6f983911f1f4bf2578f
2010-04-09 16:49:08 -07:00
Robert Greenwalt
e2c0ce0363 Add warning magic to be a bit more reasonable.
Currently warns if you exceed more than 25% and 2*100%*timeUsed/(timeUsed+totalTime)

The formula means that imagining you've got half of the remaining time that you really have,
we will warn you if you would exceed the quota given your rate so far.  It's generous during the
early to mid-life and converges back to the limit as your timeUsed approaches totalTime.

bug:2576057
Change-Id: Id189de5b026f927ef478fd212d61d9e4ab5239e6
2010-04-09 16:07:08 -07:00
Robert Greenwalt
81aa0971d7 Make ThrottleService notice policy changes.
Added ContentObserver to watch relevant Secure Settings.
Also added new policy-change broadcast to let settings know.
Lastly reorged things a bit so that all of our broadcasts are sent at boot so the sticky ones
are populated.

bug:2576057
Change-Id: Ie11ffb057de9c801a5088612cd464ea062f3a666
2010-04-09 12:42:45 -07:00
Robert Greenwalt
5f996899b0 Roaming data doesn't count against limits
bug:2576057
Change-Id: I51a66e3b49a62e0186816ec0473814a216184e6b
2010-04-08 19:12:38 -07:00
Irfan Sheriff
c9b6851af6 Throttling framework addins
Add ThrottleManager in getSystemService
Add API for URL fetch

Bug: 2576057
Change-Id: Icd25c8b91ea4beea15c74e8ad7292ab48c962253
2010-04-08 16:53:32 -07:00
Jeff Brown
267f0a6b68 Merge "Workaround NPE caused by packages missing signatures." into froyo 2010-04-08 16:41:47 -07:00
Jeff Brown
779a4ca84d Merge "Improve robustness of package manager certificate collection." into froyo 2010-04-08 16:41:37 -07:00
Robert Greenwalt
c87dc6dc90 Updating some notificiation UI for Throttling
String update and make one an ongoing notification.

bug:2576057
Change-Id: I7980f110c7eed8e8bf305490eddaa58e2949e3be
2010-04-08 16:00:26 -07:00
Jeff Brown
e684d9582c Workaround NPE caused by packages missing signatures.
Bug: b/2547993
Change-Id: Idcd4fc3ee4c2560a00a952e1910a50b30b736114
2010-04-08 14:05:11 -07:00
Jeff Brown
e760072a98 Improve robustness of package manager certificate collection.
The package manager contains an optimization which reuses cached
signatures instead of reloading them on startup if the package
appears to be unchanged.  This commit adds an extra check to ensure
that the PackageSettings object actually has valid signatures since
it has happened that they have gone missing.  Unfortunately it does
not address the root cause of the problem but it should alleviate the
symptoms after a reboot.

Bug: b/2547993
Change-Id: I41900c6a752711eb3a901360e3bb29aec946d0be
2010-04-08 13:49:17 -07:00
Robert Greenwalt
9e696c29f0 Add service to monitor/control the flow of data.
bug:2576057
Change-Id: Ib343c7ee1d619c6978910d9ee597db195d5aa3b6
2010-04-08 12:34:45 -07:00
Dianne Hackborn
ecb0e63787 Fix issue #2541849: System crash when an app with active notifications...
...in status bar is installed on sdcard and device is powered down.

Don't do the GC until everyone has had a chance to take care of external
storage going away.

This is more correct, but doesn't completely fix the problem that
appears when shutting down.

Change-Id: I24b19337ba6262cfd8d010645dbf67e76ea03058
2010-04-07 22:19:55 -07:00
Suchi Amalapurapu
c2461be627 Merge "Fix 2579461 Move install location values to secure settings. Diable attribute for UI. Set default value to auto. Add command line interface to set install location via pm." into froyo 2010-04-07 21:24:36 -07:00
Suchi Amalapurapu
40e472521a Fix 2579461
Move install location values to secure settings.
Diable attribute for UI. Set default value to auto.
Add command line interface to set install location via pm.

Change-Id: I80e97b3d24845adad7102f40dcbe238f00efa406
2010-04-07 20:43:54 -07:00
Dianne Hackborn
390022b23b Merge "Fix issue #2528537: android.os.DeadObjectException" into froyo 2010-04-07 18:31:06 -07:00
John Wang
815b8e4ac4 Merge "Add emergencyOnly indicator in ServiceState." into froyo 2010-04-07 17:51:41 -07:00
Dianne Hackborn
472ad8716e Fix issue #2528537: android.os.DeadObjectException
Nice.

Change-Id: I6142b12b5770b508ff4a43361da6f5e52bed2de9
2010-04-07 17:31:48 -07:00
John Wang
56c2d2ff27 Add emergencyOnly indicator in ServiceState.
For bug 2536842 to show signal strength in Emergency mode.

The STATE_EMERGENCY_ONLY of ServiceState is not in-use.

So add a hide interface to indicate Emergency mode.

Change-Id: I19398ac5e73a722dcaaf744347f961d1fa7513ac
2010-04-07 16:06:13 -07:00