1128 Commits

Author SHA1 Message Date
Christopher Tate
58d380d2af debuggerd now notifies the Activity Manager about native crashes
The Activity Manager sets up a permission-guarded domain socket, which
debuggerd connects to when a crash happens.  If this is successful,
the daemon then mirrors the logged crash report to that socket, then
closes it.

The Activity Manager parses the native crash dump supplied by debuggerd
and forwards it to the standard app-crashed code.  The UX result is
that users now see the normal "app has stopped unexpectedly" dialog
with "report" and "okay" options for native crashes, not just for
DVM-mediated crashes.

Bug 8322568

Change-Id: Ie1b279896c603bd74d82d6cfcfd66a8f231da134
2013-04-01 13:50:23 -07:00
Ben Cheng
b5cda42c57 Crank up the mOomMinFreeHigh values by 50%.
Devices with 1GB of RAM can benefit from more aggressive OOM killer.

BUG: 7972252
Change-Id: Id2b80c14a3cff195c17ef0d14c80b92394649d98
2013-03-27 17:36:13 -07:00
Dianne Hackborn
3bcc2fbaad Merge "Fix issue #8470131: Process thrash kills battery" into jb-mr2-dev 2013-03-27 00:24:04 +00:00
Dianne Hackborn
a40cfeb55f Fix issue #8470131: Process thrash kills battery
Protect app widget broadcasts from abuse.

In this case the app was sending an APPWIDGET_UPDATE broadcast
without specifying a target, which (a) should not be allowed (you
should not be able to send updates to other apps), and (b) resulted
in every single potential app widget in the system being launched...
which was about 75 of them.

Change-Id: I9d48733610ce6d5a7c32e69a3e06b9f33bd79a34
2013-03-25 17:49:36 -07:00
Robert Craig
0f40dc923c Add seinfo parsing to PackageManagerService.
This patch set allows the PMS to parse the
mac_permissions.xml file which contains the
seinfo values. Each package that is installed
on the device will be assigned an seinfo value
based on policy. This seinfo value will help label
the app process and data directory.  Modifications
include adjustments to ApplicationInfo.java
to store the seinfo tag per package as well as
adjustments to installd to communicate the seinfo
tag to libselinux.

Change-Id: I61ad1ea12fb6a9a6d0b108ec163bc4bf4c954b58
Signed-off-by: rpcraig <rpcraig@tycho.ncsc.mil>
2013-03-25 17:30:08 -07:00
Dianne Hackborn
2ced96c544 Fix issue #8436951 JB-MR2: Compatibility: Audible, Pandora, ...
...Tune-In does not work since JWQ77

Instead of crashing the app for it being bad, just go ahead and
show a notification for it anyway that we make up.

You get what you deserve. :p

Change-Id: I92e32b9ff8835dabde63f8e08e991f72de0d0a92
2013-03-21 14:23:46 -07:00
Dianne Hackborn
282add7bc3 Fix issue #8401553: It's possible to startForeground()...
...with no visible Notification

Don't allow a 0 icon resource.

Change-Id: I52e93533e6c45c6027ff3c185060cd54d087d077
2013-03-15 18:48:04 -07:00
Christopher Tate
a83cab0001 Do not hang in pm clear on an invalid package name
The Activity Manager was not properly informing the observer that
the operation had concluded (unsuccessfully).

Bug 8222595

Change-Id: I8234e32d8edf4112c8c7a5e20e341d0b41e23014
2013-03-07 17:50:11 -08:00
Michael Wright
32440aa25d Merge "Unify inputDispatchingTimedOut with keyDispatchingTimedOut" into jb-mr2-dev 2013-03-01 22:20:46 +00:00
Michael Wright
7dd5bb18d4 Unify inputDispatchingTimedOut with keyDispatchingTimedOut
Bug: 8194916
Change-Id: Iac40108d848bcca77f49a7a49c57a095b3dbe9c9
2013-03-01 14:14:35 -08:00
Michael Wright
173bb61544 Merge "Move stack dump off of InputDispatcher thread" into jb-mr2-dev 2013-02-26 22:14:41 +00:00
Michael Wright
5633e23c22 Move stack dump off of InputDispatcher thread
Change-Id: I7250a0488c3e4c5dc159f4635a57e1e49aa8397a
2013-02-25 17:52:37 -08:00
Craig Mautner
2ad920759b Revert ActivityManager changes for tasks. DO NOT MERGE
Keeping all activity=>task changes in master and removing them
from jb-mr2.

