168 Commits

Author SHA1 Message Date
Wale Ogunwale
3797c22ea1 Added StackId object for checking what features a stack supports
Helps make the code easier to follow since we are no longer checking
multiple stack ids at various decision points.

Bug: 25282299
Change-Id: Ifa6864a1ef56ce2eca4c94f87a4e0b993de987cd
2015-11-02 11:32:42 -08:00
Wale Ogunwale
079a0044a3 API for moving top activity in a stack to pinned stack.
* AMS.moveTopStackActivityToPinnedStack can be used to move the top
activity in a stack to the pinned stack and also specify the bounds
the pinned stack should be sized to.
* 'am stack move-top-activity-to-pinned-stack' command for testing
AMS.moveTopStackActivityToPinnedStack API

Bug: 25006507
Change-Id: I8392b4c39d8542153e691be7a627b7f35fd44884
2015-10-26 12:07:00 -07:00
Pablo Ceballos
63afb86381 Merge "Remove GLTrace support" 2015-10-19 17:55:59 +00:00
Wale Ogunwale
ffc11bb712 Don't set incorrect stack bounds when rotating screen in docked mode
Both window manager and activity manager could decide what the bounds
of other stacks should be when the docked stack exist which can get
out of sync. Now window manager does the bounds calculation and
activity manager asks window manager what the bounds should be when
it needs to resize the stack.

Bug: 24738105
Change-Id: I97356f008b676d2f58a8b54fdb08735ab51394af
2015-10-12 18:56:28 -07:00
Pablo Ceballos
a4d4e82927 Remove GLTrace support
GLTrace is defunct, it does not support newer GL features, breaks
security requirements, and has no supported tooling now that Eclipse
is at end of life.

Bug 22329852

Change-Id: I64c58464f8c2c7ae6125f5d5c7884e3fd34d68ea
2015-10-06 15:18:40 -07:00
Fyodor Kupolov
0df68cd13b Do now allow current user to be removed
It was possible to remove a foreground user using pm remove-user command.
The system ends up in the inconsistent state, because switch does not happen
and the removed user stays in the foreground, but its state is removed.

Also added am get-current-user command.

Change-Id: Ida2dce8f99bac55e106cdd44c93e96cc9142d7fb
2015-10-02 12:19:39 -07:00
Wale Ogunwale
83301a933f Added am command to suppress config. changes during task resize.
This command is useful for testing during development, but at some
point we will decide if allowing configuration changes during resizing
is okay or merge in http://ag/759766 to suppress configuration changes
during resizing and deliver the new config. to the app.

This functionality will be reverted once we decide.

Bug: 24380097
Change-Id: I223c08bc939e564a78e70994b599770be9d4730d
2015-09-24 15:54:08 -07:00
Chong Zhang
87b21722c2 Change resizeTask's parameter resizedByUser to constants
to indicate who initiated the resize, or if the resize should be forced.

Change-Id: Ic7021f76bec677027cbf27deeb63f92ea911a75c
2015-09-22 00:46:02 +00:00
Filip Gruszczynski
a59ac9cd64 Preserve window during resize triggered relaunches.
This changes application code behavior when the activity relaunches due
to configuration change. It only applies to scenarios, where the
configuration change was triggered by a user generated resize of an
activity (i.e. user drags a corner of an activity and thus changes its
size).

Preserving a window means that we will keep the decor view and non
client decor view around, but remove all children views when the
activity gets destroyed. When the activity gets created again, it will
attach its new content to the preserved view hierarchy. Mind, we
actually recreate application side Window object, since some of its
features might changed, but we retain its elevation (to not trigger
relayout with new layout params).

Preserving the window also means that we don't call the window manager
service to remove and later add the window. Instead, we continue using a
single window state throughout the resize operation.

Change-Id: Ie3d2878ed09c99ff343044bfe7a29a0ba07a265e
2015-09-14 15:59:32 -07:00
Wale Ogunwale
fc4662c185 Added am command for test docked stack resizing.
Change-Id: I79f88d4dea4ed87336f9859b9d655cbf5466dbe0
2015-08-18 11:31:21 -07:00
Wale Ogunwale
fc0ac9bdcb Added am commands for testing task positioning/resizing
Change-Id: Id506ea740029fd6faee4fc311a97c034c883a3fc
2015-08-14 15:47:53 -07:00
Xiaohui Chen
2ccf49e7f4 Clean up USER_OWNER references in am/pm commands.
Bug: 19913735
Change-Id: I9cd27dc037048f4e5e312c769fc59669a4abf3e3
2015-08-04 15:28:29 -07:00
Wale Ogunwale
ddc1cb2c15 Added support for static vs. dynamic stacks
Now that stacks represent workspaces we can define static
stacks which help shape the characteristics of the tasks
they contain. For example, fullscreen tasks/activities will
normally be launched in the stack with id
FULLSCREEN_WORKSPACE_STACK_ID, while freeform tasks/activities
will normally be launched in the stack with id
FREEFORM_WORKSPACE_STACK_ID.

