271 Commits

Author SHA1 Message Date
Dianne Hackborn
f210d6b75e Let's do bug #1769910 actually right.
My original implementation was computing averages and medians.  Now we do binning, as requested.  So much simpler, too!  In addition, it fixes a bug where when hoping across activities we were only accounting for the last activity as the total time; now we count the time from the start of the initial activity.

This also includes some reduction and optimization of the activity manager dumpsys output.
2009-04-13 18:42:49 -07:00
Android (Google) Code Review
0887540fa8 Merge change 63 into donut
* changes:
  Remove references to android.util.Config
2009-04-13 14:12:27 -07:00
Christopher Tate
06ba55476e Integrate new power connnect/disconnect broadcasts
Two new broadcasts, Intent.ACTION_POWER_CONNECTED and
Intent.ACTION_POWER_CONNECTED, that are issued when the device is plugged
and unplugged from USB or AC power.  This pulls two changes from the
open-source Gerrit repo into the internal Donut codeline:

1241 fda6fae Added broadcasts for external power events.
9491 37f8ca1 Fix system service crash when booting while on battery power

The current.xml API description has also been updated to include the
new Intent fields; the new API was approved in the original OSS change.
2009-04-09 16:03:56 -07:00
Dave Bort
cfe6524071 Remove references to android.util.Config
The semantics of Config.DEBUG will be changing soon, and all other
Config.* fields will become deprecated/hidden.
2009-04-09 14:51:04 -07:00
Nick Pelly
7680d67dc7 Merge branch 'readonly-p4-donut' into donut 2009-04-08 15:10:29 -07:00
Nick Pelly
9ac932179c AI 145201: Hold wakelock while delaying for audio route switch after headset unplug.
Fixes bug where we go to sleep before switching audio, and we lose audio until the apps CPU wakes up again.
  BUG=1774615

Automated import of CL 145201
2009-04-08 15:09:15 -07:00
Dianne Hackborn
6447ca30b8 Fix issue #1769910 (Track activity launch times)
The usage stats service now collects per-activity launch time stats.  There are a number of fixes and improvements to its statistics management and collection; it now operates its calendar in GMT and ensures that for checkin purposes it always reports one day and only one complete day to the checkin service.

Also change the checkin option from "-c" to "--checkin" since it is really a special thing.
2009-04-07 19:50:08 -07:00
Mike Lockwood
e932f7f2a4 AI 144663: Use Binder interfaces between NetworkLocationManager and LocationManagerService.
This fixes a hack that was added when NetworkLocationManager was moved out of the framework.
  This also lays the groundwork for supporting location providers outside of the system process.
  BUG=1729031

Automated import of CL 144663
2009-04-06 10:51:26 -07:00
Mike Lockwood
f113fbe67b AI 144620: Clean up interface between NetworkLocationProvider and LocationManagerService (part 1)
Move broadcast receivers for wifi scan results and battery status
  from LocationManagerService to NetworkLocationProvider
  Add a Service for the NetworkLocationProvider, so we can install it from its
  own thread rather than from BOOT_COMPLETED or callback from LocationManagerService.
  (this Service was also required for receiving Intents in NetworkLocationProvider)
  BUG=1729031

Automated import of CL 144620
2009-04-06 05:17:28 -07:00
Mike Lockwood
66eb4acb89 AI 144599: Location Manager cleanup:
Move PhoneStateListener for listening to cell location changes from LocationManagerService
  to the NetworkLocationProvider.
  Move CellState class out of the core framework to the NetworkLocationProvider service.
  NetworkLocationManager now notifies the collector of its state, rather than LocationManagerService.
  BUG=1729031

Automated import of CL 144599
2009-04-05 14:50:22 -07:00
Mike Lockwood
4e50b78bda AI 144452: More Location Manager cleanup:
Remove 1 Hz "heartbeat" polling of location providers from LocationManagerService.
  Now location providers report their location to LocationManagerService via
  LocationManager.setLocation() rather than waiting to be polled.
  This reduces GPS fix latency by up to one second.
  Remove LocationProvderImpl.getLocation().
  Since we are no longer polling, this method is no longer necessary.
  BUG=1729031