Revert "Update histories simultaneously."
Revert "Add null check to setAppGroupId."
Revert "Fix crashing bug in validator."
Revert "Switch topRunning* and moveTaskTo*"
Revert "Begin switch over to task based history."
Revert "Reset and reuse Iterators and don't new() one."
Revert "Remove AppWindowToken lists."
Revert "Fix build."
Revert "Remove unused App methods."
Revert "Stop using AppToken movement and start using Task."
Revert "Replace access to mAppTokens with AppTokenIterator"
Revert "Refactor setAppOpVisibility implementation."
Revert "Add AppWindowTokens to TaskList."
Revert "Make ActivityStack.mHistory private."
Revert "Migrate AppWindowToken lists into DisplayContent."

Change-Id: I5722c9a4956dccb52864207e2967690bc58e4ebb
2013-02-25 17:07:39 -08:00
Craig Mautner
b44de0d910 Update histories simultaneously.
In moveTaskToBackLocked calls that used mHistory were being made
between the times that mTaskHistory and mHistory were modified. This
caused an inconsistent state that led to Windows arranged out of
order. Updating both history stacks at the same time fixes this.

Fixes bug 8244261.

Change-Id: I9669762ad39b06ab6d401122702b74969d4dc658
2013-02-21 20:00:58 -08:00
Craig Mautner
11bf9a52eb Switch topRunning* and moveTaskTo*
- More of the Activity to Task changeover.
- Fix bug in validateAppTokens().
- Improved validation of changeover.
- Eliminated iterator classes.

Change-Id: I934a208eabfc9a2668e5a6162452e1406f2c8d3a
2013-02-20 16:29:07 -08:00
Craig Mautner
5d9c7be84d Begin switch over to task based history.
- Introduce the task history and add to and remove from it with
verification.

Change-Id: If97e74f5a13f85acdb1521fc6d0b066a7e8584ae
2013-02-19 18:11:33 -08:00
Craig Mautner
b0c0b1fd70 Remove unused App methods.
Now that the Task methods have replaced the App methods remove
the App methods.

Change-Id: I0e7432f2c6f99708759ed8c871d20eb5bd38c3c2
2013-02-13 15:24:14 -08:00
Craig Mautner
926f3839d8 Stop using AppToken movement and start using Task.
Change-Id: I5fbd3b2b692e0e127386051f782b1015515ba384
2013-02-13 11:58:56 -08:00
Craig Mautner
30e2d72810 Replace access to mAppTokens with AppTokenIterator
More switching from Activity-based to Task-based control.

Change-Id: Ida47d71a52b875a6a6bd77cb62911053f942da15
2013-02-12 16:03:29 -08:00
Craig Mautner
bea3b60ed1 Merge "Add AppWindowTokens to TaskList." 2013-02-12 23:57:09 +00:00
Craig Mautner
05d6272bad Add AppWindowTokens to TaskList.
- Add/remove/move TaskLists from ActivityStack.
- Further isolate mHistory.
- Cleanup warnings by parameterizing ArrayList.
- Fix previous bugs.

Change-Id: Ife8c7b7347479c70f10467cc384283456149ac50
2013-02-12 10:52:55 -08:00
Dianne Hackborn
1d3079cb8d Merge "App ops: cleanup, handle root and shell, perms." 2013-02-12 00:41:07 +00:00
Dianne Hackborn
514074fae8 App ops: cleanup, handle root and shell, perms.
Rework how the shell user is defined so that it is
associated with an actual apk, instead of being a free
roaming uid with special permissions assigned to it.
This allows us to correctly account for its operations
in app ops.

Implement a special case for the root user in app ops --
it is always allowed, always with the package name "root".