Also, added ability to position a task at any index in a stack.

Bug: 22068114
Change-Id: Ib6c62a84b5f204fbf072755264c5c5eda6184f97
2015-08-01 10:50:18 -07:00
John Reck
66a3675013 am 0e5a5161: am d79117c4: am 9ba771bb: am c2db381e: am 6b66a4a8: use findProcess instead of getProcess
* commit '0e5a5161e6999a58a86acd404ee1a229e180647d':
  use findProcess instead of getProcess
2015-07-24 05:16:55 +00:00
John Reck
0e5a5161e6 am d79117c4: am 9ba771bb: am c2db381e: am 6b66a4a8: use findProcess instead of getProcess
* commit 'd79117c405fab2c7a64d7307a941df05a713814d':
  use findProcess instead of getProcess
2015-07-24 04:07:12 +00:00
John Reck
6b66a4a8a3 use findProcess instead of getProcess
Bug: 22701182
Change-Id: I2ec56c55c49401f2f213bbd318e867fd73b37672
2015-07-24 00:37:23 +00:00
Kenny Guy
273639f7ad am e6b1e0e1: am 72be5067: am af52ae07: am 2adcb40d: am 2ba3fec6: Merge "Support waiting for adb shell am stop-user to complete." into mnc-dev
* commit 'e6b1e0e1c22d57b8c3f70e780fdc672175780086':
  Support waiting for adb shell am stop-user to complete.
2015-07-23 22:07:18 +00:00
Kenny Guy
e6b1e0e1c2 am 72be5067: am af52ae07: am 2adcb40d: am 2ba3fec6: Merge "Support waiting for adb shell am stop-user to complete." into mnc-dev
* commit '72be506795c4b7260612458c183282b9c59717ef':
  Support waiting for adb shell am stop-user to complete.
2015-07-23 21:49:30 +00:00
Kenny Guy
2c7836befc Support waiting for adb shell am stop-user to complete.
Use stop user callback to wait for AM.stopUser to complete
if -w flag is passed to adb shell am stop-user

bug: 22599411
Change-Id: I8adbfdbb1ba69a88a67431da65f0a85035587c2d
2015-07-21 18:22:28 +01:00
Fyodor Kupolov
b5143ecfee am 1fa2a088: am 1281575c: am 41fac5e8: am 189f3136: am 98724126: Merge "Added sendBroadcastMultiplePermissions method" into mnc-dev
* commit '1fa2a0888284ae00c905dce7a3003b995815467a':
  Added sendBroadcastMultiplePermissions method
2015-07-15 01:58:48 +00:00
Fyodor Kupolov
1fa2a08882 am 1281575c: am 41fac5e8: am 189f3136: am 98724126: Merge "Added sendBroadcastMultiplePermissions method" into mnc-dev
* commit '1281575c257d52f256f4a08559611e6ec0b6190e':
  Added sendBroadcastMultiplePermissions method
2015-07-15 01:42:58 +00:00
Fyodor Kupolov
d4fd8c766d Added sendBroadcastMultiplePermissions method
Added Context.sendBroadcastMultiplePermissions(Intent intent, String[]
receiverPermissions) method, which allows an array of required permissions
to be enforced.

Bug: 21852542
Change-Id: I27c9130e8f004b428452501ebc8a36aabde1f343
2015-07-14 17:25:42 -07:00
Jarkko Pöyry
19b4ef6622 Merge "Don't NPE on command line parse failure." 2015-07-10 17:40:32 +00:00
Svetoslav
4e5dac3d6e am 3fd5ebfd: am 7cc8de60: am 0ce19f8e: am 240f8e5f: am 3e07ee07: Merge "Grant installer and verifier install permissions robustly" into mnc-dev
* commit '3fd5ebfd778e540276fb5205a8ba3185e620647d':
  Grant installer and verifier install permissions robustly
2015-07-08 02:05:26 +00:00
Svetoslav
3fd5ebfd77 am 7cc8de60: am 0ce19f8e: am 240f8e5f: am 3e07ee07: Merge "Grant installer and verifier install permissions robustly" into mnc-dev
* commit '7cc8de60682b1ed22be1b452809b36a5ceaae02a':
  Grant installer and verifier install permissions robustly
2015-07-08 01:39:40 +00:00
Svetoslav
3e7d977ff7 Grant installer and verifier install permissions robustly
bug:22248271

