1251 Commits

Author SHA1 Message Date
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
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
Craig Mautner
7d9eaa435d Call updateUsageStats for all stacks.
Was only calling it for the frontmost stack. But if we are going to
or from the home activity then the pausing stack moves to the back.

Fixes bug 8666221.

Change-Id: I1d6d19b49da4aa23414303336fa266362ae5f4b1
2013-04-19 13:57:33 -07:00
Craig Mautner
f88c50f8da Handle app dying.
Fix bugs related to handleAppDied.
Fixes bug 8658744.

Change-Id: I0ba2466ffac5e465e803e97a781810c34a6de371
2013-04-18 19:25:12 -07:00
Craig Mautner
709393fc8c Merge "Fix launching logic." 2013-04-18 21:16:04 +00:00
Craig Mautner
69ada558f5 Fix launching logic.
Fixes bug 8643197.

Change-Id: Ie09a767082dc492b449111da91bc0e77b43fa2f6
2013-04-18 13:51:51 -07:00
Craig Mautner
ab0a890412 Merge "Add transparent frame around focused stack." 2013-04-18 19:57:43 +00:00
Craig Mautner
a9a3fb1da3 Add transparent frame around focused stack.
- Also fix bugs when removing stack.

Change-Id: I3e0e3029f512f086601add00ccf34b2fea84296d
2013-04-18 10:02:38 -07:00
Craig Mautner
61cc1b632a Merge "Steady improvement to multi stack." 2013-04-17 22:35:02 +00:00
Craig Mautner
29219d963d Steady improvement to multi stack.
- Fix back button behavior with two stacks. Stopping activities were
held in that state indefinitely. This change causes IDLE_NOW_MSG to
be sent immediately for the last activity in a stack.

- Touch in non-focused stack was being ignored because of focus tests
in AbsListView.

- Change the focused stack when the activity focus changes. Renamed
mMainStack to mFocusedStack to reflect this.

- Resume all top stack activities when resuming.

- Assign intent task to ActivityRecord if it doesn't have a task.
Fixes bug 8433463.

Change-Id: I8d3c806234511697bc209ab99890730ffa514d20
2013-04-17 13:54:48 -07:00
Christopher Tate
a952f9d590 am 0bd7a2f2: am effb153a: Merge "Lengthen the AM timeout reading crash reports slightly" into jb-mr2-dev
* commit '0bd7a2f27120e945376217e2300ac2cd8bb00059':
  Lengthen the AM timeout reading crash reports slightly
2013-04-17 11:13:29 -07:00
Christopher Tate
effb153aba Merge "Lengthen the AM timeout reading crash reports slightly" into jb-mr2-dev 2013-04-17 18:08:19 +00:00
Christopher Tate
1b64598602 Lengthen the AM timeout reading crash reports slightly
We're missing some (small fraction of) native crash reports from
debuggerd.  It looks like under high system load the debuggerd
reporting code just isn't quite timely enough for the very short
timeouts initially deployed, so lengthen those a bit.

Bug 8552010

Change-Id: Icbc5b6517de3bb98fff1af2ea42ffd208ef20412
2013-04-17 10:40:02 -07:00
Craig Mautner
bbcc289dad Merge "Incremental repairs to side by side stacks." 2013-04-17 01:58:51 +00:00
Craig Mautner
53078b25c9 Merge "Implement stack splitting and task movement." 2013-04-17 01:58:15 +00:00
Craig Mautner
4cd0c13f8f Incremental repairs to side by side stacks.
- Add taskId parameter to createStack() so stacks are pre-populated
with a task.
- Keep track of stack access order in DisplayContent so getTasks
returns in MRU order.
- Set touchableRegion in InputMonitor so modal touching does not
extend beyond stack boundary.
- Fix stack merging so that deleting a stack results in a new
stack the size of the two children.

Change-Id: I62a6ba0a34f34dd7ec866b440bf04595379e19e8
2013-04-16 18:55:07 -07:00
Ben Gruver
303d004ca0 am e920a298: am 53f22ad9: Merge "Monitor the firewall rules file for changes" into jb-mr2-dev
* commit 'e920a298f7ee7005b05a0d689e0aae5ca1b369e9':
  Monitor the firewall rules file for changes
2013-04-16 17:51:04 -07:00
Ben Gruver
53f22ad9c3 Merge "Monitor the firewall rules file for changes" into jb-mr2-dev 2013-04-17 00:44:56 +00:00
Craig Mautner
967212cb54 Implement stack splitting and task movement.
Split stacks and move tasks between them. Layout the windows
according to the new stack split.

After layout content rectangles are known split the available area
between all stack boxes. Then use those values for future layout.

Provide stack contents to ActivityManager.

Change-Id: I9746e6185445633810d506be514d0b7b540a7f99
2013-04-15 13:46:47 -07:00
Jeff Sharkey
328ebf2221 Support persistable Uri permission grants.
When granting a Uri permission with new PERSIST_GRANT_URI_PERMISSION
flag, persist that grant across device reboots until explicitly
revoked.  Adds new persistedModeFlags dimension to UriPermission,
and moves all flag mutation into UriPermission for clarity.  Adds
flag documentation.  Only inflate HashSet as needed.

Write persisted grants into XML file, saving based on source and
target package name and user handle.  Sanity check grants when
parsing.

Wipe all grants from/to a package when uninstalled, and wipe any
transient grants when a package or user is force stopped.

Persistable grants are always considered "needed."

Change-Id: I3f001571b498fd607456a1257a6383f904d19497
2013-04-15 12:34:40 -07:00
Svetoslav
14210466bf resolved conflicts for merge of dd03b6dc to master
Change-Id: Ie6628e26d8a033bdce54f9d20156b0358a0956c3
2013-04-12 18:03:50 -07:00
Svetoslav Ganov
26257a09a5 Merge "Allow for setting test type as a monkey." into jb-mr2-dev 2013-04-13 00:15:40 +00:00
Craig Mautner
de4ef020ec Implement separate stacks.
One for home activity(s), one for other activities. Coordination
between the stacks is handled by the ActivityStackSupervisor.

Change-Id: I11395edea501d2f84a18a6a8bced1ce3d0797dad
2013-04-12 15:45:47 -07:00
Craig Mautner
c1dedb6fc4 Merge "Prepare WindowManager for multiple stacks." 2013-04-12 22:41:36 +00:00
Adam Momtaz
8f6f1f43ee Allow for setting test type as a monkey.
1. This allows UiAutomation type tests to run as if an
   android monkey test is running. This allows applications
   that recognize that they are drive by a test framework and
   avoid performing certain actions such as calling 911.

2. Fixed a bug where the UiAutomation#disconnect() was not
   called when the instrumentation is shutdown.

bug: 8588857

Change-Id: I9e3624dfbe2b8f81f27805711de1098ea2edd03d
2013-04-12 12:54:34 -07:00
Dianne Hackborn
8773a5c52e am 26c702c3: am ba880da4: Merge "Fix issue #7643046: Activity.getCallingPackage() bogusly returns null..." into jb-mr2-dev
* commit '26c702c395fbbd833c2ae8d155ed4605b36c5472':
  Fix issue #7643046: Activity.getCallingPackage() bogusly returns null...
2013-04-11 18:36:34 -07:00
Dianne Hackborn
7b92467179 Fix issue #7643046: Activity.getCallingPackage() bogusly returns null...
...after having to recreate the task stack

Change-Id: Ia354240f3650ddb578f2116a2aa4584e9ffe8508
2013-04-11 18:12:56 -07:00