36611 Commits

Author SHA1 Message Date
Tim Murray
f0f9a82981 Don't dump stack traces for background ANRs.
Dumping stack traces can be extremely expensive, and doing so for
background applications often has extremely negative side effects for
foreground applications. This can be exacerbated by resource-intensive
applications, because those may exhibit thermal throttling in the first
place. For such applications, the additional performance hit caused by
stack dumps may be catastrophic.

Instead, don't dump stack traces for background ANRs except for the app
that actually ANR'd.

bug 30112521

Change-Id: I8a05059343254861c436a193690cd1c50a95d674
2016-07-13 16:02:43 -07:00
Lorenzo Colitti
09e3715661 Make registerDefaultNetwork work on metered networks.
Bug: 29927488
Change-Id: I3b705c2ab0d1493546ffa5185bb5b07d5e25c897
2016-07-01 04:42:58 +00:00
Christopher Tate
fa7d97fa15 Make sure SELinux labels are correct after move-to operations
In some circumstances wallpaper-related files are moved into position,
and must then take proper effect.  Make sure that they have the
correct SELinux labels afterwards to avoid preventing some valid
accesses.

Bug 29469965

Change-Id: I6d7c86be63d568fa0ad8841d109a7ff2149fdd54
2016-07-01 00:16:51 +00:00
Jeff Sharkey
479212cf50 Move getRecentTasks() to ParceledListSlice.
In extreme cases the list of recent tasks can grow beyond the size
of a single Binder transaction.  This change moves over to
ParceledListSlice which handles chunking any large results.

Bug: 29635557
Change-Id: Iaf1227234f5f8c9451f73a6a5c1dc89f2067f05f
2016-06-29 22:17:41 +00:00
Rob Carr
55427a6650 Merge "Only use one SurfaceControlWithBackground per AppToken." into nyc-dev 2016-06-29 03:27:48 +00:00
Robert Carr
91b2280964 Only use one SurfaceControlWithBackground per AppToken.
In the past, if an app never renders to a SurfaceView, it will be
invisible despite having FLAG_OPAQUE. This means an app could leave a
totally empty SurfaceView (never drawing in to it) on top of a second
SurfaceView, and expect the second one to be visible. This is probably
buggy app behavior because FLAG_OPAQUE means if they ever draw anything at all
in to the top SurfaceView the bottom one will become totally invisible.
However this has worked in the past, so we have to preserve things for
apps. To accomplish this we ensure only the bottom most visible
SurfaceView for a given AppToken will receive a background. We achieve
this by synchronizing through the app token whenever visibility or
layering of a SurfaceView changes.

Bug: 29580298
Change-Id: I0023326323cb961b56404fd49093384e7b72aa54
2016-06-28 20:09:09 -07:00
Jim Miller
d0063106b6 Relax security constraint around getAuthenticatorId().
Fixes bug 28603656

Change-Id: I54216d4b9a3ab23f9d5bfe0f40f2dd27e723c21e
2016-06-28 16:43:57 -07:00
Felipe Leme
dd85da6e94 Remove redundant setPendingIntentWhitelistDuration() calls.
Since all pending intents are stored on a Set in the Notication object,
there is no need to individually check for specific pending intents.

BUG: 29480440
Change-Id: I27a18bb535a9a4bb6cb4e76bdc189e6c315a684a
2016-06-28 11:34:54 -07:00
Felipe Leme
a7778b0654 Fixed whitelistManager set on unbindServiceLocked()
It must call updateWhitelistManagerLocked() because the app might have
other services with the whitelistManager set, in which case the process
record should not have whitelistManager reset.

Fixes: 29480440

Change-Id: I268278c646aaa89a352f02178b294c02c3c11d35
2016-06-28 10:41:45 -07:00
Shreyas Basarge
5f72b129c4 Merge "SyncOperation float cast fix" into nyc-dev 2016-06-28 15:38:07 +00:00
Svetoslav Ganov
b2cd9c95bf Merge "Mark app pending intents in notification extras" into nyc-dev 2016-06-28 00:42:24 +00:00
Svet Ganov
ddb948896c Mark app pending intents in notification extras
We need to make every peniding intent that went in the notification
system to allow special handling of such intents when fired by a
notification listener. If a pending intent from a notification
is sent from a notification listener, we white-list the source app
to run in data saver mode for a short period of time. The problem is
that actions and the notificaion can have extras which bundles may
contain pending intents but the system cannot look into the bundles
as they may contain custom parcelable objects. To address this we
keep a list of all pending intents in the notification allowing
the system to access them without touching the bundle. Currently
the pending intents are written to the parcel twice, once in the
bundle and once as the explicit list. We can come up with a scheme
to optimize this but since pending itents are just a binder pointer
it is not worth the excecise.

bug:29480440

