15438 Commits

Author SHA1 Message Date
Will Haldean Brown
866b25425e Maintain binding to crashed listeners from NotificationManagerService.
This fixes the logic on the death handlers for notification listeners,
and doesn't unbind from the listener services so that the system will
bring them back up again.

Bug: 12587702
Change-Id: I44ce250e0e1c2583836dc823d9a333dabec51df9
2014-02-28 11:26:47 -08:00
Craig Mautner
dd9ce6287e Merge "Clean up activities and displays when done" into klp-modular-dev 2014-02-25 18:46:01 +00:00
Craig Mautner
95da1087ed Clean up activities and displays when done
More maintenance fixes.

Fix bug 13157352.

Change-Id: Ic86d39a84452a1cf1dc1762cec517b419ad0a852
2014-02-25 10:40:18 -08:00
Mike Lockwood
0fc59cd958 am da2bbaf2: am 2c7b913e: am 5daec5b5: Merge "UsbDeviceManager: Fix race condition entering USB accessory mode" into klp-dev
* commit 'da2bbaf219117f7507c5c0015c41347a9cc27507':
  UsbDeviceManager: Fix race condition entering USB accessory mode
2014-02-25 15:44:24 +00:00
Mike Lockwood
da2bbaf219 am 2c7b913e: am 5daec5b5: Merge "UsbDeviceManager: Fix race condition entering USB accessory mode" into klp-dev
* commit '2c7b913e367670dde337893efd59029c054019fc':
  UsbDeviceManager: Fix race condition entering USB accessory mode
2014-02-25 15:41:11 +00:00
Jeff Brown
2326acb591 Merge "Fix typo that causes dreaming on battery." into klp-modular-dev 2014-02-25 00:27:41 +00:00
Jeff Brown
966604f159 Fix typo that causes dreaming on battery.
Bug: 13173012
Change-Id: I611970a5b4c4b0072ce52e3fc6a57dd3a0c075b3
2014-02-24 16:19:51 -08:00
Jeff Brown
f7f80d7b54 Merge "Start the dream manager even if dreams are not supported." into klp-modular-dev 2014-02-24 22:16:00 +00:00
Jeff Brown
e0dd3ca81d Start the dream manager even if dreams are not supported.
The dreams manager also manages dozing.  It has a minimal footprint
so there is no real reason to disable the component (it just makes
debugging more difficult).

Improved the documentation of the config_dreamsSupported resource
to clarify exactly what it controls.

Bug: 12494706
Change-Id: I78244846f7c1ddfd11bc1605af59b0db91337971
2014-02-24 14:07:27 -08:00
Craig Mautner
ffda464851 Merge "Fixes for ActivityView on home activity" into klp-modular-dev 2014-02-22 05:11:22 +00:00
Craig Mautner
12ff7391a1 Fixes for ActivityView on home activity
When the ActivityView is part of the home activity special checks
must be made. Things like don't move the home stack to the back
when the ActivityView activity is resumed.

Fixes bug 13119389.

Change-Id: I3a6040c9824dfd4b8ee97d58d131b14a519b470a
2014-02-21 21:08:00 -08:00
Craig Mautner
f0f454522a Merge "Reset deferred task removal when app token added." into klp-modular-dev 2014-02-22 00:50:55 +00:00
Craig Mautner
42bf39edbd Reset deferred task removal when app token added.
A task is scheduled for deletion after the final activity has
been removed and has animated away. But if another activity is then
added to the task the deletion flag must be reset.

Also added improved debugging.

Fixes bug 12987986.

Change-Id: I207ea6e9592a9e036d67aa5d1465b4acc5bdd120
2014-02-21 16:46:22 -08:00
Adam Lesinski
83930aa09a Merge "Fix broken IME when decrypting storage" into klp-modular-dev 2014-02-21 22:13:44 +00:00
Adam Lesinski
8793dd873d Fix broken IME when decrypting storage
Bug:13113499
Change-Id: Icf767864c8ff694fd569b9237ae1004cc20204a2
2014-02-21 14:06:47 -08:00
Craig Mautner
c2c0a61cf5 Add copyright notice to files missing them.
Fixes bug 13121968.

