1284 Commits

Author SHA1 Message Date
Jeff Brown
98365d7663 Refactor for multi-display support.
Split WindowManagerImpl into two parts, the WindowManager
interface implementation remains where it is but the global
communications with the window manager are now handled by
the WindowManagerGlobal class.  This change greatly simplifies
the challenge of having separate WindowManager instances
for each Context.

Removed WindowManagerImpl.getDefault().  This represents the
bulk of this change.  Most of the usages of this method were
either to perform global functions (now handled by WindowManagerGlobal)
or to obtain the default display (now handled by DisplayManager).

Explicitly associate each new window with a display and make
the Display object available to the View hierarchy.

Add stubs for some new display manager API features.

Start to split apart the concepts of display id and layer stack.
since they operate at different layers of abstraction.
While it's true that each logical display uniquely corresponds to a
surface flinger layer stack, it is not necessarily the case that
they must use the same ids.  Added Display.getLayerStack()
and started using it in places where it was relatively easy to do.

Change-Id: I29ed909114dec86807c4d3a5059c3fa0358bea61
2012-08-19 22:42:08 -07:00
Michael Jurka
d2ae85d41e Merge "Adding a thumbnail scale down animation" into jb-mr1-dev 2012-08-17 13:03:15 -07:00
Dianne Hackborn
79af1dd54c Switch public APIs to use new UserHandle class for identifying users.
Gets rid of "yet another integer" confusion.

Change-Id: Id07ea7307aea7c62f0087c6663a1f1c08e2e5dee
2012-08-17 10:36:08 -07:00
Michael Jurka
832cb229cd Adding a thumbnail scale down animation
Recents animation will temporarily look a bit
wrong, but a subsequent change will fix this.
2012-08-16 00:14:03 -07:00
Jeff Brown
9630704ed3 Power manager rewrite.
The major goal of this rewrite is to make it easier to implement
power management policies correctly.  According, the new
implementation primarily uses state-based rather than event-based
triggers for applying changes to the current power state.

For example, when an application requests that the proximity
sensor be used to manage the screen state (by way of a wake lock),
the power manager makes note of the fact that the set of
wake locks changed.  Then it executes a common update function
that recalculates the entire state, first looking at wake locks,
then considering user activity, and eventually determining whether
the screen should be turned on or off.  At this point it may
make a request to a component called the DisplayPowerController
to asynchronously update the display's powe state.  Likewise,
DisplayPowerController makes note of the updated power request
and schedules its own update function to figure out what needs
to be changed.

The big benefit of this approach is that it's easy to mutate
multiple properties of the power state simultaneously then
apply their joint effects together all at once.  Transitions
between states are detected and resolved by the update in
a consistent manner.

The new power manager service has is implemented as a set of
loosely coupled components.  For the most part, information
only flows one way through these components (by issuing a
request to that component) although some components support
sending a message back to indicate when the work has been
completed.  For example, the DisplayPowerController posts
a callback runnable asynchronously to tell the PowerManagerService
when the display is ready.  An important feature of this
approach is that each component neatly encapsulates its
state and maintains its own invariants.  Moreover, we do
not need to worry about deadlocks or awkward mutual exclusion
semantics because most of the requests are asynchronous.

The benefits of this design are especially apparent in
the implementation of the screen on / off and brightness
control animations which are able to take advantage of
framework features like properties, ObjectAnimator
and Choreographer.

The screen on / off animation is now the responsibility
of the power manager (instead of surface flinger).  This change
makes it much easier to ensure that the animation is properly
coordinated with other power state changes and eliminates
the cause of race conditions in the older implementation.

The because of the userActivity() function has been changed
so that it never wakes the device from sleep.  This change
removes ambiguity around forcing or disabling user activity
for various purposes.  To wake the device, use wakeUp().
To put it to sleep, use goToSleep().  Simple.

The power manager service interface and API has been significantly
simplified and consolidated.  Also fixed some inconsistencies
related to how the minimum and maximum screen brightness setting
was presented in brightness control widgets and enforced behind
the scenes.