Add various code to take care of cleaning up package state
from app ops -- when packages are uninstalled, and during
boot if any packages currently being stored no longer exist.

Also fix a bug in the activity manager to correctly grant
permissions in all cases when onNewIntent() is being called.

Change-Id: Iae9f6d793ee48b93518c984ad957e46ae4582581
2013-02-11 15:33:48 -08:00
Craig Mautner
cae015fea3 Make ActivityStack.mHistory private.
Isolate the Activity history for later conversion to Task-based
management.

Change-Id: I4b6bf22de035c768aa705df0cc4f84486e8ede56
2013-02-08 14:31:27 -08:00
Craig Mautner
2ceb081505 Merge "Migrate AppWindowToken lists into DisplayContent." 2013-02-07 18:50:52 +00:00
Jeff Sharkey
08d11e1fa9 Merge "Require that bugreport requesters have DUMP." 2013-02-06 23:57:44 +00:00
Craig Mautner
b1fd65c0ff Migrate AppWindowToken lists into DisplayContent.
In preparation for converting ActivityManager control to a task-based
interface the AppWindowTokens are being stored per-display.

Change-Id: Ie5e355219554523f5e56eaef138d382975cf1682
2013-02-05 17:08:10 -08:00
Jeff Sharkey
b932319bff Require that bugreport requesters have DUMP.
Bug: 8139970
Change-Id: I055855fa5450521122e54ed39df5981190b401bd
2013-02-05 13:32:18 -08:00
Dianne Hackborn
f51f61269a App ops: new operations for SMS.
Implementation required a new framework feature
to associate an app op with a broadcast.

Change-Id: I4ff41a52f7ad4ee8fd80cbf7b394f04d6c4315b3
2013-02-05 11:56:12 -08:00
Dianne Hackborn
f265ea9d83 App ops: vibration, neighboring cells, dialing, etc.
Improve handling of vibration op, so that apps are
better blamed (there is now a hidden vibrator API that
supplies the app to blame, and the system now uses this
when vibrating on behalf of an app).

Add operation for retrieving neighboring cell information.

Add a new op for calling a phone number.  This required
plumbing information about the launching package name through
the activity manager, which required changing the internal
startActivity class, which required hitting a ton of code that
uses those internal APIs.

Change-Id: I3f8015634fdb296558f07fe654fb8d53e5c94d07
2013-02-01 15:14:29 -08:00
Svetoslav Ganov
d0fd54648c Merge "Adding UI test automation APIs." 2013-01-29 03:16:40 +00:00
Dianne Hackborn
0798149082 Fix bug where we could get stuck repeatedly launching an activity.
A previous change to avoid losing activities if their process
happens to be gone at the point of launch (by counting that
activity as having its state saved) has resulted in a problem
where an activity that crashes during launch will be repeatedly
relaunched.

This is fixed here by explicitly keeping track of our attempts
to launch the activity since it was last able to save its state,
and not keeping it around if it looks like the launch is
repeatedly failing.

Change-Id: Icefd952443b7eb1222f233db95e0157fc3dd72d1
2013-01-28 11:38:26 -08:00
Dianne Hackborn
f9c5e0fe83 Add new API to propagate contextual data to the assist action
When launching an assist, we have a new API allowing the
current foreground activity/application to provide additional
arbitrary contextual information that is stuffed in the
assist intent before it is launched.

Change-Id: I0b2a6f5a266dc42cc0175327fa76774f814af3b4
2013-01-23 14:39:13 -08:00
Svetoslav Ganov
80943d8daa Adding UI test automation APIs.
This change adds APIs support for implementing UI tests. Such tests do
not rely on internal application structure and can span across application
boundaries. UI automation APIs are encapsulated in the UiAutomation object
that is provided by an Instrumentation object. It is initialized by the
system and can be used for both introspecting the screen and performing
interactions simulating a user. UI test are normal instrumentation tests
and are executed on the device.

UiAutomation uses the accessibility APIs to introspect the screen and
a special delegate object to perform privileged operations such as
injecting input events. Since instrumentation tests are invoked by a shell
command, the shell program launching the tests creates a delegate object and
passes it as an argument to started instrumentation. This delegate
allows the APK that runs the tests to access some privileged operations
protected by a signature level permissions which are explicitly granted
to the shell user.