Change-Id: Ifd86581178e7e98bd72b832020e7c8379d40b2de
2014-02-20 20:25:41 -08:00
Craig Mautner
fd8a8ccbb7 Merge "Set the new SurfaceControl opaque flag." into klp-modular-dev 2014-02-20 22:36:52 +00:00
Craig Mautner
267b37ceff Merge "Resize DimLayer explicitly on rotation." into klp-modular-dev 2014-02-20 22:34:38 +00:00
Craig Mautner
902945d151 Resize DimLayer explicitly on rotation.
Using the alpha value to trigger a resizing of the DimLayer was a
Bad Idea. The alpha value should reflect the true alpha value and
not be used to trick the code. Actually changing the size and
position is a Better Idea.

Fixes bug 13101776.

Change-Id: I11c16b8276919ea85960fe87bb17c0956ce8a3b1
2014-02-20 14:31:32 -08:00
Jeff Brown
2687550272 Add a new "doze mode" based on Dream components.
When a doze component has been specified in a config.xml resource
overlay, the power manager will try to start a preconfigured dream
whenever it would have otherwise gone to sleep and turned the
screen off.  The dream should render whatever it intends to show
then call startDozing() to tell the power manager to put the display
into a low power "doze" state and allow the application processor
to be suspended.  The dream may wake up periodically using the
alarm manager or other features to update the contents of the display.

Added several new config.xml resources related to dreams and dozing.
In particular for dozing there are two new resources that pertain to
decoupling auto-suspend mode and interactive mode from the display
state.  This is a requirement to enable the application processor
and other components to be suspended while dozing.  Most devices
do not support these features today.

Consolidated the power manager's NAPPING and DREAMING states into one
to simplify the logic.  The NAPPING state was mostly superfluous
and simply indicated that the power manager should attempt to start
a new dream.  This state is now tracked in the mSandmanSummoned field.

Added a new DOZING state which is analoguous to DREAMING.  The normal
state transition is now: AWAKE -> DREAMING -> DOZING -> ASLEEP.
The PowerManager.goToSleep() method now enters the DOZING state instead
of immediately going to sleep.

While in the doze state, the screen remains on.  However, we actually
tell the rest of the system that the screen is off.  This is somewhat
unfortunate but much of the system makes inappropriate assumptions
about what it means for the screen to be on or off.  In particular,
screen on is usually taken to indicate an interactive state where
the user is present but that's not at all true for dozing (and is
only sometimes true while dreaming).  We will probably need to add
some more precise externally visible states at some point.

The DozeHardware interface encapsulates a generic microcontroller
interface to allow a doze dream for off-loading rendering or other
functions while dozing.  If the device possesses an MCU HAL for dozing
then it is exposed to the DreamService here.

Removed a number of catch blocks in DreamService that caught Throwable
and attempted to cause the dream to finish itself.  We actually just
want to let the process crash.  Cleanup will happen automatically if
needed.  Catching these exceptions results in mysterious undefined
behavior and broken dreams.

Bug: 12494706
Change-Id: Ie78336b37dde7250d1ce65b3d367879e3bfb2b8b
2014-02-20 13:39:13 -08:00
Adam Lesinski
4b07b26e86 Merge "Make UsbService optional" into klp-modular-dev 2014-02-19 19:38:34 +00:00
Mike Lockwood
c62f918e0e UsbDeviceManager: Fix race condition entering USB accessory mode
When switching USB modes there are often spurious connect and disconnect events
that occur before reenumeration is complete.  There is currently a 1000ms timer
to "debounce" the disconnect events. But with some USB accessories, this timeout
is not long enough, which results in an endless cycle of attempts to enter
USB accessory mode when the phone is connected.

To fix this, we now wait up to 10 seconds for the host to successfully configure
the device when entering USB accessory mode before giving up.
This is separate from the existing debounce timer, so the behavior of the
USB state change broadcasts are not affected.

Bug: 12877769
Change-Id: I7aa61f8a618546d749a7ddfc97bf103029a73d03
2014-02-19 11:23:19 -08:00
Craig Mautner
71dd1b6343 Set the new SurfaceControl opaque flag.
Converts surfaces from transparent to opaque and opaque to transparent
without creating a new surface. Uses the new SurfaceControl.setOpaque
method.

Fixes bug 12387406.

