1276 Commits

Author SHA1 Message Date
Craig Mautner
828f094a5f Merge "Limit screenshots to specified activity and stack." 2013-05-15 19:41:06 +00:00
Craig Mautner
76ea224678 Limit screenshots to specified activity and stack.
The screenshots were capturing the entire screen. Now they are limited
to the stack containing the activity.

Add debug for stack states.

Change-Id: I6d47cd37091bfdfd94e7abe89826b7ba8cb69b51
2013-05-15 12:40:10 -07:00
Dianne Hackborn
9a04909325 Merge "Improve watchdog error reporting." 2013-05-14 17:39:16 +00:00
Craig Mautner
86d67a4faa Move Recents into home stack.
Allows Recents activity to occupy a special place in the window/stack
hierarchy.

Change-Id: Ic11c94a075f70c7ba68bd554cd3e5fc6b7c407e7
2013-05-14 10:34:38 -07:00
Dianne Hackborn
fa012b35b8 Improve watchdog error reporting.
We now keep track of all the threads that are stopped, and
print stacks for all of them.  Also more threads are now adding
themselves to the watchdog.

Unfortunately the stack we get from threads is far less useful
than the stacks from the ANR report, because these don't include
any information about the lock the thread is blocked on and what
thread is holding that lock.  For example, here is a test of the
log output from causing a hang in the system process:

W/Watchdog( 5205): *** WATCHDOG KILLING SYSTEM PROCESS: com.android.server.am.ActivityManagerService, main thread
W/Watchdog( 5205): foreground thread stack trace:
W/Watchdog( 5205):     at com.android.server.am.ActivityManagerService.monitor(ActivityManagerService.java:14333)
W/Watchdog( 5205):     at com.android.server.Watchdog$HandlerChecker.run(Watchdog.java:142)
W/Watchdog( 5205):     at android.os.Handler.handleCallback(Handler.java:730)
W/Watchdog( 5205):     at android.os.Handler.dispatchMessage(Handler.java:92)
W/Watchdog( 5205):     at android.os.Looper.loop(Looper.java:137)
W/Watchdog( 5205):     at android.os.HandlerThread.run(HandlerThread.java:61)
W/Watchdog( 5205): main thread stack trace:
W/Watchdog( 5205):     at com.android.server.am.ActivityManagerService.broadcastIntent(ActivityManagerService.java:12252)
W/Watchdog( 5205):     at android.app.ContextImpl.sendBroadcastAsUser(ContextImpl.java:1158)
W/Watchdog( 5205):     at com.android.server.DropBoxManagerService$3.handleMessage(DropBoxManagerService.java:161)
W/Watchdog( 5205):     at android.os.Handler.dispatchMessage(Handler.java:99)
W/Watchdog( 5205):     at android.os.Looper.loop(Looper.java:137)
W/Watchdog( 5205):     at com.android.server.ServerThread.initAndLoop(SystemServer.java:1050)
W/Watchdog( 5205):     at com.android.server.SystemServer.init2(SystemServer.java:1125)
W/Watchdog( 5205):     at com.android.server.SystemServer.init1(Native Method)
W/Watchdog( 5205):     at com.android.server.SystemServer.main(SystemServer.java:1116)
W/Watchdog( 5205):     at java.lang.reflect.Method.invokeNative(Native Method)
W/Watchdog( 5205):     at java.lang.reflect.Method.invoke(Method.java:525)
W/Watchdog( 5205):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:774)
W/Watchdog( 5205):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
W/Watchdog( 5205):     at dalvik.system.NativeStart.main(Native Method)
I/Process ( 5205): Sending signal. PID: 5205 SIG: 9

Change-Id: I8ff9892d8d072d8dc599a73de4bdb75e3b1a6e97
2013-05-13 18:01:54 -07:00
Craig Mautner
1602ec2188 Log stack issues and start resize effort.
- Modify Am.java to accept 'stack resize' command.

- Add logging for assigning home stack to non-home task to track down
bug. And maybe fix bug.

- Add template parameter to ArrayList.

Change-Id: Ia73182afc20e9e4430ddadebae034cecb3798eec
2013-05-13 14:39:39 -07:00
Guang Zhu
befa8b5553 Revert "Log stack issues and start resize effort."
Bug: 8935057

This reverts commit b0245edae86b5811ea743c0f4cea095488304b1a.
2013-05-12 23:10:39 -07:00
Craig Mautner
b0245edae8 Log stack issues and start resize effort.
- Modify Am.java to accept 'stack resize' command.