At present the following features are implemented:

- Wake locks.
- User activity.
- Wake up / go to sleep.
- Power state broadcasts.
- Battery stats and event log notifications.
- Dreams.
- Proximity screen off.
- Animated screen on / off transitions.
- Auto-dimming.
- Auto-brightness control for the screen backlight with
  different timeouts for ramping up versus ramping down.
- Auto-on when plugged or unplugged.
- Stay on when plugged.
- Device administration maximum user activity timeout.
- Application controlled brightness via window manager.

The following features are not yet implemented:

- Reduced user activity timeout for the key guard.
- Reduced user activity timeout for the phone application.
- Coordinating screen on barriers with the window manager.
- Preventing auto-rotation during power state changes.
- Auto-brightness adjustment setting (feature was disabled
  in previous version of the power manager service pending
  an improved UI design so leaving it out for now).
- Interpolated brightness control (a proposed new scheme
  for more compactly specifying auto-brightness levels
  in config.xml).
- Button / keyboard backlight control.
- Change window manager to associated WorkSource with
  KEEP_SCREEN_ON_FLAG wake lock instead of talking
  directly to the battery stats service.
- Optionally support animating screen brightness when
  turning on/off instead of playing electron beam animation
  (config_animateScreenLights).

Change-Id: I1d7a52e98f0449f76d70bf421f6a7f245957d1d7
2012-08-15 03:06:24 -07:00
Dianne Hackborn
756220bd19 Add API to create new contexts with custom configurations.
This allows you to, say, make a Context whose configuration
is set to a different density than the actual density of the device.

The main API is Context.createConfigurationContext().  There is
also a new API on ContextThemeWrapper that allows you to apply
an override context before its resources are retrieved, which
addresses some feature requests from developers to be able to
customize the context their app is running in.

Change-Id: I88364986660088521e24b567e2fda22fb7042819
2012-08-14 16:51:38 -07:00
Jean-Baptiste Queru
c386ee56b9 am c1c55afb: am e67f8c8c: Merge "Normalize output from aapt d xmltree"
* commit 'c1c55afb474dd85a6205bc8ab94065f3ac38aa77':
  Normalize output from aapt d xmltree
2012-08-08 12:03:43 -07:00
Jean-Baptiste Queru
c1c55afb47 am e67f8c8c: Merge "Normalize output from aapt d xmltree"
* commit 'e67f8c8c279e20fff5f426eccd062b709e6280ed':
  Normalize output from aapt d xmltree
2012-08-08 12:01:35 -07:00
Jean-Baptiste Queru
e67f8c8c27 Merge "Normalize output from aapt d xmltree" 2012-08-08 11:21:29 -07:00
Dianne Hackborn
537915828b Merge "More mult-user API work." into jb-mr1-dev 2012-08-08 10:22:49 -07:00
Dianne Hackborn
7d19e0242f More mult-user API work.
- You can now use android:singleUser with receivers and providers.
- New API to send ordered broadcasts as a user.
- New Process.myUserHandle() API.

For now I am trying out "user handle" as the name for the numbers
representing users.

Change-Id: I754c713ab172494bb4251bc7a37a17324a2e235e
2012-08-07 19:19:22 -07:00
Elliott Hughes
b14c215eb2 am 4b4b4438: am 33c5670b: Merge "Fewer warnings in aidl generated code."
* commit '4b4b44381b133e9ab7418806c046774b7fd31393':
  Fewer warnings in aidl generated code.
2012-08-07 13:20:50 -07:00
Elliott Hughes
4b4b44381b am 33c5670b: Merge "Fewer warnings in aidl generated code."
* commit '33c5670b315810f1f3dc66fe8cd38f7b3e05f3ac':
  Fewer warnings in aidl generated code.
