223 Commits

Author SHA1 Message Date
Dianne Hackborn
d68478467e First pass at new device policy and administration APIs.
This adds new DevicAdmin, DevicePolicyManager, and DeviceAdminInfo classes.
See the java docs for each on documentation on them.  Basically: a DeviceAdmin
is what you derive from to administer a device; DevicePolicyManager is what you
use to apply and check your policy requirements and perform other administration
tasks.
2010-01-17 15:10:24 -08:00
Dan Egnor
42471dd555 Simplify & update ANR logging; report ANR data into the dropbox.
Eliminate the per-process 200ms timeout during ANR thread-dumping.
Dump all the threads at once, then wait for the file to stabilize.
Seems to work great and is much, much, much faster.

Don't dump stack traces to traces.txt on app crashes (it isn't very
useful and mostly just clutters up the file).

Tweak the formatting of the dropbox dumpsys a bit, for readability,
and avoid running out of memory when dumping large log files.

Report build & kernel version with kernel log dropbox entries.
2010-01-11 14:51:22 -08:00
Doug Zongker
43866e0c48 move some system services from gservices to secure settings
Change-Id: Ie2dfb99a2b42b2cc9310b858c044d8684e3493fa
2010-01-07 14:20:39 -08:00
Dianne Hackborn
03abb8179f Kill the task killers.
The ActivityManager.restartPackage() API is now deprecated, and no longer
allows applications to mess up the state of other applications.  This was
being abused by task killers, causing users to think their other applications
had bugs.

A new API is introduced for task killers,
ActivityManager.killBackgroundProcesses(), which allows these applications
to kill processes but only the same amount that the out of memory
killer does, thus causing no permanent damage.  The old restartPackage()
API is now a wrapper for calling this new API.

There is also a new private forceStopPackage() API that is used for the
system's force stop UI which does what the old restartPackage() API did.
2010-01-05 15:47:05 -08:00
Dianne Hackborn
c59411b176 Rework activity manager debug dumps.
Change how we do debug dumps from the activity manager to make
everything go through the activity manager interface (no more
secondary interfaces), and use the command line arguments to
control what gets dumped.

The output from dumpsys without args still dumps everything.

When just dumping the activity service, we now dump a subset
of all of the am state that is interesting without being
overwhelming.

You can use "dumpsys activity -h" to get help with other things
that can be dumped.
2009-12-21 20:20:59 -08:00
Dan Egnor
60d8762413 DropBox logging of app & system server crashes.
The crashes are also reported to the event log (and of course the
main logcat, like they always have been).  Ordinary Log.e(t,m,e) isn't dropboxed
but there's a new Log.wtf() which always is.  (Still @pending in this change.)