Change-Id: I669c064e622e211b00b1585183a488d5b3f4b778
2014-02-18 15:59:23 -08:00
Adam Lesinski
f5b3a01e54 Add fastpath for single signature comparison
PackageManager does not need to create a hash set
when comparing two sets of signatures, where each set
contains one signature. This is the common case for
most applications.

Bug:13029313
Change-Id: I61883d85960db7b376e234d7abae6149c4d20245
2014-02-18 15:31:41 -08:00
Adam Lesinski
2cb6c60c0d Make UsbService optional
Tweaked the services Android.mk to build dependencies
when building with mm[m].

Change-Id: I6dad511c652bcacc085f27ede5f8f22a6982c6bd
2014-02-18 14:57:09 -08:00
Adam Lesinski
3d9bcb90ee Create FEATURE_ constants for print and backup
Bug:13079822

Change-Id: I6f4b759951d45989e8aad4011fae431ee2ecae0c
2014-02-18 14:33:00 -08:00
Jeff Brown
567f7ca424 Refactor dream manager to new pattern.
Change-Id: I99ab4bd98d56a290368dc4b24e5bb24e0656b522
2014-02-13 23:26:59 -08:00
Craig Mautner
474f1fbe8d Merge "Don't null class member before using it." into klp-modular-dev 2014-02-13 19:14:17 +00:00
Craig Mautner
991146f8ef Don't null class member before using it.
Changing the order of detachStack() and usage of mDisplayContent
fixes NPE.

Fixes bug 12823709.

Change-Id: I04760b1d6fd5d3ffc49b99ca4acb47bf7e61cb46
2014-02-13 11:12:42 -08:00
Craig Mautner
0af894d251 Merge "Update DimLayer sizes on rotation." into klp-modular-dev 2014-02-13 19:02:02 +00:00
Craig Mautner
b660b9d8cf Update DimLayer sizes on rotation.
Required replumbing and updating the TaskStack bounds calculations
to match the new separation of TaskStack from DisplayContent.

Fixes bug 12780687.

Change-Id: I061c92831c06f4eb3e673ad6296e721b0c0f3202
2014-02-13 10:59:16 -08:00
Craig Mautner
4b79f8380c Merge "Add debug for 12987986." into klp-modular-dev 2014-02-12 23:44:56 +00:00
Craig Mautner
1646832219 Add debug for 12987986.
For bug 12987986.

Change-Id: Idc122ba369ad7566e3fee290955bf91b0f610ae1
2014-02-12 15:43:40 -08:00
Craig Mautner
731c30c17d Merge "Don't add windows from exiting app tokens twice." into klp-modular-dev 2014-02-12 20:56:36 +00:00
Craig Mautner
ac90c19cab Don't add windows from exiting app tokens twice.
If an apptoken's removal has been delayed then it will be in both
mExitingAppTokens and the stack's tasks. When rebuilding the windows
the windows from that apptoken will get added twice. This change
skips adding those windows from apptokens that have already been
added from mExitingAppTokens.

Change-Id: I55f94b7dbef36aeacb390b91fbe82426eaac5458
2014-02-12 12:37:17 -08:00
John Spurlock
c4aee98a62 Improve error handling in listener services.
Check explicitly for null listeners in NMS, throwing
IllegalArgumentException (on the small list of exceptions
that survive RPC boundaries) with a message.

Normally this situation is caused by listeners that attempt to
perform NM-related actions before they are bound.  Check for
this case in the base NLS class and avoid the call to NM if we
know it will fail.

Although it's tempting to throw an IllegalStateException on the
client side, preserve the existing semantics for backwards-compatibility
purposes.  That is, silently fail (or return null) - and provide a
log warning.

Bug:12805707
Change-Id: I0d92fd0d460a8592e8a23fd8fd718ae2ba3bd4c7
2014-02-12 14:31:36 -05:00
Jeff Brown
38f96e5020 Add support for injecting events into ActivityContainers. (DO NOT MERGE)
Modified ActivityView to inject touch events it receives back into
its activity container.  The container then injects the event into
the input system along with the display id of the underlying virtual
display.

Enhanced the input system to support concurrent dispatch of touch
events on multiple displays which is required for this to work.