2012-08-07 13:18:53 -07:00
Elliott Hughes
b327c41e12 Fewer warnings in aidl generated code.
Bug: http://code.google.com/p/android/issues/detail?id=19196
Change-Id: If054e60c19dc73fe32f55d0fa1054309565a6de6
2012-08-07 10:34:02 -07:00
Svetoslav Ganov
758143ecfe Window position not reported if the window is not moved.
1.If a window is shown but never moved the window window
  is never notified for its current location. Therefore,
  accessibility nodes do not contain correct bounds in
  screen coordinates.

bug:6926295

Change-Id: I7df18b095d33ecafffced75aba9e4f4693b0c393
2012-08-06 23:49:38 -07:00
Craig Mautner
b49a065d99 Fix build with density methods.
Change-Id: I95c0a4f12db40f200a3a004394763beaef904232
2012-08-03 19:03:24 -07:00
Craig Mautner
437a0fbd57 Merge "Introduce multiple displays with DisplayContent." into jb-mr1-dev 2012-08-02 09:20:14 -07:00
Craig Mautner
59c009776d Introduce multiple displays with DisplayContent.
Fix a couple of bugs that turned up.
Remove touch/focus from display. Add iterators for access.
Respond to comments. Remove TODOs, and some deviceId parameters.

Change-Id: Idcdb4f1979aa7b14634d450fd0333d6eff26994d
2012-08-02 08:47:44 -07:00
Dianne Hackborn
908aecc3a6 Start moving away from DisplayMetrics.DENSITY_DEVICE.
This puts in most of the infrastructure needed to allow us to
switch between different densities at run time.  The main remaining
uses of the global are to initialize the Bitmap object (not sure
what to do about that since it doesn't have anything passed in
the constructor to get this information from), and being able to
load drawables if we need a different density than what was preloaded
by zygote.

Change-Id: Ifdbfd6b7a5c59e6aa22e63b95b78d96af3d96848
2012-08-01 10:54:39 -07:00
Craig Mautner
39df578acd Fix build.
Change-Id: I52bbebae38912a4fb71c96174b3d4d8eb6be10c1
2012-07-27 14:30:59 -07:00
Jeff Brown
aa871b0ff0 Fix build.
Change-Id: Ife2fd58447205407e41ce3d27e28a705b744bede
2012-07-25 20:06:22 -07:00
Jeff Brown
fa25bf5382 Add display manager skeleton.
The purpose of this change is to remove direct reliance on
SurfaceFlinger for describing the size and characteristics of
displays.

This patch also starts to make a distinction between logical displays
and physical display devices.  Currently, the window manager owns
the concept of a logical display whereas the new display
manager owns the concept of a physical display device.

Change-Id: I7e0761f83f033be6c06fd1041280c21500bcabc0
2012-07-25 18:56:16 -07:00
Xavier Ducrohet
212dfccc74 am be925017: am b71393bd: Merge "Fix aapt -G to properly support class attr in fragment." into jb-dev
* commit 'be925017201ad547a72e8d1e333dbc7eae3fc76f':
  Fix aapt -G to properly support class attr in fragment.
2012-07-20 10:00:11 -07:00
Xavier Ducrohet
be92501720 am b71393bd: Merge "Fix aapt -G to properly support class attr in fragment." into jb-dev
* commit 'b71393bd34a48eeb622292e78f43b99e374a5e3a':
  Fix aapt -G to properly support class attr in fragment.
2012-07-19 14:30:39 -07:00
Xavier Ducrohet
095cd2e2d1 Fix aapt -G to properly support class attr in fragment.
The code added attributes android:name and class to a
KeyedVector under the same key (fragment) so the 2nd
add (android:name) removed class with was never checked.

This replace the value type in the KeyedVector to be
Vector<NamespaceAttributePair> instead of just
NamespaceAttributePair.

Change-Id: I009b8a8cca878191661c2a63bb14c967d230498d
2012-07-19 09:06:03 -07:00
Svetoslav Ganov
c9c9a48e7b Removing a workaround for incorrect window position on window move.
1. The window manager was not notifying a window when the latter
   has been moved. This was causing incorrect coordinates of the
   nodes reported to accessibility services. To workaround that
   we have carried the correct window location when making a
   call from the accessibility layer into a window. Now the
   window manager notifies the window when it is moved and the
   workaround is no longer needed. This change takes it out.

