20392 Commits

Author SHA1 Message Date
Dianne Hackborn
ff072725e3 Work on issue #17624121: Settings crash while launching on wiped device
Cleaner paths and better error reporting when a problem goes wrong
while binding an application.  This gets rid of the (recently added)
error about removing a process that hasn't been killed, and cleanly
kills the process along with more detailed errors about where things
failed.

Change-Id: I710a209c14da1515929e6254396b793177eee115
2014-09-24 10:56:28 -07:00
RoboErik
23b113592a Clear the volume cache for all inactive state transitions
bug:16988480
Change-Id: I0426c76681f8ec832c3f72842ee494d286050fea
2014-09-24 09:36:17 -07:00
Chet Haase
8eb48d26cc Avoid drawing the starting window twice
Logic in WindowState caused a delayed layout on the starting window,
which forced another layout/draw pass, which was unnecessary. Making
the resize call happen sooner means that that request gets lumped in
with a pending layout request, so there's only one resulting draw.

This saves not only the second drawing operation, but also the creation
of an extra buffer in SurfaceFlinger for that second draw request. This
buffer is temporary, but can be quite large on some devices and push
the system over the memory edge in extreme situations. It's difficult
to track this memory usage difference as the buffer resides at a very
low level in the system. But you can see in systrace that the second
allocation (and the second draw) is not happening after the fix.

Issue #17570761 Constrain starting window to only one buffer

Change-Id: I0e0fff7efdc812730706afccbfb020dea3f8d3e2
2014-09-24 07:31:29 -07:00
Christoph Studer
12aeda802e NoMan: Add 3s timeout in matchesCallFilter()
In Priority mode, NoMan can block the telecom Ringer
indefinitely when looking up the caller contact details via
ContactsProvider.

Fix this by introducing a 3s timeout and assume the call
matches the call filter when the timeout is hit.

Bug: 17598245
Change-Id: Ia0893cf203e6ffd943c749719ebb9e0f0958eb01
2014-09-24 14:55:32 +02:00
Robin Lee
49d810cb63 Reset keystore when user is added or removed
Because user IDs are recycled it is not safe to leave this kind of
information around after deleting.

Bug: 17403144
Change-Id: I441f85750cf8818adaf62a1acdb2ba7b4bfc1b7e
2014-09-24 11:51:52 +01:00
Zoltan Szatmary-Ban
bdc07b6986 Merge "Register ActivityManagerService.PackageMonitor for all users." into lmp-dev 2014-09-24 09:41:19 +00:00
Craig Mautner
83a76db6c5 Merge "Force layout and animation when display changes" into lmp-dev 2014-09-24 01:43:02 +00:00
Craig Mautner
9b5e824da7 Force layout and animation when display changes
Each time that window manager gets a notification that a display has
been added, removed or changed, run a pass through
performLayoutAndPlaceSurfaces. This ensures that
WindowAnimator.animate() runs once so that the surfaces of remote
displays can be updated with their visibility.

Fixes bug 17533991.

Change-Id: If8745527df86c74da75fbe26b8a2a6fddeb74d2a
2014-09-23 18:37:49 -07:00
Lorenzo Colitti
75b8966cad Merge "Only stop/start clatd if necessary." into lmp-dev 2014-09-24 01:21:17 +00:00
Lorenzo Colitti
e034716628 Merge "Block address families with routes, not NetworkAgent side channel" into lmp-dev 2014-09-24 01:21:06 +00:00
Dianne Hackborn
58817f502c Merge "Work on issue #17628623: Need to update default preferred activities for YouTube" into lmp-dev 2014-09-24 01:00:03 +00:00
Matthew Williams
8cfd9e6c11 Merge "Fix lock ordering in JobScheduler" into lmp-dev 2014-09-24 00:58:55 +00:00
Matthew Williams
48a30db75d Fix lock ordering in JobScheduler
BUG: 17625667
Two part clean-up.
1) Don't try to lock in onControllerStateChanged. Do it in the handleMessage
instead where the rest of the locking is. This is sufficient to fix this bug.
2) The other side of the deadlock came b/c we lock when cancelling and calling
stopTrackingJob. Controllers handle their own locking so this isn't
necessary. B/c of a potential race from the controller side, added an explicit
check for the JSS to only run an expired job if it still exists.