Change-Id: I9cf1870db3be6f99a52ed9a1e3ceafe42c940093
2014-02-11 14:43:04 -08:00
Jeff Brown
1b51c9cb96 Merge "Make SystemService constructor take a Context." into klp-modular-dev 2014-02-11 04:12:02 +00:00
Jeff Brown
b880d880c6 Make SystemService constructor take a Context.
This change simplifies the process of initializing a SystemService
by folding the onCreate() step back into the constructor.  It removes
some ambuiguity about what work should happen in the constructor and
should make it possible for services to retain most of their final
fields after refactoring into the new pattern.

Change-Id: I25f41af0321bc01898658ab44b369f9c5d16800b
2014-02-10 20:01:43 -08:00
Craig Mautner
312ba86b47 Change task removal sequence
- Remove task after removing activity. Removing the task before
removing the activity led to problems when the task was still needed.

- In WindowManager wait for activity manager to remove the task.
Previously was automatically removing the task when the last activity
was removed.

Fixes bug 12957434.

Change-Id: I7f6b1f09a2e2a845f177f337769075c9376f8bdb
2014-02-10 17:55:01 -08:00
Craig Mautner
9ef471f7f2 Don't remove Activities and Tasks until animation done
Just like stacks and displays, activities and tasks need to stick
around until animations have completed.

Change-Id: I54fe8f6855d60cbc3a25cbc6e762defd5ac50bf5
2014-02-07 13:11:47 -08:00
Craig Mautner
38f7dcd7dc DO NOT MERGE. Test for Configuration differences before changing.
Changing Configuration first and then testing for changes yields a
result indicating no change.

Fixes bug 12904769.

Change-Id: If7e39e843f15b1143d9877497d595511afabd020
2014-02-06 12:27:20 -08:00
Adam Lesinski
7f41663141 Merge "Check feature bits before loading optional services" into klp-modular-dev 2014-02-06 20:13:21 +00:00
Craig Mautner
1bf2b87347 Defer detach until animations are complete.
Allowing the detach of ActivityStack from DisplayContent to happen
immediately was causing all sorts of problems associated with not
having a Display to complete the animations.

Waiting for animations to complete before either the detach or the
display removal fixes those problems.

Change-Id: I8a5663bfac5c3c1084ff4fcc451e0e38e8080265
2014-02-05 15:37:40 -08:00
Craig Mautner
dc548483ae Move activities from DisplayContent to TaskStack
Now that activities and tasks can be detached from a display do not
keep their state within the DisplayContent class. All such state is
now moved to the TaskStack class with this change.

Change-Id: Ie6b1811e9ec3f545782bad8c3461bd4f2d336b93
2014-02-05 13:35:24 -08:00
Adam Lesinski
898c13df7b Check feature bits before loading optional services
At startup, we check with PackageManager whether a system service is
available before attempting to load it. A system service is available
if its associated feature (similar to hardware features) is present.
This does not remove unavailable services from the compiled jar.

Change-Id: I13571805083aa4e65519a74acb52efd17b9fb3d7
2014-02-05 19:26:40 +00:00
Craig Mautner
df88d73092 Add IIntentSender to ActivityContainer.startActivity
PendingIntents and IntentSenders can now be launched. Still does not
work once the host activity has been paused and resumed.

Window manager TaskStacks now exist independently of Displays and app
windows persist after Displays are removed below them. Attaching the
stack to a new Display does not yet restore the windows to it.

Fixes bug 12747909.

Change-Id: I509007ee23fda400b353f483cf6ecce08177763b
2014-02-04 15:10:13 -08:00
Hui Lu
3cab7fc1b8 Merge "Add proxy as another network." into klp-modular-dev 2014-01-30 22:58:48 +00:00
Hui Lu
1c5624a012 Add proxy as another network.
Change-Id: I70cb6ac5604c4f0d6a752a291c40de2445ae98bb
2014-01-30 17:26:18 -05:00
Narayan Kamath
583b7b1671 am 39a789bf: am 7ae1726d: am aa9ba887: am 6e09eb4c: Merge "AArch64: Make graphics classes 64-bit compatible"
* commit '39a789bf6efd5c3478a442e60e896cae371fd04c':
  AArch64: Make graphics classes 64-bit compatible
2014-01-28 19:26:29 +00:00