2. The left and right in the attach info were not updated properly
   after a report that the window has moved.

3. The accessibility manager service was calling directly methods
   on the window manager service without going through the interface
   of the latter. This leads to unnecessary coupling and in the
   long rung increases system complexity and reduces maintability.

bug:6623031

Change-Id: Iacb734b1bf337a47fad02c827ece45bb2f53a79d
2012-07-16 08:46:11 -07:00
Xavier Ducrohet
54059cd38d am 15c15eaa: Merge "Replace LruCache implementation for layoutlib. do not merge." into jb-dev
* commit '15c15eaac51c0c375d18fb70cd1bd066d87b034e':
  Replace LruCache implementation for layoutlib. do not merge.
2012-07-10 18:38:21 -07:00
Craig Mautner
105b78bb31 Add missing interface method.
Fix broken build.

Change-Id: I6644df218e11a35330a985bdcb9ace33723330f5
2012-07-10 15:17:25 -07:00
Xavier Ducrohet
54a18ef7ad Replace LruCache implementation for layoutlib. do not merge.
The android version depends on a custom version of LinkedHashMap
which is not present on desktop VMs. This new implementation is done
in a way that minimizes the difference between the two.

Also some minor fixes.

(cherry picked from commit 01b6c755dbcf24e71192dc44757e2eea2a426091)

Change-Id: Idc7bca820e472e281a3024a5b610fd55606cf428
2012-07-10 12:51:30 -07:00
Xavier Ducrohet
01b6c755db Replace LruCache implementation for layoutlib.
The android version depends on a custom version of LinkedHashMap
which is not present on desktop VMs. This new implementation is done
in a way that minimizes the difference between the two.

Also some minor fixes.

Change-Id: Ib27b0419f9d0e6ba4d4abb26b2ccd968af59eba8
2012-07-10 11:48:10 -07:00
Shachar Shemesh
429dad687b Normalize output from aapt d xmltree
When using aapt dump xmltree to dump an XML which has a content element with newlines, the output contains a
newline. This makes it very difficult, sometimes impossible, to understand what is part of the content, and
what is the meta-data.

We now pass XML content through the same normalizer used for other tags.

Change-Id: I327321520fac563eb32aecaf796f2473866697fc
2012-07-08 06:37:48 +03:00
Dianne Hackborn
a4b7f2f75e Use two fingers to work some magic...
Change-Id: Ibcb3dbd3d158c22da8277e544d81fb47eadccd49
2012-06-25 19:19:15 -07:00
Jean-Baptiste Queru
cee303fac4 am cc6cf51b: am 8c71784e: Merge "Initialize mJunkPath to false"
* commit 'cc6cf51b80eabd199f797f40b76f7980c343962b':
  Initialize mJunkPath to false
2012-06-22 14:36:49 -07:00
Jean-Baptiste Queru
cc6cf51b80 am 8c71784e: Merge "Initialize mJunkPath to false"
* commit '8c71784e9e83e914135e996591aa7903edd2fd96':
  Initialize mJunkPath to false
2012-06-22 14:34:54 -07:00
Haitao Feng
dbcfed9e2c Initialize mJunkPath to false
Change-Id: Ib48bb1d91736d27f055528c3ba275237ff5ada07
2012-06-22 09:20:26 +08:00
Xavier Ducrohet
752e7b3bf6 am 58a8d8d2: am 0e302bc8: Merge "Disable debug output in SDK layoutlib." into jb-dev
* commit '58a8d8d2d4b15cd4abf010680181359823ebfda4':
  Disable debug output in SDK layoutlib.
2012-06-19 18:09:14 -07:00
Xavier Ducrohet
58a8d8d2d4 am 0e302bc8: Merge "Disable debug output in SDK layoutlib." into jb-dev
* commit '0e302bc884fa4b25eb391d625f2fb0eddc25d9b7':
  Disable debug output in SDK layoutlib.