Change-Id: I3a47ae9a112ba7d88b421fcb5f9651d1168ba7a5
2015-07-07 14:02:51 -07:00
Svet Ganov
e8ce8368fc am 55cd6f44: am 6fe87a56: am 68ffcf88: Merge "Teach receivers, activities, providers, and services app ops." into mnc-dev
* commit '55cd6f44fd1e49164a999e948bb91a03a3b9daf6':
  Teach receivers, activities, providers, and services app ops.
2015-07-04 07:28:18 +00:00
Jarkko Pöyry
b582c67039 Don't NPE on command line parse failure.
Bug: 21202826
Change-Id: I3cbc12eaef920905c8abc6532376827ccff132f4
2015-07-03 19:54:30 -07:00
Svet Ganov
55cd6f44fd am 6fe87a56: am 68ffcf88: Merge "Teach receivers, activities, providers, and services app ops." into mnc-dev
* commit '6fe87a565be345c9455f610bbf26d5eaee593683':
  Teach receivers, activities, providers, and services app ops.
2015-07-02 01:02:04 +00:00
Svet Ganov
99b6043dad Teach receivers, activities, providers, and services app ops.
Perform app op check in addition to the permisison check for all four
paltform components - activities, content providers, broadcast receivers,
services - if they are guarded by a permssion that has an associated app
op. This ensures that legacy apps will behave correctly if the permission
of the caller has been revoked, i.e. the app op for that permission was
disabled.

bug:22199666

Change-Id: Ia22d1c38d58b3cd6aabdc655cb7c7bddd85da7a2
2015-07-01 16:20:00 -07:00
Man Cao
80bea9cde1 resolved conflicts for merge of 8fb82074 to master
Change-Id: I27c7ddeead5a589ae8824f87bf6b42998dc081eb
2015-06-24 17:28:01 -07:00
Mathieu Chartier
8fb8207412 resolved conflicts for merge of 0f14548c to mnc-dev-plus-aosp
Change-Id: I2f79840f82150eddebfbd549afd1eca28075eb43
2015-06-24 15:59:18 -07:00
Adam Lesinski
87344583e1 am 0ebba0e1: am 53d0d065: am b21a77fe: Merge "Allow callers holding PACKAGE_USAGE_STATS permission to call ActivityManager#getPackageImportance()" into mnc-dev
* commit '0ebba0e1a66ddf912b9fb7c43727054cb2d63556':
  Allow callers holding PACKAGE_USAGE_STATS permission to call ActivityManager#getPackageImportance()
2015-06-24 22:22:02 +00:00
Adam Lesinski
c30454c104 Allow callers holding PACKAGE_USAGE_STATS permission to call ActivityManager#getPackageImportance()
Bug:22055550
Change-Id: I1e732e95698daf44bcb223cafde3d3c22746d232
2015-06-24 13:35:46 -07:00
Man Cao
cfa78b2080 Add an AM option to start with allocation tracking
The new option "--track-allocation" is to work with the new
allocation tracker in ART.

Bug:20037135
Change-Id: Ic5f8945ab4c1f167c27b05ad0d11d04bac680c1f
2015-06-24 13:29:29 -07:00
Rahul Chaturvedi
8ee0c2cf24 Merge "Add binder transaction tracking." 2015-06-22 23:55:09 +00:00
Rahul Chaturvedi
52613f9084 Add binder transaction tracking.
Add the ability to am to be able to track binder transact calls. This
will help us diagnose excessive IPC calls.

This CL adds the trace-ip command to am. The usage is,

To start binder transaction tracking,
am trace-ipc start
To stop tracking and dump the data to a file,
am trace-ipc stop --dump-file <FILE>

Bug: 21398706
Change-Id: Ic0c9b3be757dd0662a2750a0d8447e2a5ef1fa90
2015-06-22 16:28:24 -04:00
Dianne Hackborn
a750a63d63 Fix issue #21814207 and issue #21814212 (alarm manager)
Issue #21814207: AlarmManager.setAndAllowWhileIdle should also allow wake locks.

Introduce a whole new infrastructure for providing options when
sending broadcasts, much like ActivityOptions.  There is a single
option right now, asking the activity manager to apply a tempory
whitelist to each receiver of the broadcast.

Issue #21814212: Need to allow configuration of alarm manager parameters

The various alarm manager timing configurations are not modifiable
through settings, much like DeviceIdleController.  Also did a few
tweaks in the existing DeviceIdleController impl.

Change-Id: Ifd01013185acc4de668617b1e46e78e30ebed041
2015-06-17 11:41:45 -07:00
Felipe Leme
f36a0f5d17 Added new options (--eial, --elal, --efal, and --esal) to pass multiple extras as ArrayList instead of Array.
BUG: 21757911
Change-Id: I7e2a9c81ad4606a8aba90ea4820ba0732a1c8749
	modified:   src/com/android/commands/am/Am.java
 On branch handles_array_list
 Changes to be committed:
	modified:   src/com/android/commands/am/Am.java