- Add logging for assigning home stack to non-home task to track down
bug. And maybe fix bug.

- Add template parameter to ArrayList.

Change-Id: If904c3ead623464ff5863b7241c68c1b7573bcf4
2013-05-12 10:27:38 -07:00
Guang Zhu
6eee6ebc68 Revert "The default home intent needs CATEGORY_DEFAULT"
This reverts commit 1fea6b374f612ca8cedc17de873526f0f7c42a4e.

Bug: 8878319
2013-05-08 22:19:52 -07:00
Christopher Tate
9809e0d2d7 am 6312a196: am cfb09fac: Merge "The default home intent needs CATEGORY_DEFAULT" into jb-mr2-dev
* commit '6312a1968c5e16e193b5b6d3c2f4b92b2de9311d':
  The default home intent needs CATEGORY_DEFAULT
2013-05-08 16:15:30 -07:00
Christopher Tate
cfb09fac73 Merge "The default home intent needs CATEGORY_DEFAULT" into jb-mr2-dev 2013-05-08 23:09:49 +00:00
Christopher Tate
1fea6b374f The default home intent needs CATEGORY_DEFAULT
Because the resolve activity always assumes CATEGORY_DEFAULT, there are odd
cases where apps with malformed intent filters wind up interfering with
users' ability to specify a preferred launcher app.

Bug 8805220

Change-Id: I4c1295dc844e442eec6efd603ce11b673879dd5a
2013-05-07 18:47:38 -07:00
Craig Mautner
525f3d9df6 Do not launch home task if activities remain
When a root activity is finishing and it is supposed to return to
home make sure there are only lower activities waiting to start before
going home.

Fixes bug 8632206.

Various other refactorings for efficiency.

Change-Id: I8bbb9de78d0ea9f45a504cf4bad72c698e9cc3d8
2013-05-07 15:01:46 -07:00
Kenny Root
1d69bad411 resolved conflicts for merge of a98b0ff8 to master
Change-Id: I1f4a952d360c48426e22a7772726b6867cc19771
2013-05-07 10:14:46 -07:00
Kenny Root
add582122d resolved conflicts for merge of 485d7a31 to master
Change-Id: I058e19af8732df44457bdc614ee810a642dc25e4
2013-05-07 09:51:31 -07:00
Craig Mautner
c87a732e75 Merge "Call ensureActivitiesVisibleLocked from supervisor." 2013-05-06 23:13:12 +00:00
Dianne Hackborn
8bd64df2ad Help for the debugging help for issue #8734824.
Add a new "hang" am command that lets you hang the system
process.  Useful for testing.

Change-Id: Ice0fc52b49d80e5189f016108b03f9fd549b58a7
2013-05-06 16:07:26 -07:00
Craig Mautner
b59dcfd5e1 Call ensureActivitiesVisibleLocked from supervisor.
- Don't call ActivityStack.ensureActivitiesVisibleLocked directly.
Instead call ActivityStackSupervisor.ensureActivitiesVisibleLocked.

- Add detecting monochrome screenshots to black screenshots.

- minor refactors.

Change-Id: I050b1cd40cacaab451f1460a77a82125a8077ff2
2013-05-06 13:12:58 -07:00
Dianne Hackborn
c3d95fa664 am 2a44f8d1: am d3956321: Merge "Fix issue #8798662: NPE in..." into jb-mr2-dev
* commit '2a44f8d102a60b1ccca780341cff0b0efb8f19ed':
  Fix issue #8798662: NPE in...
2013-05-06 12:20:17 -07:00
Dianne Hackborn
5b88a2fd7b Debugging help for issue #8734824: WATCHDOG KILLING SYSTEM PROCESS
IActivityController has a new callback which the Watchdog calls
when it detects that the system process is hung.  This may be
use full monkey.  All hail the monkey!

Also add a new private feature to Binder to be able to turn off
all incoming dump() calls to a process.  The watchdog uses this
when it reports it is hung, so that if someone, say, wants to
collect a bug report at this point they won't get stuck waiting
for things that are all busted.

Change-Id: Ib514d97451cf3b93f29e194c1954e29f948c13b1
2013-05-06 11:16:18 -07:00
Craig Mautner
dfe570527c Merge "Fix layering and launching issues." 2013-05-03 20:41:36 +00:00
Craig Mautner
1ac47791ea Merge "Propagate the return-to-home flag to next task." 2013-05-03 20:41:07 +00:00
Craig Mautner
05d290365f Fix layering and launching issues.
- Replace calls to ActivityStack.resumeTopActivity() with calls to
ActivityStackSupervisor.resumeTopActivities().