2012-06-19 18:06:37 -07:00
Xavier Ducrohet
4d7f301f94 Disable debug output in SDK layoutlib.
Bug: 6697442

Change-Id: I9741761342ea220c158aa124089430b0db80bf7e
2012-06-19 18:02:21 -07:00
Raphael Moll
89e1ad05e7 am bce1011d: resolved conflicts for merge of 8cf489c1 to jb-dev-plus-aosp
* commit 'bce1011dd2a371c587d2e39ad8c3d446b63049d0':
  Layoutlib Create: Find dependencies.
2012-06-14 14:46:25 -07:00
Raphael Moll
bce1011dd2 resolved conflicts for merge of 8cf489c1 to jb-dev-plus-aosp
Change-Id: I06608e3c122b8f321429d457c51aa2213dd238b4
2012-06-14 14:14:45 -07:00
Raphael Moll
8cf489c1f5 am 0f160c95: Merge "Layoutlib Create: Find dependencies."
* commit '0f160c95122276c40ca84afe6fcd2b9cd800e35c':
  Layoutlib Create: Find dependencies.
2012-06-14 11:34:31 -07:00
Raphael Moll
4306096a43 Layoutlib Create: Find dependencies.
Usage: layoutlib_create --list-deps /path/to/layoutlib.jar

Prints:
- all classes found in the Jar and the types they use (the dependencies).
- all the dependencies missing from the Jar and what uses them.

Change-Id: I8b2674df127e1494feed7a653282e88e4d2f5494
2012-06-13 15:44:54 -07:00
Dianne Hackborn
b1add0b8f2 am 6892f1ec: am 0f6471ac: Merge "Fix issue #6641368: can\'t launch gallery" into jb-dev
* commit '6892f1ec9670432f1cab71813592077bea991a8b':
  Fix issue #6641368: can't launch gallery
2012-06-12 13:00:15 -07:00
Dianne Hackborn
6892f1ec96 am 0f6471ac: Merge "Fix issue #6641368: can\'t launch gallery" into jb-dev
* commit '0f6471ace77387560988964ed0679f843bba6f1f':
  Fix issue #6641368: can't launch gallery
2012-06-12 12:41:36 -07:00
Dianne Hackborn
2bd8d0403b Fix issue #6641368: can't launch gallery
This is a revert of 1db36528b12395b9ed9bf8a1005a6d4ace737627,
but with comments added so I don't make this mistake again. :)

Change-Id: I053216279e3721f08f32f561bb989736ef619f82
2012-06-11 12:27:05 -07:00
Jean-Baptiste Queru
f22eb96301 am c9fe6568: am 9e22d9c5: Merge "Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6."
* commit 'c9fe6568f3e7e4d9dc6da072afc929b9a81001ed':
  Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6.
2012-06-05 18:48:00 -07:00
Jean-Baptiste Queru
c9fe6568f3 am 9e22d9c5: Merge "Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6."
* commit '9e22d9c514457c4b163d03b9241e4e28b1698368':
  Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6.
2012-06-05 18:43:49 -07:00
Ying Wang
41bdb03ffb Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6.
With SDK 10.6 without _DARWIN_UNLIMITED_STREAMS aapt sometimes fails
right away with the error "Too many open files" when calling fopen().

Change-Id: Ifa7bd8a9530d706aa47f98be8186f1aefe943d76
2012-06-05 14:30:39 -07:00
Ying Wang
f6447b1878 Merge "Fix "Too many open files" error for aapt built with Mac OS X SDK 10.6." 2012-06-05 11:20:41 -07:00
Tor Norbye
0eedd4be12 am 9f374b9d: am 44ff9b8f: am 36ac43ba: Merge "Tweak default ignore-assets path"
* commit '9f374b9de5a557a7977b24d41f45c3464cfff8c1':
  Tweak default ignore-assets path
2012-06-05 09:55:22 -07:00