Automated import of CL 144452
2009-04-03 08:24:43 -07:00
Mike Lockwood
9637d47489 AI 144372: Cleanup Settings support for enabling and disabling location providers:
LocationManagerService now listens for changes to settings,
  making LocationManager.updateProviders() unnecessary.
  Removed LocationManager.updateProviders()
  Added Settings.Secure.setLocationProviderEnabled(), which is a thread-safe way
  of enabling or disabling a single location provider.
  This is safer than reading, modifying and writing the LOCATION_PROVIDERS_ALLOWED directly.
  BUG=1729031

Automated import of CL 144372
2009-04-02 21:41:57 -07:00
Evan Millar
633a1740ce AI 144333: Change the way the battery level tracking code works in BatteryStats. Before we simply kept track of the last
2 levels as recorded at plug and unplug events. During charge cycles this would be useful because it would tell us
  what the start and end levels were in the last discharge cycle. However during a discharge cycle this information could
  be misleading as it would give you the level at the last unplug event (beginning the the discharge cycle) and last plug
  event (end of the previous discharge cycle).
  Now we are still keeping track of 2 values, but they are "discharge cycle start level" and "discharge cycle current level".
  During a discharge cycle this will give you the level the current discharge cycle started at, and the current level. During
  a charge cycle the same data will be supplied as before (the start/end of the last discharge cycle).
  B=144249

Automated import of CL 144333
2009-04-02 16:36:33 -07:00
Amith Yamasani
e1ccba2113 AI 144257: am: CL 144256 Need to show opt-in screen for location collection.
Added a screen to the setup wizard, after login, to ask user to
  opt-in for location collection.
  Added a dialog to Settings when user turns on Network location.
  Fixed a security permission issue in LocationManagerService related
  to this change.
  Original author: yamasani
  Merged from: //branches/cupcake/...

Automated import of CL 144257
2009-04-02 11:40:25 -07:00
Amith Yamasani
29c1c42e18 AI 144256: Need to show opt-in screen for location collection.
Added a screen to the setup wizard, after login, to ask user to
  opt-in for location collection.
  Added a dialog to Settings when user turns on Network location.
  Fixed a security permission issue in LocationManagerService related
  to this change.
  BUG=1752566

Automated import of CL 144256
2009-04-02 11:39:09 -07:00
Wink Saville
767a662ecd AI 144185: Integrate cdma into the main code base.
Automated import of CL 144185
2009-04-02 01:37:02 -07:00
Dianne Hackborn
958b9adc08 AI 143899: am: CL 143896 Fix issue #1748954 and #1737952:
#1748954 (New status bar fades into all white background): FrameLayout wasn't updating its foreground drawable when its padding changed, which would happen as the status bar is shown and hidden.  To fix this I also ended up fixing a problem in the view debug stuff where we couldn't get a bitmap for a view that is the full screen size because it is too big...  actually I just went ahead and added another function to snapshot the view hierarchy which works a lot better for us anyway.
  #1737952 (Home screen icons overlap with the notification bar after exiting any camera app): Originally I punted this because it only happened in rare situations, but now that home is always portrait it happens a lot more so it is more important to fix.  This involved a few things to clean up hiding/showing the status bar:
  - We now determine when to hide and show it during layout, which allows us to do this at the time it is actually needed rather than during animation after we can actually catch it for the initial display of a window.  This required tweaking the layout API so the policy can request a second layout pass if needed.
  - When doing layout, we are now much more aggressive about skipping the layout of windows.  Basically anything that we know will be hidden in the near future is ignored for layout, so that it doesn't glitch as it is transfered out of the screen.  The theory being that it is better to leave it as it was originally placed while we are transitioning it out, than to switch it to something slightly more correct.
  Original author: hackbod
  Merged from: //branches/cupcake/...

Automated import of CL 143899
2009-03-31 18:00:36 -07:00
Dianne Hackborn
b378530714 AI 143896: Fix issue #1748954 and #1737952:
#1748954 (New status bar fades into all white background): FrameLayout wasn't updating its foreground drawable when its padding changed, which would happen as the status bar is shown and hidden.  To fix this I also ended up fixing a problem in the view debug stuff where we couldn't get a bitmap for a view that is the full screen size because it is too big...  actually I just went ahead and added another function to snapshot the view hierarchy which works a lot better for us anyway.
  #1737952 (Home screen icons overlap with the notification bar after exiting any camera app): Originally I punted this because it only happened in rare situations, but now that home is always portrait it happens a lot more so it is more important to fix.  This involved a few things to clean up hiding/showing the status bar:
  - We now determine when to hide and show it during layout, which allows us to do this at the time it is actually needed rather than during animation after we can actually catch it for the initial display of a window.  This required tweaking the layout API so the policy can request a second layout pass if needed.
  - When doing layout, we are now much more aggressive about skipping the layout of windows.  Basically anything that we know will be hidden in the near future is ignored for layout, so that it doesn't glitch as it is transfered out of the screen.  The theory being that it is better to leave it as it was originally placed while we are transitioning it out, than to switch it to something slightly more correct.
  BUG=1748954,1737952