Change-Id: I7328a47017ca226117adf7054900836619f5679b
2016-06-27 17:32:25 -07:00
Dianne Hackborn
a39d380651 Merge "Fix bug where process whitelist manager state would not be correct." into nyc-dev 2016-06-27 23:52:01 +00:00
Andre Eisenbach
4d6be6b308 Merge "Add extra waiting when switching users" into nyc-dev 2016-06-27 23:42:17 +00:00
Chris Tate
f480698298 Merge "Fix #29737133 : content-trigger jobs not running properly" into nyc-dev 2016-06-27 23:18:31 +00:00
Christopher Tate
4b425712c6 Fix #29737133 : content-trigger jobs not running properly
When removing the ContentObserver wrapper from our internal
bookkeeping we were using the wrong key.  That led to future
re-registrations thinking they were reusing a currently-
registered observers, but instead never getting onChange()
notifications.

Change-Id: Id3111db057ae63194049d7d48d45b75be6bb0000
2016-06-27 16:12:41 -07:00
Pavlin Radoslavov
4140111167 Add extra waiting when switching users
If disabling Bluetooth times out, wait for an additional amount of time
to ensure the process is shut down completely before attempting to restart.

Bug: 29738770
Change-Id: I43dec35a1e03d12cb07863babea97d55baa32528
2016-06-27 23:09:09 +00:00
Dianne Hackborn
a590d2be93 Fix bug where process whitelist manager state would not be correct.
We can't update this in updateOomAdjLocked(), because we very
deliberately only iterate through services in there as needed.
The correct thing to do is update the process as services/connections
are associated with it, so do that.

Now basically all of the logic for tracking the state is in
ActiveServices, as we bind and unbind services and add and removing
them from process records.  It's a little messy because we don't
have a central place for removing them from process records, which
should be cleaned up in the future.

Part of fixes for issue #29480440

Change-Id: Iac96f002a5b4e3b0277df244ff7b90f59a6e8440
2016-06-27 15:40:38 -07:00
Andrii Kulian
06b1d786e9 Merge "Resume only activities in focused stack" into nyc-dev 2016-06-27 20:50:02 +00:00
Andrii Kulian
c11ce7b1cd Resume only activities in focused stack
While performing ensureActivitiesVisibleLocked we should only
resume activity in focused stack. Otherwise we can get several
resumed activities at the same time.

Bug: 29619461
Change-Id: Id65fe1a29841ee3166694bfb6a8236151b9fc7ec
2016-06-27 10:58:13 -07:00
Shreyas Basarge
ace6f6d5ca SyncOperation float cast fix
Fix casting of Float into Double in SyncOperation.

Bug: 29510536
Change-Id: I553e8988e4bc09c3624e42f6f108f723007d32c4
2016-06-27 12:25:17 +01:00
Adrian Roos
594c9cb356 Merge "Improve ANR dropbox reports" into nyc-dev 2016-06-24 01:57:43 +00:00
Adrian Roos
73d1ce85ac Improve ANR dropbox reports
Work towards better diagnosing b/29501073. Adds logic to ensure that the dropbox
entry generated for ANRs fits at least some part of the logcat before the MAX_DROPBOX_SIZE
mark. Also reduces the MAX_DROPBOX_SIZE to be better match size restrictions.

Bug: 29501073
Change-Id: Ice5599582cbb536b7d81aa0c0340ff753ca86ebf
2016-06-23 18:28:37 -07:00
Brad Ebinger
dcbdc0df43 Access internal ringer mode to properly vibrate in DND
Currently, an incoming call will not vibrate properly in certain cases
in DND mode. Specifically, if Priority Only mode is set, but Calls from
anyone are allowed. We now get the internal ringer mode to detect if the
incoming call is ringing while in DND mode.

Bug: 29184073
Change-Id: I1e0e7cf384a2bc1df1378043cd3f7e9dec57a94c
2016-06-24 00:48:14 +00:00
TreeHugger Robot
060d5a0e0a Merge "When uninstalling, only kill the requested user." into nyc-dev 2016-06-23 18:03:27 +00:00
Jeff Sharkey
85f449eaba When uninstalling, only kill the requested user.
When an app is being uninstalled for a specific user, only kill the
app under that user; leave the app running under other users.

Bug: 28875343
Change-Id: Ie60753cfd22df10a2b17d8c3732b6f19d2fe1fb9
2016-06-23 10:15:17 -06:00
TreeHugger Robot
7aac630f8e Merge "Don't loop forever on 0-length options." into nyc-dev 2016-06-23 08:10:17 +00:00
Lorenzo Colitti
8995d85b94 Don't loop forever on 0-length options.
A malformed RA could cause the Ra constructor in ApfFilter to
enter an infinite loop while holding the class lock. This blocks
IpManager until reboot and drains the battery.