The UiAutomation object also supports running tests in the legacy way
where the tests are run as a Java shell program. This enables existing
UiAutomator tests to keep working while the new ones should be implemented
using the new APIs. The UiAutomation object exposes lower level APIs which
allow simulation of arbitrary user interactions and writing complete UI test
cases. Clients, such as UiAutomator, are encouraged to implement higher-
level APIs which minimize development effort and can be used as a helper
library by the test developer.

The benefit of this change is decoupling UiAutomator from the system
since the former was calling hidden APIs which required that it is
bundled in the system image. This prevented UiAutomator from being
evolved separately from the system. Also UiAutomator was creating
additional API surface in the system image. Another benefit of the new
design is that now test cases have access to a context and can use
public platform APIs in addition to the UiAutomator ones. Further,
third-parties can develop their own higher level test APIs on top
of the lower level ones exposes by UiAutomation.

bug:8028258

Also this change adds the fully qualified resource name of the view's
id in the emitted AccessibilityNodeInfo if a special flag is set while
configuring the accessibility service. Also added is API for looking
up node infos by this id. The id resource name is relatively more stable
compared to the generaed id number which may change from one build to
another. This API facilitate reuing the already defined ids for UI
automation.

bug:7678973

Change-Id: I589ad14790320dec8a33095953926c2a2dd0228b
2013-01-22 17:56:53 -08:00
Dianne Hackborn
35654b61e8 More work on App Ops service.
Implemented reading and writing state to retain information
across boots, API to retrieve state from it, improved location
manager interaction to monitor both coarse and fine access
and only note operations when location data is being delivered
back to app (not when it is just registering to get the data at
some time in the future).

Also implement tracking of read/write ops on contacts and the
call log.  This involved tweaking the content provider protocol
to pass over the name of the calling package, and some
infrastructure in the ContentProvider transport to note incoming
calls with the app ops service.  The contacts provider and call
log provider turn this on for themselves.

This also implements some of the mechanics of being able to ignore
incoming provider calls...  all that is left are some new APIs for
the real content provider implementation to be involved with
providing the correct behavior for query() (return an empty
cursor with the right columns) and insert() (need to figure out
what URI to return).

Change-Id: I36ebbcd63dee58264a480f3d3786891ca7cbdb4c
2013-01-16 12:11:01 -08:00
Dianne Hackborn
885bfcd523 am 9e6575bc: am 854458f4: am 0287ca3c: am e62fa825: Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog
* commit '9e6575bc52f421484fe262aff224db247e70d830':
  Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog
2013-01-11 10:53:19 -08:00
Dianne Hackborn
9e6575bc52 am 854458f4: am 0287ca3c: am e62fa825: Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog
* commit '854458f4d52937f9a1385559d759bd8019eb3294':
  Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog
2013-01-09 19:01:26 -08:00
Dianne Hackborn
854458f4d5 am 0287ca3c: am e62fa825: Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog
* commit '0287ca3ca36ad98004ddabfa189105e6324a820e':
  Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog
2013-01-09 19:00:06 -08:00
Dianne Hackborn
e62fa82579 Merge from master: fix issue #7966357: Super lights out mode vs. volume dialog
The volume panel now forces us out of the UI modes while it
is up.

Change-Id: If39fa33b1c52579bf5d376ce4722408cee3ca951
2013-01-09 18:51:51 -08:00
Dianne Hackborn
a06de0f29b New "app ops" service.
Initial implementation, tracking use of the vibrator, GPS,
and location reports.

Also includes an update to battery stats to also keep track of
vibrator usage (since I had to be in the vibrator code anyway
to instrument it).

The service itself is only half-done.  Currently no API to
retrieve the data (which once there will allow us to show you
which apps are currently causing the GPS to run and who has
recently accessed your location), it doesn't persist its data
like it should, and no way to tell it to reject app requests
for various operations.

But hey, it's a start!