Automated import of CL 143896
2009-03-31 17:58:46 -07:00
Dianne Hackborn
617f877c06 AI 143800: am: CL 143748 Fix issue #1743326 (More battery stats)
Adds stats for:
  - Number of raw user events that have happened in the system.
  - Number of times user activity has been reported, dividied by UID and type of activity.
  - Duration of screen brightness levels in 4 buckets.
  - Per-UID tracking of who has turned on Wifi and how long we can attribute it being on because of them.
  Original author: hackbod
  Merged from: //branches/cupcake/...

Automated import of CL 143800
2009-03-31 15:04:46 -07:00
Dianne Hackborn
65c8e11a31 AI 143748: Fix issue #1743326 (More battery stats)
Adds stats for:
  - Number of raw user events that have happened in the system.
  - Number of times user activity has been reported, dividied by UID and type of activity.
  - Duration of screen brightness levels in 4 buckets.
  - Per-UID tracking of who has turned on Wifi and how long we can attribute it being on because of them.
  BUG=1743326

Automated import of CL 143748
2009-03-31 12:11:48 -07:00
Eric Shienbrood
5711fadfc4 AI 143266: am: CL 143124 Fix bug #1731826, in which auto-connect to remembered networks does not
take place.
  This has the same underlying cause as bug #1739874, so this fixes that
  bug as well. The problem was that if the supplicant was in the DORMANT
  state at the time a scan-only Wi-Fi lock was released, the command to
  stop the Wi-Fi driver would never be issued. This had two main results:
  first, the driver would stay awake when the screen was blank and it was
  supposed to be sleeping, leading to excessive battery drain, and second,
  when the screen was turned back on, there would be no DRIVER-STARTED
  event generated (because the driver was already running). The
  DRIVER-STARTED event is the trigger for the framework to issue a
  RECONNECT command to the supplicant to cause it leave the DORMANT state
  and look for available remembered networks.
  To assist in tracking down this problem, and any such problems in the
  future, I added four counters to keep track of how many times full and
  scan-only Wi-Fi locks are acquired and released. The counter values
  are output in the dump() method of WifiService. While doing this, I
  noticed that because of missing "break" statements, the battery stats
  that keep track of how much time Wi-Fi locks are held were including
  the time for full locks in the time reported for scan-only locks.
  Original author: ers
  Merged from: //branches/cupcake/...

Automated import of CL 143266
2009-03-27 20:25:31 -07:00
Dianne Hackborn
321ae681ca AI 143173: am: CL 142879 Fix issue #1732012 (Only show screen rotation animation when triggered by sensor) -- set the new surface flag as appropriate.
Original author: hackbod
  Merged from: //branches/cupcake/...

Automated import of CL 143173
2009-03-27 16:16:03 -07:00
Dianne Hackborn
1e880dba10 AI 143169: am: CL 142870 Fix issue #1724917 (Applications (browser, maps, gmail) fail to retain their landscape state after coming out of sleep mode). We now rely on the listeners last known orientation, and make sure to clear it when enabling/disabling.
Also do most of the work for issue #1732012 (Only show screen rotation animation when triggered by sensor).  This just needs to be hooked up to the surface flinger API when that appears.
  Original author: hackbod
  Merged from: //branches/cupcake/...

Automated import of CL 143169
2009-03-27 16:04:08 -07:00
Eric Shienbrood
50108e9282 AI 143124: Fix bug #1731826, in which auto-connect to remembered networks does not
take place.
  This has the same underlying cause as bug #1739874, so this fixes that
  bug as well. The problem was that if the supplicant was in the DORMANT
  state at the time a scan-only Wi-Fi lock was released, the command to
  stop the Wi-Fi driver would never be issued. This had two main results:
  first, the driver would stay awake when the screen was blank and it was
  supposed to be sleeping, leading to excessive battery drain, and second,
  when the screen was turned back on, there would be no DRIVER-STARTED
  event generated (because the driver was already running). The
  DRIVER-STARTED event is the trigger for the framework to issue a
  RECONNECT command to the supplicant to cause it leave the DORMANT state
  and look for available remembered networks.
  To assist in tracking down this problem, and any such problems in the
  future, I added four counters to keep track of how many times full and
  scan-only Wi-Fi locks are acquired and released. The counter values
  are output in the dump() method of WifiService. While doing this, I
  noticed that because of missing "break" statements, the battery stats
  that keep track of how much time Wi-Fi locks are held were including
  the time for full locks in the time reported for scan-only locks.
  BUG=1731826,1739874