Bug: 29586253
Change-Id: Idaa46b3bc50371db076630881883807c2fa21674
2016-06-23 15:43:34 +09:00
TreeHugger Robot
42147f0ff3 Merge "Don't compare intent filters on singleTask adjacent launch" into nyc-dev 2016-06-23 02:17:24 +00:00
Andrii Kulian
354c8cde6c Merge "Show unsopported display size dialog on relaunch" into nyc-dev 2016-06-23 01:00:36 +00:00
Andrii Kulian
039ba48973 Don't compare intent filters on singleTask adjacent launch
Bug: 29578845
Change-Id: Ic1614fc1f321e80ffdc2ab498d720657f393c239
2016-06-22 17:16:45 -07:00
TreeHugger Robot
45c79447ad Merge "Fix adb backup/restore" into nyc-dev 2016-06-22 22:56:37 +00:00
Phil Weaver
8ac5bcbab2 Merge "Report all content changes to a11y services." into nyc-dev 2016-06-22 22:48:50 +00:00
Fyodor Kupolov
f9f2c7ceef Merge "Use granted userId to look up provider info" into nyc-dev 2016-06-22 22:28:38 +00:00
Andrii Kulian
f42cbe8338 Show unsopported display size dialog on relaunch
If the display density change made app restart when it was focused
or we navigate back to it after density change and it makes it
restart - we didn't display unsupported display size dialog.

Bug: 29574686
Change-Id: Ic8fdc8a54df160f947e2d340ab2cb2931bac195d
2016-06-22 14:49:58 -07:00
Christopher Tate
5cb5e89d77 Fix adb backup/restore
* Exclude key/value-only backup participants until we have a chance to
  augment the archive format with proper handling.

* Don't back up 'stopped' apps, which would un-stop them

* Fix unspecified-user bindService/startActivity invocations

* Teach adb restore about the onRestoreFinished() lifecycle method

* Implement proper app timeout handling in the adb data flows

* Backstop wallpaper backup against rare leftover-state issues

Bug 28056941

Change-Id: Ia59c71a2c74a632a2c2a527b9b7374229c440d46
2016-06-22 13:53:41 -07:00
TreeHugger Robot
dea7aa0da1 Merge "Fixed whitelistManager assignment." into nyc-dev 2016-06-22 20:40:21 +00:00
TreeHugger Robot
18553f5f73 Merge "Avoid runtime restart when storage is missing." into nyc-dev 2016-06-22 20:08:19 +00:00
Lifu Tang
335387a1df Merge "Added more logs to track WakeLock usages" into nyc-dev 2016-06-22 19:50:48 +00:00
Phil Weaver
ee77b881a4 Report all content changes to a11y services.
Changes were discarded if they arrived too quickly in
A11yManagerService. Excuse content change events from
throttling at this level.

Bug: 29355115
Change-Id: Ifd9da07315ce0c18f59c1dad6a621110ad48343b
2016-06-22 12:35:26 -07:00
Jeff Sharkey
11f197c3fe Avoid runtime restart when storage is missing.
When primary shared storage is completely missing, catch the thrown
exception and treat as if ejected.

Bug: 29461637
Change-Id: I8eb5cdeb01983efbf26da3d32ab19a6630662156
2016-06-22 12:37:08 -06:00
TreeHugger Robot
a3290363e1 Merge "Start primary storage move outside lock." into nyc-dev 2016-06-22 18:36:07 +00:00
Felipe Leme
6e051cc2c3 Fixed whitelistManager assignment.
It must be set before looping through all app services...

Fixes: 29480440

Change-Id: I38f78255ea44f00ea4226010d334b94fb4baadb4
2016-06-22 10:59:07 -07:00
Lifu Tang
cbd2a140c1 Added more logs to track WakeLock usages
Bug: 28829595
Change-Id: I607745a27e830e42300ee307412e57c2254bff55
2016-06-22 10:57:55 -07:00
Fyodor Kupolov
9bbaacf845 Use granted userId to look up provider info
In getPersistedUriPermissions, use granted userId instead of the calling
userId to look up provider info.

Bug: 29058113
Change-Id: Ia637be414f9ef3b8e9bce13bb56bd335cfb28ac7
2016-06-22 10:31:18 -07:00
Chong Zhang
75c7cc6ca9 Merge "Unblock 'am start -W' if activity is brought to front without launching" into nyc-dev 2016-06-22 17:17:48 +00:00
Dianne Hackborn
a62a7eef24 Merge "Fix issue #29545190: JobScheduler ContentUri NOTIFY_FOR_DESCENDANTS flag..." into nyc-dev 2016-06-22 17:12:09 +00:00
Julia Reynolds
00d9d9f11e Don't iterate over a list items are removed from.
Change-Id: I896cd4578da15e21d422ca8db42e34bbd10912e8
Fixes: 29512540
2016-06-22 16:34:06 +00:00
Jeff Sharkey
a31460ce12 Start primary storage move outside lock.
Otherwise there is a potential deadlock when an unsolicited event
arrives from vold while we're still waiting for the move operation
to be processed.

The safe fix here is to kick off the move after dropping the lock.

Bug: 29501052
Change-Id: I2160c6a7a19c1d9981c692a2be2b04019352db2e
2016-06-22 10:32:17 -06:00
Nicolas Prévot
2058553b8d Merge "Don't allow showing an activity if user is stopping or shutting down." into nyc-dev 2016-06-22 12:27:14 +00:00