Change-Id: I05b8d76cc4a4f7f37bc758c1701f51f9e0550e15
2013-01-09 12:47:47 -08:00
Craig Mautner
4b71aa1f8a Move app transition constants
Move app transition constants from WindowManagerPolicy to
AppTransition.

Change-Id: I8ae6c4d0da1db826c44eb4ea0c6b85016b50b1a3
2013-01-07 23:38:57 -08:00
Craig Mautner
b12428a128 Save most recent thumbnail Bitmap for reuse.
This keeps Recents from taking two identical screenshots, one for
the Recents thumbnail and one for the pause activity thumbnail.

Fixes bug 7351766.

Change-Id: Ia4d12802151666ec36e4d9b395cf10e1e02dc37f
2012-12-20 16:24:58 -08:00
Craig Mautner
6cf1a66348 Merge "Call adjustWallpaperWindowsLocked once per pass." 2012-12-12 15:35:57 -08:00
Craig Mautner
ae44659f30 Call adjustWallpaperWindowsLocked once per pass.
Also refactor a few methods and improve logging.

Change-Id: Ic54a1ff99f6de732b31cda5c06d36e8de01a269c
2012-12-12 10:09:19 -08:00
Christopher Tate
1423fa30c2 am 1de62393: am 534de491: Merge "Make immersive mode public & imply update locking" into jb-mr1-aah-dev
* commit '1de623939090993d03a7c398d09e2d13950d682b':
  Make immersive mode public & imply update locking
2012-12-11 16:15:38 -08:00
Christopher Tate
1de6239390 am 534de491: Merge "Make immersive mode public & imply update locking" into jb-mr1-aah-dev
* commit '534de491e6522465a7ad12d7cba9b2f80deab364':
  Make immersive mode public & imply update locking
2012-12-11 16:13:51 -08:00
Christopher Tate
73c2aee40a Make immersive mode public & imply update locking
Activity.setImmersive(boolean) / android:immersive="bool" are now public.
In addition, if the foreground activity is immersive then an update lock
will be held on its behalf.  This lets applications such as movie players
suppress the display of intrusive notifications, OTA-availability dialogs,
and the like while they are displaying content that ought not to be
rudely interrupted.

The update lock aspect of this mode is *advisory*, not binding -- the
update mechanism is not actually constrained; it simply uses this information
in deciding whether/when to prompt the user.  It's more a guideline than
a rule.

Bug 7681380

Change-Id: I3c412a84cbf3933e3bf0168f2c71c54a86e4b7e5
2012-12-10 18:40:57 -08:00
Sascha Prueter
961ce2afbf am 2588648b: am 203f69f0: Merge "Call setSize to sync Surface to SurfaceFlinger. DO NOT MERGE" into jb-mr1.1-dev
* commit '2588648b5268526bdc9ed7fb4e9eac36c8c693dc':
  Call setSize to sync Surface to SurfaceFlinger. DO NOT MERGE
2012-12-07 12:40:32 -08:00
Craig Mautner
4abf3f987f Call setSize to sync Surface to SurfaceFlinger. DO NOT MERGE
RecentsActivity screenshots are called for very quickly after
WindowStateAnimator prepareSurface(). Without enough delay the
Surface.setLayer call does not propagate to the SurfaceFlinger
and the screenshot is incorrect (black) because it stops sampling
the layers too early.

This fix calls Surface.setSize() for each sampled Surface in
screenshots. setSize forces the SurfaceFlinger to process all
transactions queued before returning from closeTransaction.

Bug 7552304 fixed.

Change-Id: I1911dfa0b09cab713c55f5ba0c612496337a77df

Conflicts:

	services/java/com/android/server/wm/WindowManagerService.java
2012-12-07 11:21:35 -08:00
Dianne Hackborn
f9ae5f75af am 23307cbb: am e0a676a3: Merge "Fix issue #7649590: Background windows sometimes not being hidden for secondary users" into jb-mr1.1-dev
* commit '23307cbb6b432b658b0fd7437dacfedd6298af94':
  Fix issue #7649590: Background windows sometimes not being hidden for secondary users
2012-12-03 16:08:35 -08:00