2015-06-10 13:44:04 -07:00
Stefan Kuhne
16045c24fe Adding am send-trim-memory command
This patch adds a send-trim-memory command to the ActivityManager to allow
for better debugging&testing.

The command is
adb shell am send-trim-memory [--user <USER_ID>] <PROCESS> <LEVEL>
whereas LEVEL can be one of the following:
[HIDDEN|RUNNING_MODERATE|BACKGROUND|RUNNING_LOW|MODERATE|
 RUNNING_CRITICAL|COMPLETE]

Bug: 21633189
Change-Id: I7a41ce02c3c9043ffd3e5aaa791f7b7306a9de49
2015-06-05 16:30:29 -07:00
Amith Yamasani
e5f330456b Rename *AppIdle to *AppInactive per api-council
Change to setAppInactive and isAppInactive in a few places.

Bug: 20823737
Change-Id: Ie57dbc0dd2842e771bb5fd9f69b8041aacaa005c
2015-05-08 13:20:22 -07:00
Amith Yamasani
cf76872a62 Add ability to get and set idle state of apps
Add am shell command to set and get idle
Add public API to check if an app is idle

Bug: 20534955
Bug: 20493806
Change-Id: Ib48b3fe847c71f05ef3905563f6e903cf060c498
2015-04-24 12:58:46 -07:00
Wale Ogunwale
0bd2aa7603 Fail early when starting a background user activity.
If it shouldn't be displayed for all users.

Bug: 13507605
Change-Id: I8fe8e5a98759c1ca058cc7d222817f6d580ffa11
2015-04-17 08:37:56 -07:00
Dianne Hackborn
1e38382b54 Fixes to idle alarm scheduling, package importance.
- Add new API to ask the activity manager what the current
  importance of a particular package name is (along with a few
  new useful importance levels).

- Fix my last alarm manager change to actually execute the
  alarms we have now decided should run even while we are idle.

Change-Id: I1f14712b4e390770d53b185c96a1b36f6aadd687
2015-04-14 10:01:24 -07:00
Dianne Hackborn
d59a5d59df Various fixes and improvements...
Issue #19912529: VI: VoiceInteractor callback ClassCastException

Fix to use correct argument.

Issue #19912636: VI: Documentation for VoiceInteractionSession.onBackPressed

Added documentation.

Issue #19912703: VI: VoiceInteractionSession NPE on Abort Request

Maybe fix this -- don't crash if there is no active session.

Issue #19953731: VI: Add value index to...
...android.app.VoiceInteractor.PickOptionRequest.Option

There is now an optional index integer that can be associated with
every Option object.

Issue #19912635: VI: Behavior of startActivity when in voice...
...interaction is unexpected

We now forcibly finish the current voice interaction task whenever
another activity takes focus from it.

Issue #20066569: Add API to request heap dumps

New ActivityManager API to set the pss limit to generate heap
dumps.

Also added app ops for assist receiving structure and screenshot
data, so that we can track when it does these things.

Change-Id: I688d4ff8f0bd0b8b9e3390a32375b4bb7875c1a1
2015-04-04 17:36:05 -07:00
John Reck
34faab5a54 Add --sampling to am profile start
Change-Id: I00dfdef6a7ac61ab4ce16fefe1ddc5554ace0c88
2015-03-26 11:05:08 -07:00
Dianne Hackborn
b9a5e4ad30 Add new debug feature to automatically create heap dumps.
Not yet working, unless you turn off SELinux enforcing.
We need to update SElinux to allow the system process
to give apps access to /data/system/heapdump/javaheap.bin.

Currently watching can only be enabled through the shell,
such as:

adb shell am set-watch-heap com.android.systemui 1024

The last number is the process pss size in bytes, so this is
asking us to warn if it goes about 1K which will be all the
time.

Change-Id: I2089e5db2927afca0bf01a363c6247ee5dcb26e8
2015-03-06 16:42:03 -08:00
John Spurlock
08c7116ab9 Remove unused imports in frameworks/base.
Change-Id: I031443de83f93eb57a98863001826671b18f3b17
2015-02-28 14:47:49 -05:00
Wale Ogunwale
53a29a90f3 Added ActivityManager API and AM command to resize a task.
Also fixed issue with ActivityStackSupervisor.moveTaskToStackLocked()
functionality not working correctly.

Change-Id: Ia13f1e92a7c59ce6543c226533ac8ea623488290
2015-02-24 09:33:18 -08:00
Wale Ogunwale
5e789f03b2 Fixed bug in 'am stack split' command.
Change-Id: Id3efb65a3f9cbf3c223ea08d51e2028180bd5479
2015-02-12 09:25:52 -08:00