11121 Commits

Author SHA1 Message Date
John Spurlock
33669f35e4 Merge "Kill dreams that do not create a timely service connection." into jb-mr1.1-dev 2012-12-04 13:45:50 -08:00
John Spurlock
006f567c21 Kill dreams that do not create a timely service connection.
Implement a timeout between when the dream binds and
when the dream creates the service connection.  If
the connection is not created within a certain amount of
time, stop the dream.

This fixes the current bug where a dream that crashes in
onCreate (or the ctor) can put the dream controller in a
bad state until the screen is turned off.

The timeout is equal to the service restart delay in
activity manager (ActiveServices) to avoid restarting
(and recrashing).

Bug:7596707
Change-Id: I3e11efc6af0b79ec4cb0fbc94e4e109c7602ddac
2012-12-04 15:10:04 -05:00
Matthew Xie
af5ddbfcf5 Change getName and getAddress permission to BLUETOOTH
The permissions were set as BLUETOOTH_ADMIN by mistake. Correct them
bug 7665249

Change-Id: Ic1bdbeb25e8f55d886f9a8d38920cbb769dd38ca
2012-12-04 10:47:43 -08:00
Dianne Hackborn
e0a676a3bb Merge "Fix issue #7649590: Background windows sometimes not being hidden for secondary users" into jb-mr1.1-dev 2012-12-03 15:51:47 -08:00
Dianne Hackborn
bb4ca5271a Fix issue #7649590: Background windows sometimes not being hidden for secondary users
There are two things going on here:

(1) In secondary users, some times theme information such as whether
the window is full screen opaque was not being retrieved, so the window
manager didn't know that it could hide the windows behind the app.
This would just be a performance problem, except that:

(2) There appear to be a number of applications that declare that they
are full screen opaque, when in fact they are not.  Instead they are
using window surfaces with an alpha channel, and setting some pixels
in their window to a non-opaque alpha level.  This will allow you to
see whatever is behind the app.  If the system happens to completely
remove the windows behind the app, and somebody is filling the frame
buffer with black, then you will see what the app intends -- those
parts of its UI blended with black.  If one of those cases doesn't
hold (and though we have never guaranteed they would, in practice this
is generally what happens), then you will see something else.

At any rate, if nothing else than for performance reasons, we need to
fix issue #1.

It turns out what is happening here is that the AttributeCache used
by the activity manager and window manager to retreive theme and other
information about applications has not yet been updated for multi-user.

One of the things we retrieve from this is the theme information telling
the window manager whether an application's window should be treated
as full screen opaque, allowing it to hide any windows behind it.  In
the current implementation, the AttributeCache always retrieves this
information about the application as the primary user (user 0).

So, if you have an application that is installed on a secondary user but
not installed on the primary user, when the AttributeCache tries to retrieve
the requested information for it, then from the perspective of the primary user
it considers the application not installed, and is not able to retrieve that
info.

The change here makes AttributeCache multi-user aware, keeping all of its
data separately per-user, and requiring that callers now provide the user
they want to retrieve information for.  Activity manager and window manager
are updated to be able to pass in the user when needed.  This required some
fiddling of the window manager to have that information available -- in
particular it needs to be associated with the AppWindowToken.

Change-Id: I4b50b4b3a41bab9d4689e61f3584778e451343c8
2012-12-03 14:09:06 -08:00
Zhihai Xu
40973c53ac Merge "BT is still on after enable flight mode, and reboot the DUT" into jb-mr1.1-dev 2012-12-03 11:47:34 -08:00
Zhihai Xu
401202b5fe BT is still on after enable flight mode, and reboot the DUT
bug 7275625
Change-Id: I4f8952a06152eb5f5775c1f616f6383e4f20e352
2012-12-03 11:36:21 -08:00
Jeff Sharkey
ed3fba6538 Merge "Avoid null mobile interfaces." into jb-mr1.1-dev 2012-12-03 11:32:51 -08:00
Jeff Sharkey
6a328afbab Avoid null mobile interfaces.
Bug: 7634215
Change-Id: I6745f6a78c07ba11d98b4562a6b53386112ef652
2012-11-30 17:49:39 -08:00
Amith Yamasani
c566b43d02 Fix crosstalk between users for widgets hosted in lockscreen
This was initially about the Clock widget crashing repeatedly on some
devices with multiple users. Turned out that there were race conditions
when switching users that could result in remote views of one user calling
back to the RemoteViewsAdapter in keyguard that in turn sent an incorrect widget id
to a different user's widget, resulting in a crash.

Since KeyguardHostView is instantiated in the same process for different users,
it needs to carry a user identity to pass along to AppWidgetService so that
remote views services were bound to the correct user and callbacks were attached and
detached properly.