- Move dim layers from display scope to stack scope. This applies to
both the animation background dim layer and the FLAG_DIM_BEHIND dim
layer.

- Move windows on stacks that are not targeting wallpaper above the
wallpaper. Otherwise wallpaper placement hides the non-focused stacks.

Change-Id: Ic6b97ac6b094672bb1ddac17ce46ea58c738f073
2013-05-03 13:40:13 -07:00
Dianne Hackborn
ca92a4c38f Fix issue #8798662: NPE in...
...com.android.server.am.ServiceRecord.postNotification()

Change-Id: I3403bc50eb95d410183fc60ef252775a688b6290
2013-05-03 12:07:51 -07:00
Jeff Sharkey
9e0036ed7d External storage provider, document picker UI.
Continuing to flesh out storage backends by adding an external
storage document backend.  Still rough, but it can traverse files
and directories.

Early pass at OPEN/CREATE_DOC picker UI, which offers to traverse
any known storage backends.  Supports opening subdirectories and
returning a picked file.

Change-Id: Idc3554036b3816a93d9b465ee8a620746859d2ae
2013-05-01 17:44:42 -07:00
Craig Mautner
e418ecd129 Propagate the return-to-home flag to next task.
If a task is supposed to launch home when it finishes but then
launches another task and finishes itself, then the new task must
launch home when it finishes.

Fixes bug 8778263.

Change-Id: I6495f6c2e99a906217e73b7b6dcae8ecff435e5f
2013-05-01 17:02:29 -07:00
Craig Mautner
c63bda0bd1 Merge "Handle case where finishActivity removes activity" 2013-05-01 19:02:29 +00:00
Craig Mautner
d94b1b480e Handle case where finishActivity removes activity
Fixes bug 8773046.

Change-Id: I2e9f15c19ee9b50347472542ace5287964964203
2013-05-01 11:58:03 -07:00
Craig Mautner
c66a83751a Merge "Do not return to Home activity if not top task." 2013-05-01 18:32:33 +00:00
Craig Mautner
a1c12b2cae Merge "Move task methods into TaskRecord." 2013-05-01 18:32:06 +00:00
Craig Mautner
9e14d0fd9a Do not return to Home activity if not top task.
Add a test for being the top task when closing the last activity in a
task. Without this test, if the last activity in a task was flagged to
return to the home activity on completion but that activity had
launched a new task we would not go to the new task but would instead
launch the home activity.

Fixes bug 8775949.

Change-Id: I7fd9d9ebbdbff8064d894407c35190894a141ecf
2013-05-01 11:26:09 -07:00
Jeff Sharkey
ec43a6bc17 Better --unplugged support when dumping battery.
Also fixes logBatteryStatsLocked() to output valid dump data, instead
of just a usage message.

Bug: 8708665
Change-Id: Ie0d8d90e1a470b7e1e902643333309c2cf7bdb72
2013-04-30 13:33:18 -07:00
Craig Mautner
9db9a0bde5 Move task methods into TaskRecord.
Stop doing backflips to do task operations in ActivityStack.

Change-Id: I57b1be6affcb8b7d504ae33b3e44bde2e6253f1c
2013-04-29 17:05:56 -07:00
Jeff Sharkey
3e013e85b0 Track foreground activities in battery stats.
To help correlate battery usage against actual foreground app usage,
start tracking time on a per UID basis.  It uses the nesting feature
of StopwatchTimer to track multiple PIDs inside the same UID.

Improves units on docs, and persists foreground CPU time with a
consistent ordering.  Reports foreground activities time and
foreground CPU time.

Change-Id: I95d12963923e3fd421730f6fbfc842dfd8d3a055
2013-04-25 17:01:37 -07:00
Jeff Sharkey
58b98d392d Merge "Report dead activities as paused to stats." 2013-04-25 23:49:08 +00:00
Jeff Sharkey
5782da778c Report dead activities as paused to stats.
Also tell stats about pause before dispatching to remote side.

Change-Id: I975d0fba65515fa768127792d5aa7976df2ba2d3
2013-04-25 15:01:48 -07:00
Craig Mautner
458dd87552 Merge "Fix launching non-full screen apps from home." 2013-04-25 20:46:05 +00:00
Jeff Sharkey
7efcc0c16d Skip reporting resumes due to config change.
This gives us matching pause/resume calls to updateUsageStats(),
since configuration changes never report the pause event.