Change-Id: Iaeebbc19437eb5b73e3ced3168f1fc13e564a4be
2014-09-23 17:34:46 -07:00
Dianne Hackborn
eeb2c7e712 Work on issue #17628623: Need to update default preferred activities for YouTube
Improve the warning logs when setting up preferred activities
to help identify when there are issues and what they are.  Also
improve the algorithm a little to still apply permissions when
resetting them and there are additional third party apps, as long
as the additional app is something like another browser and the
preferred activity being set is more specific (has a better match).

And add an example of using manifest-based preferred activities
in to ActivityTest -- and yes it DOES work! :p

Change-Id: I1ff39e03a5df6526206e0c3882085396b355d814
2014-09-23 16:45:39 -07:00
Michael Wright
c93fbd1fae Specify a device identifier for keyboard layout notification.
Bug: 17614683
Change-Id: If53489b09212bfa487d7dc3a7f9b000731d949ac
2014-09-23 14:59:23 -07:00
Jeff Brown
6800e1b921 Merge "Move setting the display state out of the critical section." into lmp-dev 2014-09-23 21:02:43 +00:00
Dianne Hackborn
d0e0154c1f Merge "Maybe fix issue #17614177 APR: system process restarting due to infinite loop" into lmp-dev 2014-09-23 20:55:05 +00:00
Jeff Brown
e75926d6dc Move setting the display state out of the critical section.
Setting the display power state currently happens while holding the
display manager lock.  This change moves it out of the lock to
ensure other services don't get stuck for several hundred
milliseconds.

Unfortunately, surface flinger ends up stalled a little later
so this only solves part of the problem.

Bug: 17623774
Change-Id: I201137c5e7f82c776f28a436845fcf3191fd0ca5
2014-09-23 13:12:00 -07:00
John Spurlock
def101127a Merge "Remove redundant wifi-display notification." into lmp-dev 2014-09-23 20:08:13 +00:00
John Spurlock
03365ccc39 Remove redundant wifi-display notification.
Since all devices now appear in quick settings, remove the
framework notification and obsolete artifacts.

Bug:17607193
Change-Id: If952b826d79c77068285373c6b44a430f78c20b1
2014-09-23 15:51:11 -04:00
Dianne Hackborn
193b27cd3d Merge "Fix issue #17307700: retarget a relinquished task is not working" into lmp-dev 2014-09-23 19:50:00 +00:00
Tsuwei Chen
23e79fcef9 Merge "Better detection for SIM information readyness. 1) listen to SUBINFO broadcast intent to better capture SIM info update. 2) notify HAL about SUPL server/host everytime they get set." into lmp-dev 2014-09-23 18:54:03 +00:00
Jorim Jaggi
2fb173a34b Merge "Only wait for relevant windows when turning on the screen" into lmp-dev 2014-09-23 18:26:09 +00:00
Tsuwei Chen
678c13c02a Better detection for SIM information readyness.
1) listen to SUBINFO broadcast intent to better capture SIM info update.
2) notify HAL about SUPL server/host everytime they get set.

Bug: 17288144

Change-Id: I65cb4e0879c55c078e85d062877e491904e78222
2014-09-23 11:23:13 -07:00
Dianne Hackborn
39569afc9f Fix issue #17307700: retarget a relinquished task is not working
Missed by 1!

Change-Id: If6504e37563d1242df8da4609cbcbcd550d68fdd
2014-09-23 10:56:58 -07:00
Dianne Hackborn
25e1ecaabb Maybe fix issue #17614177 APR: system process restarting due to infinite loop
Also try to get rid of a huge wtf we are seeing across a lot of devices
where we incorrectly change real states on a service that is restarting,
and get rid of one of the noisier boot logs in the package manager.

Change-Id: I2510b6fb082eac3f6168cbd57bc3b70ad006114d
2014-09-23 10:33:30 -07:00
Jorim Jaggi
dc9ead4409 Only wait for relevant windows when turning on the screen
Bug: 17536119
Change-Id: Ibe8da9fdd52a1a46eb856425b28ffc4f505b2697
2014-09-23 18:55:46 +02:00
Jeff Brown
55fa020713 Merge "Fix window manager policy state when waking from doze." into lmp-dev 2014-09-23 16:42:52 +00:00
Jeff Brown
3ee549ca24 Fix window manager policy state when waking from doze.
Once upon a time when the world was fresh and new, the heavens
had an easy rhythm.  Day and night.  Night and day.  In the day,
the pixel fairies would cavort and play in the bright gardens
with narry a mark of shadow or gloom.  In the night, they would
rest peacefully, dreaming no dreams and knowing no fear.