Added some aidl calls that take the userId to do the binding properly. A more
complete fix might be needed in the future so that all calls from Keyguard carry
the user id.

Also, there was a problem in comparing host uid for secondary users, since Settings
for a secondary user has a different uid than keyguard. Not an issue on single-user
systems. Changed the host.uid comparison to accomodate for the secondary user.

Bug: 7450247
Change-Id: Idbc36e3c60023cac74174f6cb7f2b2130dd3052c
2012-11-30 17:28:08 -08:00
Craig Mautner
7b1aa77a9b Include child windows when looking for insertion point.
After finding a window in the window list we turn around and look in
the AppWindowToken.windows list for it. If it is a child of a window
in that list we should use the parent windows index as the search
result. Instead we gave up and ended up inserting the window at the
beginning of the windows list.

Bug 7357465 fixed.

Change-Id: If77f343b8597bfbb0b7fa41dedf7972d78d03020
2012-11-30 16:14:45 -08:00
Martijn Coenen
b1a01ab01c Merge "Allow the NFC process to call Bluetooth APIs." into jb-mr1.1-dev 2012-11-30 11:08:07 -08:00
Dianne Hackborn
675814d488 Merge "Maybe fix issue #7596986: Frequent runtime restarts; IAE at..." into jb-mr1.1-dev 2012-11-30 10:42:15 -08:00
Dianne Hackborn
aae329ef0f Merge "Don't apply transformation fudge when not rotating." into jb-mr1.1-dev 2012-11-29 17:53:47 -08:00
Dianne Hackborn
4b16969b00 Don't apply transformation fudge when not rotating.
There is this stupid fudge factor applied to window transformations
when doing a screen rotation animation.  We need this when rotating,
but when not rotating it causes very visible artifacts.  Historically
the non-rotation case only happened due to configuration changes, so
wasn't that big a deal.  Now however that we use this when switching
users, it is more annoying.  So get rid of it for such cases.

Change-Id: I6b343866c1bad9b16984b4a629917c2f1bb37b9e
2012-11-29 17:51:24 -08:00
Dianne Hackborn
ebec231535 Merge "Always report user switched after unfreezing screen." into jb-mr1.1-dev 2012-11-29 16:38:23 -08:00
Dianne Hackborn
6c5406acd7 Maybe fix issue #7596986: Frequent runtime restarts; IAE at...
...android.os.Parcel.nativeAppendFrom(Native Method)

The failing stack trace is:

11-20 20:29:04.365 19154 19170 E AndroidRuntime: java.lang.IllegalArgumentException
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.nativeAppendFrom(Native Method)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.appendFrom(Parcel.java:428)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Bundle.writeToParcel(Bundle.java:1613)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.writeBundle(Parcel.java:605)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.location.Location.writeToParcel(Location.java:903)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.writeParcelable(Parcel.java:1254)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.writeValue(Parcel.java:1173)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.writeMapInternal(Parcel.java:591)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Bundle.writeToParcel(Bundle.java:1619)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.writeBundle(Parcel.java:605)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.location.Location.writeToParcel(Location.java:903)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.writeParcelable(Parcel.java:1254)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.writeValue(Parcel.java:1173)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.writeMapInternal(Parcel.java:591)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Bundle.writeToParcel(Bundle.java:1619)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.os.Parcel.writeBundle(Parcel.java:605)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.content.Intent.writeToParcel(Intent.java:6660)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at android.app.ApplicationThreadProxy.scheduleReceiver(ApplicationThreadNative.java:763)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at com.android.server.am.BroadcastQueue.processCurBroadcastLocked(BroadcastQueue.java:230)
11-20 20:29:04.365 19154 19170 E AndroidRuntime:        at com.android.server.am.BroadcastQueue.processNextBroadcast(BroadcastQueue.java:777)

This is odd because where we do Bundle.writeToParcel(), we are just writing the Parcel
we have with its current length.  There is no way this should be able to fail like this...
unless the Bundle is changed while we are running?

Hm.

It looks like the location manager is holding on to Location objects which have a
Bundle of extras.  It is that Bundle of extras that the crash is happening on.
And the bundle extras can be changed as it operates.  And there are places where
the raw Location object is returned from the location manager, which means the
caller can be olding on to a Location object whose extras can be changed at any
time by other threads in the location manager.

So that seem suspicious.

This change should take care of all these places in the location manager, by
making sure to copy the location object before it goes out of the location
manager.

In addition, add some code to the activity manager to not bring down the entire
system if there is a problem trying to send one of these broadcasts.  There is
no need, we can just skip the broadcast as bad.