Change-Id: I5c8afc28766cd90d4bd793980265ce7988750cae
2013-04-25 13:11:47 -07:00
Craig Mautner
580ea81ccd Fix launching non-full screen apps from home.
- Continue to display the home screen for non-fullscreen activities
such as Download. Previously launching Download from home would
display Download on top of the previous activity on the user activity
stack.

- Fix NPE when DEBUG_PROVIDER is true.

Change-Id: I705ea43e4b78a5f5e83fc3f5fa83e4c95e592268
2013-04-25 12:58:38 -07:00
Craig Mautner
c64f73e778 Fix startActivityAndWait bugs
- Send timeout message with a delay. The delay got lost when moving
from ActivityStack to ActivityStackSupervisor. Fixes bug 8687083.

- Remove waiting activities from list after they have been awoken.
Previously the list just got bigger and bigger.

Change-Id: Icb9e394db1eefa444e58c5416472017cac32298c
2013-04-24 16:44:56 -07:00
Craig Mautner
eb95786fd3 Pause activities when leaving.
Missed a spot where an activity that is launching another was not
being paused. Fixes bug 8640130. At least in one case.

Release mWindowMap as soon as it is no longer needed.

Change-Id: Id2c63d3d715b98741e2ebe3c9985cb1e9ca5ffbc
2013-04-24 15:34:32 -07:00
Craig Mautner
a2e56c5a2f Merge "Fix user switching." 2013-04-24 14:53:51 +00:00
Craig Mautner
b58121c350 Merge "Add tap detector for switching stack focus." 2013-04-24 02:36:43 +00:00
Craig Mautner
858d8a6583 Fix user switching.
- Save and restore WindowManager stack states.
- Maintain ActivityManager activity states based on the stack
the activity is in.

Fixes bug 8646641.

Change-Id: I16c76c7708ab49121c3884a7e5bf219898b92d3f
2013-04-23 19:33:42 -07:00
Craig Mautner
cf910b0c71 Add tap detector for switching stack focus.
- New InputEventReceiver for detecting taps outside of focused stack
boundaries.
- Fixed bug that wasn't pausing the non-focused window when returning
home.

Change-Id: Ia51d312a7c029abc01eb5df1102814cc29d33b47
2013-04-23 19:33:27 -07:00
Christopher Tate
fb4f2890e8 am 4c6f2a54: am 7a4ddbaa: Merge "Don\'t attempt native crash reporting for persistent apps" into jb-mr2-dev
* commit '4c6f2a54109c3f75deca1f2b43736dcd9c965768':
  Don't attempt native crash reporting for persistent apps
2013-04-23 04:46:20 -07:00
Craig Mautner
f333327782 Move idle handling from ActivityStack to Supervisor
Along with mFinishingActivities, mStartingUsers and
mCancelledThumbnails.

Change-Id: Ia354225d72e694b7ac68b0869fcab903a3d06436
2013-04-22 10:55:53 -07:00
Craig Mautner
ce5f3cba6b Refactoring Activity Manager.
Mid-course corrections.

- Simplify ActivityStackSupervisor and ActivityStack constructors to
get passed parameters from ActivityManagerService.
- Store WindowManagerService referecne locally in
ActivityStackSupervisor and ActivityStack.
- Rename getTopStack to getFocusedStack in ActivityStackSupervisor
and ActivityManagerService.
- Move mWaitingActivityLaunched/reportActivityLaunchedLocked and
mWaitingActivityVisible/reportActivityVisibleLocked from ActivityStack
to ActivityStackSupervisor.
- Moved reportResumedActivity to ActivityStackSupervisor.
- Added a Handler to ActivityStackSupervisor. Will populate it on next
CL.

Change-Id: I1bbe5eb737c5cac6b896bc9748f329891e94d00f
2013-04-22 09:12:38 -07:00
Craig Mautner
165640bbc6 Use correct stacks for testing changes.
Fixes bug 8656057.

Change-Id: I88e48d28d240fced866a82bd3d49f8807300c0ad
2013-04-20 10:37:58 -07:00
Christopher Tate
b86d81d3ff Don't attempt native crash reporting for persistent apps
Bug 8639127

Change-Id: I55035cfed9ba04597422f675ede105dae40b2fbf
2013-04-19 17:39:20 -07:00