Then one night a fairy dreamed the first dream.  At first
the dream was peaceful, full of colors and delight, hopes and
memories.  Then all at once, jarringly, it awoke in bright
daylight.  The pixel fairy knew fear, for the world had changed
and it was unprepared.

Time passed and the pixel fairies grew accustomed to their
fate, day and night, night and day, sometimes dreaming, until
there came a night when a fairy did not sleep.  It roamed
the land in a dreamless doze, lost and afraid amid a grim haze
of grey and darkness.  The fairy despaired.  It wanted no
part of this place.  It pretended for a time to be awake but
the bright daylight would not come.  It pretended for a time to
be dreaming but the colors and memories would not come.
That is when the fairy wished for oblivion.  Then just as
suddenly, it awoke in the daylight.  It fell to the ground,
stunned as if it had forgotten how to walk in the too bright
daylight.

Though the world again grew softer and kinder in time, the pixel
fairies were never the same.  For the night is dark and full
of terrors.

---

It used to be easy.  Screen on and screen off could explain almost
everything about the state of the device but it's different now with
ambient display.  We need to be able to wait for all windows to be
drawn even in the case where the device is still nominally asleep.
In truth, the window manager policy which drives a lot of these
interactions is a thicket of outdated assumptions.

Added a new method to tell the window manager policy when the screen
is being turned off so that it can correctly account for changes
to the interactive state (wakeUp and goingToSleep) and screen state
(screenTurningOn and screenTurnedOff).  Now we can independently
poke keyguard during interactive state changes and we can apply
screen on blocking during screen state changes.

Moved the code which manages screen on blocking (which is what
ensures the UI has fully drawn before revealing screen contents)
from the power manager to the display manager since the display
manager is in a better position to accurately track the state of
the screen, particularly when the screen is being turned off.

Fixed a bunch of synchronization issues.  Previously some work
had been moved to a handler without considering what might
happen if it became reordered relative to other work happening
elsewhere.  Documented the desired behavior in the code to
prevent this from happening again.

There's still a bunch of stuff in here that isn't quite right,
particularly the assumption that there's only one screen, but
it's good enough for now.  Hopefully there aren't too many bugs.

Bug: 17605802
Change-Id: Ic7319e09948c8a3cda014d7e169c964a3ad86f14
2014-09-23 09:38:05 -07:00
Zoltan Szatmary-Ban
0bec95d052 Register ActivityManagerService.PackageMonitor for all users.
With the introduction of managed profiles, ActivityManagerService.PackageMonitor
can receive Intents from users other than current one.

Bug: 17580914, 17314317
Change-Id: I7c601618f7819d6775cf422dca70a929ee1089d9
2014-09-23 17:27:17 +01:00
Lorenzo Colitti
1df5fa55c5 Only stop/start clatd if necessary.
Previously we would restart clatd on every LinkProperties
change, which now happens every time we switch radio technology
(e.g., LTE to HSPA). We also would not stop it if the link got
an IPv4 address.

Bug: 15024258
Bug: 17186694
Bug: 17569702
Change-Id: I65cfcd5e7acec8ea1a12392a59dabd668c58490f
2014-09-24 00:03:23 +09:00
Paul Jensen
74971c75dc Merge "Remove needless locking of mRulesLock that caused deadlocks." into lmp-dev 2014-09-23 12:00:35 +00:00
Lorenzo Colitti
60446165d8 Block address families with routes, not NetworkAgent side channel
Now that we support unreachable routes, use those to block
address families on VPNs. This is a much more elegant solution.
Also update LinkProperties when IP addresses are added and
removed, fixing a TODO.

Bug: 17462989
Change-Id: Ib749d84710dca70d672350b9f129bb91419ec77e
2014-09-23 10:48:28 +09:00
Lorenzo Colitti
1e2b63d91d Merge changes I3ebf0cec,I8635472c into lmp-dev
* changes:
  Add a throw route to the VPN endpoint.
  Support non-unicast route types: unreachable and throw.