Change-Id: I3043c1e06f9d2931a367f831b6a970d71b0d0621
2012-11-29 16:33:54 -08:00
Zhihai Xu
e1a867f68d Merge " BluetoothManagerService call should allow SYSTEM_UID" into jb-mr1.1-dev 2012-11-29 16:03:49 -08:00
Zhihai Xu
6eb7652b04 BluetoothManagerService call should allow SYSTEM_UID
bug 7561429

Change-Id: I1483bfe1361f71c7ae3529ea496b33504b95413e
2012-11-29 15:41:04 -08:00
Dianne Hackborn
4d78abfca7 Always report user switched after unfreezing screen.
Change-Id: I58172896892a07e72a3430e56e4d2944d388c7c9
2012-11-29 15:10:18 -08:00
Colin Cross
05db19bc55 Merge "trigger kernel blocked stack trace on system server watchdog" into jb-mr1.1-dev 2012-11-29 12:47:54 -08:00
Colin Cross
5df1d871fe trigger kernel blocked stack trace on system server watchdog
Bug b/7638530 may be caused by a kernel deadlock when killing
processes under low memory conditions.  Write to /proc/sysrq-trigger
to get a kernel log of blocked tasks before killing the system server.

Bug: 7638530
Change-Id: I60df324ad4affdadbf13650099dc4dfb38722420
2012-11-29 12:44:09 -08:00
John Spurlock
143d73dab5 Merge "Fix multiuser bug in StatusBarManagerService." into jb-mr1.1-dev 2012-11-29 11:45:57 -08:00
John Spurlock
8f3e6d5c83 Fix multiuser bug in StatusBarManagerService.
First, do no harm.

Bug:7638210
Change-Id: I113b574a021d601b0c79d65a3b4b72eeb4c667ad
2012-11-29 14:18:35 -05:00
Martijn Coenen
8385c5afbd Allow the NFC process to call Bluetooth APIs.
The NFC process used to be only running as user 0,
and it may be calling into Bluetooth. Most of the
handover code has now moved to a separate process
running as the current user.

Fix the existing checks to take into account the
correct NFC UID, whatever user it is running as.

Bug: 7309141
Change-Id: I953cfb263a28aef7fe1be5880b053425dc359a29
2012-11-29 10:17:47 -08:00
Craig Mautner
24d966a3b6 Merge "Fix math errors causing black screen. DO NOT MERGE" into jb-mr1.1-dev 2012-11-29 09:57:15 -08:00
Craig Mautner
9dd9e0c99d Fix math errors causing black screen. DO NOT MERGE
Turning off animations in the Developer options creates a ValueAnimator
duration scale of 0. This is used as the denominator in RampAnimator
which, if the numerator is also 0, sets mAnimatedValue to NaN. Rounding
NaN to the nearest int produces 0 which is then assigned to
mScreenBrightness in DisplayPowerState.

A copy mistake which assigned mTransitionAnimationScale as the default
value for mAnimatorDurationScale in WindowManagerService is also
fixed here.

Bug 7515609 fixed.

Change-Id: I39f8d0a7abdd5a1fe70d757fe95fbddaf7a0ed51
2012-11-29 00:11:50 -08:00
Dianne Hackborn
2c41c4a276 Fix build.
Change-Id: Icc1f2913b4e889609066b0ff1dddcd9be0230897
2012-11-28 18:46:45 -08:00
Dianne Hackborn
860d0cd452 Merge "Cleaner initial boot." into jb-mr1.1-dev 2012-11-28 18:19:25 -08:00
Dianne Hackborn
13579ed330 Cleaner initial boot.
This does some cleanup of the initial boot, especially when
booting in "no core apps" mode for encryption/decryption.

Change-Id: Ifb3949f580e52f54559e603c4b0b104f6bac2f6c
2012-11-28 18:09:01 -08:00
Adam Cohen
035352b4d6 Merge "Making sure keyguard and homescreen only display eligible widgets (issue 7550090)" into jb-mr1.1-dev 2012-11-28 17:47:22 -08:00
Adam Cohen
d9e5af3851 Making sure keyguard and homescreen only display eligible widgets (issue 7550090)
Change-Id: I25acb7bde2e8e5ac3185a009f5c7151b81f0ae19
2012-11-28 16:36:56 -08:00
Irfan Sheriff
b4d5a9e73b Merge "WFD: Fallback to PIN mode if PBC is not supported" into jb-mr1.1-dev 2012-11-28 16:28:41 -08:00
Irfan Sheriff
6681be2787 WFD: Fallback to PIN mode if PBC is not supported
Bug: 7627641
Change-Id: Ibba6114f907c67f1cb60c460d5b65479f2d1b148
2012-11-28 15:54:06 -08:00
Dianne Hackborn
68e0da7e39 Merge "Quiet down a lot of logging." into jb-mr1.1-dev 2012-11-28 15:03:39 -08:00
Zhihai Xu
e3f7c45241 Merge "Settings shows it is connected to A2DP, though the device is not actually connected" into jb-mr1.1-dev 2012-11-28 12:19:42 -08:00
Zhihai Xu
5c0f3e5075 Merge "Cannot enable Bluetooth after using airplane and Bluetooth tethering sequentially" into jb-mr1.1-dev 2012-11-28 11:22:21 -08:00
Dianne Hackborn
40e9f2922c Quiet down a lot of logging.
Also fix a little problem where the USER_STARTED broadcasts
were not being sent as ordered broadcasts(!).