Automated import of CL 143124
2009-03-27 12:21:17 -07:00
Mike Lockwood
7ec434e2e1 AI 143095: Location Manager cleanup: move MockProvider to a separate file.
BUG=1729031

Automated import of CL 143095
2009-03-27 07:46:48 -07:00
Dianne Hackborn
cc95667b9c Automated import from //branches/cupcake/...@142879,142879 2009-03-26 00:04:52 -07:00
Dianne Hackborn
02771bcb5d Automated import from //branches/cupcake/...@142870,142870 2009-03-25 22:39:21 -07:00
Chris Tate
2ad63a9d77 Automated import from //branches/donutburger/...@142784,142784 2009-03-25 17:36:48 -07:00
Dianne Hackborn
9ed4a4b0d7 Automated import from //branches/donutburger/...@142722,142722 2009-03-25 17:10:37 -07:00
Chris Tate
0f8fc102b9 Automated import from //branches/cupcake/...@142783,142783 2009-03-25 16:22:54 -07:00
Dianne Hackborn
2f847b9e05 Automated import from //branches/cupcake/...@142651,142651 2009-03-25 15:25:33 -07:00
Dianne Hackborn
c485a60a32 Automated import from //branches/donutburger/...@142397,142397 2009-03-24 22:39:49 -07:00
Dianne Hackborn
627bba736d Automated import from //branches/donutburger/...@142347,142347 2009-03-24 22:32:56 -07:00
Ed Heyl
7379823e59 Automated import from //branches/donutburger/...@142239,142239 2009-03-24 21:32:21 -07:00
Suchi Amalapurapu
c4dd60fd4a Automated import from //branches/donutburger/...@141958,141958 2009-03-24 21:10:53 -07:00
Romain Guy
96f4357e06 Automated import from //branches/donutburger/...@141523,141523 2009-03-24 20:27:49 -07:00
Joe Onorato
64c62ba503 Automated import from //branches/donutburger/...@141409,141409 2009-03-24 20:13:57 -07:00
Chris Tate
8a7dc17790 Automated import from //branches/donutburger/...@141391,141391 2009-03-24 20:11:42 -07:00
Dianne Hackborn
9d4de63623 Automated import from //branches/cupcake/...@142392,142392 2009-03-24 19:37:25 -07:00
Joe Onorato
c1e8446279 Automated import from //branches/donutburger/...@141086,141086 2009-03-24 19:29:20 -07:00
Dianne Hackborn
99c6026218 Automated import from //branches/cupcake/...@142342,142342 2009-03-24 19:27:53 -07:00
Dianne Hackborn
ef49c57bdc Automated import from //branches/donutburger/...@141079,141079 2009-03-24 19:27:32 -07:00
Joe Onorato
e68ffcb576 Automated import from //branches/donutburger/...@140997,140997 2009-03-24 19:11:13 -07:00
Jim Miller
2ce107ce31 Automated import from //branches/cupcake/...@142154,142154 2009-03-24 19:06:28 -07:00
Suchi Amalapurapu
7f0ed3c071 Automated import from //branches/cupcake/...@141957,141957 2009-03-24 18:43:00 -07:00
Joe Onorato
128e729c49 Automated import from //branches/donutburger/...@140846,140846 2009-03-24 18:41:31 -07:00
Dianne Hackborn
f63220f58e Automated import from //branches/donutburger/...@140828,140828 2009-03-24 18:38:43 -07:00
Eric Fischer
d2bf42a96e Automated import from //branches/donutburger/...@140781,140781 2009-03-24 18:31:12 -07:00
Eric Shienbrood
d4c5f8919b Automated import from //branches/donutburger/...@140679,140679 2009-03-24 18:13:20 -07:00
The Android Open Source Project
c2ad241504 auto import from //branches/cupcake_rel/...@141571 2009-03-19 23:08:54 -07:00