2014-09-23 01:46:48 +00:00
Amith Yamasani
fee7ad1619 Merge "Fix regression in launching CantAddAccountActivity for correct user" into lmp-dev 2014-09-23 01:09:11 +00:00
Dianne Hackborn
c7437dd7c0 Merge "I am such an idiot." into lmp-dev 2014-09-23 00:57:28 +00:00
Dianne Hackborn
4a1ef0b171 I am such an idiot.
Seriously, don't look at this.  It is so dumb.

Brought up by issue #17307700: retarget a relinquished
task is not working

Change-Id: I947438d3502f75510e2974211bb78d31008eaa90
2014-09-22 17:39:07 -07:00
xinhe
abbc202431 Merge "Fix for empty RSSI triangle after boot" into lmp-dev 2014-09-23 00:13:22 +00:00
Adam Lesinski
2e51cc6842 Merge "Revert behavior of Lockscreen Activity Launch to KK" into lmp-dev 2014-09-22 23:17:47 +00:00
Adam Lesinski
246a8bcadd Revert behavior of Lockscreen Activity Launch to KK
There exists a lifecycle regression where launching an
app from the lockscreen (camera, etc.) causes a series
of onResume, onPause, onRestart, onStart, onResume.

This CL reverts the behavior to what it was in KK, which
is to say that the Launcher is first resumed/paused, then
the Activity being launched has a simple onRestart,onStart, onResume
lifecycle.

Bug:17459745
Change-Id: I04091d2f86a929ee972c8d6debc1beb033c135a8
2014-09-22 16:04:32 -07:00
Dianne Hackborn
5d47a09352 Merge "Fix issue #17609716: Frequent crash in system_server (RT restarts)" into lmp-dev 2014-09-22 22:46:54 +00:00
Svetoslav
ab4fbefe66 Merge "Fix a bug in parsing app widget state XML." into lmp-dev 2014-09-22 21:39:49 +00:00
John Spurlock
e35c9bf9ba Merge "Zen: Add events as a new config attribute." into lmp-dev 2014-09-22 21:09:39 +00:00
John Spurlock
2dac62c2e9 Zen: Add events as a new config attribute.
Decouple events from alarms in the zen interception function,
and default the new allowEvents to true.

Bug:17580878
Change-Id: Iff10df385206ad73c3423ff118c79e94a10918d9
2014-09-22 16:44:37 -04:00
Dianne Hackborn
19c3b5d0d9 Merge "Work on issue #17581375: Nexus 5 getting low on RAM" into lmp-dev 2014-09-22 20:40:17 +00:00
Dianne Hackborn
c2f6f947b6 Fix issue #17609716: Frequent crash in system_server (RT restarts)
There was some code here locking on the lock object instead of
the main activity manager lock...!!!

Change-Id: Ic85151fbef915f6fb8fd5ce3c1a7e9b810412cb6
2014-09-22 13:36:42 -07:00
Michael Wright
3119b82c43 Merge "Monitor MediaRouter for remote display connections." into lmp-dev 2014-09-22 20:04:30 +00:00
Dianne Hackborn
d412563922 Work on issue #17581375: Nexus 5 getting low on RAM
Try to catch any cases where we remove a ProcessRecord from the LRU
list when it may still have a process associated with it, report
that this happened, and try to make sure the process is killed.

Change-Id: Icd74439caba5e1c283c01a49a46dae926a00ba71
2014-09-22 12:52:49 -07:00
Amith Yamasani
ae7034aaf0 Fix regression in launching CantAddAccountActivity for correct user
This activity should be launched for the user calling addAccount()

Bug: 17608124
Change-Id: I5d7e47bc625442494dc322ccafdc25f5f5c6aa7b
2014-09-22 12:46:50 -07:00
Svetoslav
c616b3e2f1 Fix a bug in parsing app widget state XML.
When restoring app widget state from XML we read all providers,
hosts, and widgets and only after reading all hosts and providers
for all members of the group we hookup the widgets as they may
cross profile boundary. To esntablish the host-widget and provider-
widget relation we use a tag for the host and the provider that
are assigned before saving the state to XML. When restoring we
are using the tags to match widgets with hosts and providers. The
bug was that we were not clearing the tag of all hosts and providers
before reading from XML as we want the only tags that are defined
to be the ones we are reading. This resulted in wrong app widget
restore for a secondary user.

bug:17505027

Change-Id: I035d8f13142c6b9dbc9d658b82390f9cd8d75e0d
2014-09-22 12:31:04 -07:00