Change-Id: I3aa3e0a9b3900967cdd2d115ee103371b0a50c41
2012-11-27 19:12:23 -08:00
Craig Mautner
9e98927e2d Merge "Retain configuration change info and sync access." into jb-mr1.1-dev 2012-11-27 16:17:45 -08:00
Amith Yamasani
f426ace9da Merge "Only wipe device if primary user (for failed password attempts)" into jb-mr1.1-dev 2012-11-27 15:37:40 -08:00
Craig Mautner
e855214249 Retain configuration change info and sync access.
- If a window was hidden while the configuration changed and then
changed back WindowManagerService would not know that the change
had ever happened and wouldn't notify the window of this. Most
windows wouldn't care but because Keyguard inflates layouts while
it is hidden...

Bug 7094175 fixed?
Bug 7501099 fixed!

Change-Id: If27f5f1d333602dac7719dd39dbdf3fe7954aa06
2012-11-27 12:47:27 -08:00
Dianne Hackborn
ba4ac51823 Merge "Improve debugging for issue #7586414: AlarmManager wakelocks held" into jb-mr1.1-dev 2012-11-27 11:06:35 -08:00
Dianne Hackborn
8103890a59 Improve debugging for issue #7586414: AlarmManager wakelocks held
In alarm manager, print a summary of the top 10 alarms by time
being executed.  Keep track of execution time (and wake count) of
each type of alarm for each application so this can be printed in
the summary (and used to compute the top 10 alarms).  Rework how
the alarm summary stats are tracked so that we don't need to hold
on to the full Intent for each stat and can get the Intent information
at the time the alarm is sent rather than waiting for whatever Intent
comes back in the result.

Also in the battery stats: sort the kernel wake locks by time, add
a new section showing all partial wake locks across all applications
sorted by time.

Finally a new LocalLog class that is used by AlarmManager to log
important warning messages, so these can also be later found in
its dumpsys output.

Change-Id: Icc07810053e60fb623a49937e696819cb8352b06
2012-11-27 11:05:42 -08:00
Satoshi Kataoka
1af0841137 Merge "Hide current soft input when a background user gains window focus." into jb-mr1.1-dev 2012-11-26 19:39:20 -08:00
Amith Yamasani
7be52cbc33 Merge "Logging to help find the cause of widget crash in clock widget." into jb-mr1.1-dev 2012-11-26 16:22:41 -08:00
Amith Yamasani
791f877473 Logging to help find the cause of widget crash in clock widget.
This will continue to crash as before, but will show some useful
information in the exception.

Bug: 7450247

Change-Id: Ib3160a5f64154517791d165973c12294ecd09901
2012-11-26 15:22:31 -08:00
Winson Chung
f7614fc744 Removing unecessary additional lock metadata from QuickSettings user tile.
Change-Id: I89ec94385eb3cdd46ad6942bf8989fb04d5c0370
2012-11-26 14:44:03 -08:00
Craig Mautner
7f2a989675 Merge "Ignore invalid combination of PowerManager flags." into jb-mr1.1-dev 2012-11-26 11:34:40 -08:00
Craig Mautner
6edb6db512 Ignore invalid combination of PowerManager flags.
ACQUIRE_CAUSES_WAKEUP is supposed to be ignored if combined with
PARTIAL_WAKE_LOCK. Instead it was being carried out for any values
of the WakeLock level.

This change reverts behavior to closely match
previous releases of the framework by only honoring
ACQUIRE_CAUSES_WAKEUP for screen wake lock levels. The only
difference being that in previous releases ACQUIRE_ could have been
combined with PROXIMITY_SCREEN_OFF_WAKE_LOCK (it never was) and
now such a combination will ignore the ACQUIRE_ flag.

Bug 7532258 fixed.

Change-Id: I46e848d8fd1b57e54c63141bf3d4f353986b5bdf
2012-11-21 13:19:39 -08:00
John Spurlock
3f64edec6c Merge "Fix IME down caret in keyguard nav bar bug." into jb-mr1.1-dev 2012-11-21 06:44:00 -08:00