Add a hook to IPowerManager to crash the system server on demand
(only for apps with REBOOT permission, since it's basically a restart).
This is not exposed in PowerManager, must be invoked directly -- mostly
this is there so "Bad Behavior" in dev tools can do it.
2009-12-21 16:03:19 -08:00
Dianne Hackborn
dd71fc8bae Rework the LRU list for hidden and empty processes.
This is intended to solve a problem on devices with more memory
where we can fill up that memory with processes that contain activities
(hidden processes), leaving no room for empty processes.  Thus if a
process is receiving broadcasts regularly, or starting and stopping
a service, or such, we will continually create its process only to
have it immediately killed when done.

There is certainly some tuning that should be done on this as we
look at the actually behavior.  The implementation here puts all of
the hidden and empty processes into one list, trying to make some
preferences for the very most recently used activity's processes to
stay at the top and not get pushed out by other processes being
started in the background.
2009-12-17 16:03:49 -08:00
Dianne Hackborn
83652ebfe1 am 3a3fd2ba: Merge change Iaf1f0918 into eclair-mr2
Merge commit '3a3fd2ba1ffc6171725375396cc59711a34bb39e' into eclair-mr2-plus-aosp

* commit '3a3fd2ba1ffc6171725375396cc59711a34bb39e':
  Implement API to have new broadcasts replace existing broadcasts.
2009-12-14 16:10:13 -08:00
Dianne Hackborn
1c633fc89b Implement API to have new broadcasts replace existing broadcasts.
Use this in various places where it should serve no purpose to deliver
both broadcasts.  This is intended to reduce somewhat the flurry of
broadcasts that we churn through during boot.
2009-12-14 15:03:35 -08:00
Dianne Hackborn
c1e6b91d75 am c9ca93fb: am 474731d5: Merge change I2ffe306f into eclair
Merge commit 'c9ca93fbf9ff49ca4b74c4ec72d3f7580b3b7659' into eclair-mr2-plus-aosp

* commit 'c9ca93fbf9ff49ca4b74c4ec72d3f7580b3b7659':
  Fix issue #2304284: contacts/dialer/recentcalls constantly flashing
2009-12-13 12:34:09 -08:00
Dianne Hackborn
c9ca93fbf9 am 474731d5: Merge change I2ffe306f into eclair
Merge commit '474731d5efb30c1e9184f998610054747eb8e764' into eclair-mr2

* commit '474731d5efb30c1e9184f998610054747eb8e764':
  Fix issue #2304284: contacts/dialer/recentcalls constantly flashing
2009-12-13 12:25:00 -08:00
Dianne Hackborn
871ecdce67 Fix issue #2304284: contacts/dialer/recentcalls constantly flashing
Make sure the application is always given the most recent configuration
when launcher.  Use the current configuration, instead of whatever happens
to be set by the app, for reporting what it was launched with.

Change-Id: I2ffe306f56cc9092b640546dd0a28d2c29b9c0b3
2009-12-11 15:24:33 -08:00
Dan Egnor
f6bb01b0d8 am b7f0367c: Eliminate CrashData and friends.
Merge commit 'b7f0367cec1c744aa66ef397b0244e25d507491c' into eclair-mr2-plus-aosp

* commit 'b7f0367cec1c744aa66ef397b0244e25d507491c':
  Eliminate CrashData and friends.
2009-12-11 14:32:40 -08:00
Dan Egnor
b7f0367cec Eliminate CrashData and friends.
(CrashData was a custom-marshalled crash-info class used for a server crash
reporting system I am deprecating).  Use ApplicationErrorReport.CrashInfo
instead to report crash details (mostly the stack trace) from RuntimeInfo to
ActivityManagerService, since we're likely to need the crash information in
that form anyway.

Remove the (long-disabled) flags and support for the "Debug" button
in the crash dialog.

Further gut the ICheckinService interface by removing the crash-reporting
APIs (and everything that calls them), plus the synchronous checkin()
method (which has been stubbed out for a while now).

A new dropbox-based crash reporting system is in the works, but not part
of this change.
2009-12-11 13:27:04 -08:00
Dianne Hackborn
eb68a22656 am af9788a9: Merge change Ia53c6725 into eclair-mr2
Merge commit 'af9788a9d6c238dd97f40dc020e036739daf0811' into eclair-mr2-plus-aosp

* commit 'af9788a9d6c238dd97f40dc020e036739daf0811':
  Add bindService API to not bring ot foreground.
2009-12-09 15:55:28 -08:00
Dianne Hackborn
09c916bccb Add bindService API to not bring ot foreground.
Add a new flag for bindService that tells the system to not bring the
target service's process in to the foreground scheduling class.  This is
used by the sync system to not cause the current sync adapter to come to
the foreground as it is running.

Also some small improvements to the debug output of the process list
of oom adj and scheduling info.
2009-12-08 16:33:59 -08:00
Doug Zongker
0f91f87002 am f6683bb5: Merge change I5f1d2d24 into eclair-mr2
Merge commit 'f6683bb5592825a62e30760abb0734deaaf7bd93' into eclair-mr2-plus-aosp

* commit 'f6683bb5592825a62e30760abb0734deaaf7bd93':
  move event log tags used by ActivityManager into this package
2009-12-04 16:50:50 -08:00
Android (Google) Code Review
f6683bb559 Merge change I5f1d2d24 into eclair-mr2
* changes:
  move event log tags used by ActivityManager into this package
2009-12-04 16:46:28 -08:00
Doug Zongker
2bec3d4498 move event log tags used by ActivityManager into this package
We can now locate event log tag definitions in individual packages
(and java constants for the tag numbers get auto-generated), so move
all the tags used by the system server into the package.
2009-12-04 16:36:17 -08:00
Suchi Amalapurapu
32c66ee497 am ccbf4c28: am ae952b3b: Merge change Ibe1c422a into eclair
Merge commit 'ccbf4c282f6d27602896b812485b41b74eaf8c6d' into eclair-mr2-plus-aosp

* commit 'ccbf4c282f6d27602896b812485b41b74eaf8c6d':
  If the usage stats file doesn't exist in the first place there is no need to
2009-12-04 15:04:35 -08:00
Suchi Amalapurapu
be1c422a73 If the usage stats file doesn't exist in the first place there is no need to
backup and short return.
2009-12-04 13:59:38 -08:00
Dianne Hackborn
3a624abe27 am 92b18800: am ab5efde8: Merge change Iff5b8ce3 into eclair
Merge commit '92b1880084ccfbe2ae03eec6a9656c5372c03f12' into eclair-mr2-plus-aosp

* commit '92b1880084ccfbe2ae03eec6a9656c5372c03f12':
  Work on issue 2259506: camera ANRed and then device runtime restarted
2009-11-16 20:04:09 -08:00
Dianne Hackborn
f670ef7235 Work on issue 2259506: camera ANRed and then device runtime restarted
If a process fails to come up, we could leave content providers and
services hanging around.

Change-Id: Iff5b8ce3b933580954724338a89e110e45f1b00c
2009-11-16 13:59:16 -08:00
Dianne Hackborn
b9456ac726 am 6e0ff0c3: am 826d17c0: A little more on #2256270: Package manager sends bad broadcasts when components change
Merge commit '6e0ff0c37cd293d49c3c874ee30a49b1d5902b5e' into eclair-mr2-plus-aosp

* commit '6e0ff0c37cd293d49c3c874ee30a49b1d5902b5e':
  A little more on #2256270: Package manager sends bad broadcasts when components change
2009-11-13 11:33:37 -08:00
Dianne Hackborn
826d17c069 A little more on #2256270: Package manager sends bad broadcasts when components change
Don't go through all this work if the enabled state hasn't changed.

Change-Id: If7393f53d6c0d0770960bb37bcaa5adebdbb3099
2009-11-13 10:59:42 -08:00
Dianne Hackborn
7bd2179f22 am 823edb76: am 532d5603: Merge change I80022375 into eclair
Merge commit '823edb76661d57c1af7dbf4eb56eb0e3cb78e229' into eclair-mr2-plus-aosp

* commit '823edb76661d57c1af7dbf4eb56eb0e3cb78e229':
  Fix issue #2256032: Change CONFIGURATION_CHANGED and add a locale changed broadcast
2009-11-11 19:18:48 -08:00
Dianne Hackborn
8c3fc0801b am 5bb200fd: am 2ade6421: Merge change I775e1ec0 into eclair
Merge commit '5bb200fde2306d9da1972a81c0238c26ca6f475b' into eclair-mr2-plus-aosp

* commit '5bb200fde2306d9da1972a81c0238c26ca6f475b':
  Debugging for issue #2250075: Desk dock clock app sometimes doesn't
2009-11-11 19:18:11 -08:00
Dianne Hackborn
362d5b9b64 Fix issue #2256032: Change CONFIGURATION_CHANGED and add a locale changed broadcast
You can no longer receive CONFIGURATION_CHANGED in a manifest, which is really really
bad (launching apps every time the screen is rotated!).  A new LOCALE_CHANGED broadcast
is sent that you can receive in a manifest.

Change-Id: I80022375f0716db2e672382a29db3cea1af74702
2009-11-11 18:26:06 -08:00
Dianne Hackborn
12527f9fb1 Debugging for issue #2250075: Desk dock clock app sometimes doesn't
This adds a history of the last 100 broadcasts that is printed in the
debug log, to be able to see what recently happened at the time the
bug report was taken.  Also does some optimization of the printing of
the broadcast records to make it feasible to print this number of
entries.  (We kind-of need to do this because there are some broadcasts
like SIG_STR and SYNC_STATE_CHANGED that are being broadcast a LOT.)

Change-Id: I775e1ec0f63369c8bca8c83cee27b95ddc5ec450
2009-11-11 17:51:41 -08:00
Suchi Amalapurapu
972bad3cb8 am 750e82e5: am bf50200b: Merge change Ic9568e39 into eclair
Merge commit '750e82e51921428dc4ad9a75f18b02b8048734d8' into eclair-mr2-plus-aosp

* commit '750e82e51921428dc4ad9a75f18b02b8048734d8':
  When tasks are moved to top or bottom, the app tokens are being rearranged.
2009-11-06 00:30:40 -08:00
Suchi Amalapurapu
c9568e3989 When tasks are moved to top or bottom, the app tokens are being rearranged.
The window token rearrangement is defered if an animation is
underway. Force a focus recomputation when the window tokens are finally
rearranged so that we have a valid focused window.
2009-11-05 19:13:18 -08:00
Amith Yamasani
9d216dfd51 am 7b2aa74f: am 4ab2c777: Merge change I14fb81af into eclair
Merge commit '7b2aa74f4644979acea456e1047c96e17e09bc6d' into eclair-mr2-plus-aosp

* commit '7b2aa74f4644979acea456e1047c96e17e09bc6d':
  Fix for 2221718: Hang in BatteryStatsService.noteBluetoothOn
2009-11-05 14:05:38 -08:00
Amith Yamasani
14fb81af28 Fix for 2221718: Hang in BatteryStatsService.noteBluetoothOn
This should remove the deadlock. I'm not absolutely positive that
it fixes it, as it's not easy to reproduce.
2009-11-05 11:41:58 -08:00
Eric Fischer
25510e0777 am 8071b146: am fb872d1a: Merge change Id4d04def into eclair
Merge commit '8071b14680f8081019ac1b995d7c7f09a8aeeba7' into eclair-mr2-plus-aosp

* commit '8071b14680f8081019ac1b995d7c7f09a8aeeba7':
  Fix a race that kept the locale picker from working under heavy CPU load.
2009-10-29 01:47:34 -07:00
Eric Fischer
d4d04def2c Fix a race that kept the locale picker from working under heavy CPU load.
The locale picker and the activity transition would both change the
configuration, and depending upon the timing, the activity transition
would undo what the locale picker had just done.  Usually it worked right,
but would often fail if the user changed locales just after a data wipe,
when the media scanner was working hard in the background to index
the contents of the SD card.

http://b/issue?id=2216298
2009-10-27 18:55:57 -07:00
Dianne Hackborn
1e067a7338 am 7fad4ee7: am 8d9ddbe2: Merge change I1f30f3f1 into eclair
Merge commit '7fad4ee736b8a64c1acac7a9b40384f68562b664' into eclair-mr2-plus-aosp

* commit '7fad4ee736b8a64c1acac7a9b40384f68562b664':
  Fix #2201615: getCallingPackage returns calling process instead of calling package
2009-10-22 06:45:38 -07: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
Amith Yamasani
c0df229d20 am b0f4d0cd: am f37447ba: Proper fix for zero signal strength and no_service. Fixes #2176141
Merge commit 'b0f4d0cd249773927c891ab52505505b6b19347b' into eclair-mr2-plus-aosp

* commit 'b0f4d0cd249773927c891ab52505505b6b19347b':
  Proper fix for zero signal strength and no_service. Fixes #2176141
2009-10-19 15:44:08 -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
Dianne Hackborn
93939786f9 am 2c6c5e6e: Fix issue #2176944: Need API so browser, others can determine memory size of device
Merge commit '2c6c5e6e49795e6e24cd089c9018377d837ba931' into eclair-plus-aosp

* commit '2c6c5e6e49795e6e24cd089c9018377d837ba931':
  Fix issue #2176944: Need API so browser, others can determine memory size of device
2009-10-08 19:09:38 -07:00
Dianne Hackborn
374efe6a96 am d10d02f5: Merge change I490e01ba into eclair
Merge commit 'd10d02f53ec00bfa9eb9f5accf6454e4a4bbb6a6' into eclair-plus-aosp

* commit 'd10d02f53ec00bfa9eb9f5accf6454e4a4bbb6a6':
  Fix issue #2174566: HOT STABILITY: NPE in activity manager
2009-10-08 18:43:54 -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
Dianne Hackborn
7a889217d7 am 0c3154d3: Fix issue #2163654: deadlock, runtime restart
Merge commit '0c3154d3fc54a1b3d8358a2932042cca729327b9' into eclair-plus-aosp

* commit '0c3154d3fc54a1b3d8358a2932042cca729327b9':
  Fix issue #2163654: deadlock, runtime restart
2009-10-07 12:08:20 -07:00
Dianne Hackborn
ae9fc51765 am 68d881cf: Fix issue #2166755: BroadcastReceiver trying to return result during a non-ordered broadcast
Merge commit '68d881cf2d2b252f6f795cd64d43e316a1d736e5' into eclair-plus-aosp

* commit '68d881cf2d2b252f6f795cd64d43e316a1d736e5':
  Fix issue #2166755: BroadcastReceiver trying to return result during a non-ordered broadcast
2009-10-07 11:49:01 -07:00
Dianne Hackborn
031e4ac7dd am 48e6725c: Merge change Iaca22686 into eclair
Merge commit '48e6725c828a8d420d43925b0c9a9a915a8c4e2f' into eclair-plus-aosp

* commit '48e6725c828a8d420d43925b0c9a9a915a8c4e2f':
  Work on issue #2163789: Way too much logging
2009-10-07 11:44:12 -07:00
Dianne Hackborn
0c3154d3fc Fix issue #2163654: deadlock, runtime restart
Don't hold a lock when the activity thread is telling the activity manager
to release a provider.

This requires that the activity manager now keep a reference count on the
providers, because without the lock it is possible for activity thread to
call in to request the provider again before it has finished telling
about the release.

Change-Id: I5f912903891f4edae85e28819d4e6f14b8f2e688
2009-10-07 11:10:33 -07:00
Dianne Hackborn
68d881cf2d Fix issue #2166755: BroadcastReceiver trying to return result during a non-ordered broadcast
Tell the broadcast receiver whether it is getting an initial sticky value,
so it will be quiet about attempts to do ordered broadcast stuff.

Note that the original bug being reported was not actually a crash, just
an error log.  So all we are doing here is making the log quieter.

Change-Id: Iaf1b718d82093ec1197142410a64feff47eb3859
2009-10-05 15:52:32 -07:00
Dianne Hackborn
bd0a81ff1c Work on issue #2163789: Way too much logging
Dr.No from mcleron.

Change-Id: Iaca2268684f83fe8757e64db0b0e047a19755311
2009-10-04 14:48:47 -07:00
Dianne Hackborn
41829e0138 am e88846ee: Semi-workaround for #2027266: app drawer showing up on the side of the screen
Merge commit 'e88846eeaf70f9f4299af9e3d54ba5dacede42b6' into eclair-plus-aosp

* commit 'e88846eeaf70f9f4299af9e3d54ba5dacede42b6':
  Semi-workaround for #2027266: app drawer showing up on the side of the screen
2009-09-30 23:42:37 -07:00