409 Commits

Author SHA1 Message Date
Romain Guy
e0cf12fc4d Fix the build
Change-Id: Ia86ba9b1c432ab3f8107557e95b12c9eedc4d9f7
2012-03-08 11:08:31 -08:00
Xavier Ducrohet
aeb17f17ff am 77fdcbff: am f038868d: am 44e63a21: Support rendering layout that use the new res-auto namespace.
* commit '77fdcbff8b458dd3430b38e60aee1a28ca92a738':
  Support rendering layout that use the new res-auto namespace.
2012-02-27 07:51:05 -08:00
Xavier Ducrohet
77fdcbff8b am f038868d: am 44e63a21: Support rendering layout that use the new res-auto namespace.
* commit 'f038868d74af534effceaa8f1d932f9576f4f647':
  Support rendering layout that use the new res-auto namespace.
2012-02-24 19:35:25 -08:00
Xavier Ducrohet
44e63a218c Support rendering layout that use the new res-auto namespace.
Change-Id: I9b89c965dc8c9458e74c15ab8ff765e16e1b32c2
2012-02-24 19:29:31 -08:00
Dianne Hackborn
cb581bbe2e resolved conflicts for merge of 34706a4c to master
Change-Id: I4dd24f3b917aa7e3d2c4b0fae51e951dfcf88ba8
2012-02-24 16:37:35 -08:00
Dianne Hackborn
34706a4c81 am e65a9ab1: am 5786f5cf: Merge "Fix build." into ics-mr1
* commit 'e65a9ab1ea42d1f6190bee844ee666b7910d71ef':
  Fix build.
2012-02-24 16:26:57 -08:00
Dianne Hackborn
b69b2c01b4 Fix build.
Change-Id: Id3262bff0df598ecc81a4346dee9febd3aaa60c9
2012-02-24 16:10:26 -08:00
Xavier Ducrohet
5e6c219477 am f8e737cb: am 22701ec5: am 503247f2: Merge "Make sure resource references are resolved." into ics-mr1
* commit 'f8e737cb61ab86b90ec318591fbcfec40fac63cf':
  Make sure resource references are resolved.
2012-02-23 12:22:40 -08:00
Xavier Ducrohet
f8e737cb61 am 22701ec5: am 503247f2: Merge "Make sure resource references are resolved." into ics-mr1
* commit '22701ec5b11f6138e6298814fff5f09da82df144':
  Make sure resource references are resolved.
2012-02-22 10:52:16 -08:00
Xavier Ducrohet
c3f979f6fe Make sure resource references are resolved.
XmlPullAttribute can query for attributes and return them in a given
format. We need to make sure they are first resolved before
trying to convert them to int/float/boolean/...

Change-Id: I2aaced022a0382e501978c396e49d6191d53bdc8
2012-02-21 14:33:37 -08:00
Jeff Brown
a175a5b7ea Encapsulate the ViewRootImpl's handler.
This change makes it much easier to make sense of the messages that
get posted to the ViewRootImpl's handler by encapsulating their point
of dispatch within the ViewRootImpl itself.

As part of this change, the View.AttachInfo now carries a reference
to the ViewRootImpl itself, which simplifies some code that used
to try to find the ViewRootImpl by getting the root view's parent.

In principle, it might have been nice to hide the ViewRootImpl from
the View hierarchy but in practice the two were coupled in many ways.

Change-Id: I51ebccdf5f8c8c505cd6f17cdf594174d041dc54
2012-02-15 19:32:16 -08:00
satok
688bd47fcc Add an api to switch to the next IME and subtype
Bug: 5975302

Change-Id: I48aa4220159c65f456d61a324efcdf0a1ceec91c
2012-02-10 16:44:12 +09:00
Xavier Ducrohet
c8a0b8e6bc Fix a setBackgroundDrawable in layoutlib.
Change-Id: Id5f3ec8cc6863fa5929743ef4014c331633efce9
2012-02-06 17:29:19 -08:00
Xavier Ducrohet
331bb0c393 Setup ActionBars in layoutlib the same way the platform does it. do not merge.
Instead of using a simple ImageView for the icon, this uses the platform
layout/action_bar_home which uses a custom class to position and resize
the icon (and also supports the Up icon that we don't yet support).

This ensures that the icon is properly positionned and sized like
on devices.

(cherry picked from commit 7396348dfcfb45b7ad055f4c18cabbe5e8270d26)

Change-Id: Ifd3bc318089b70ba843519523e366e59d434e919
2012-02-06 16:40:03 -08:00
Xavier Ducrohet
7396348dfc Setup ActionBars in layoutlib the same way the platform does it.
Instead of using a simple ImageView for the icon, this uses the platform
layout/action_bar_home which uses a custom class to position and resize
the icon (and also supports the Up icon that we don't yet support).

This ensures that the icon is properly positionned and sized like
on devices.

Change-Id: I57432afa82d257bb043247001320b368045d7f55
2012-02-06 15:11:12 -08:00
Jeff Brown
ec99f609cc Merge "Rename CancellationSignal using preferred spelling." 2012-02-02 18:50:55 -08:00
Jeff Brown
4c1241df8f Rename CancellationSignal using preferred spelling.
Bug: 5943637
Change-Id: I12a339f285f4db58e79acb5fd8ec2fc1acda5265
2012-02-02 18:02:16 -08:00
Xavier Ducrohet
46d43ccfd8 Make Layoutlib compile on Java 6.
Change-Id: Ic8f0e321c6c218de83664fc01f253a07fa80852c
2012-02-02 17:45:45 -08:00
Jeff Brown
75ea64fc54 Implement a cancelation mechanism for queries.
Added new API to enable cancelation of SQLite and content provider
queries by means of a CancelationSignal object.  The application
creates a CancelationSignal object and passes it as an argument
to the query.  The cancelation signal can then be used to cancel
the query while it is executing.

If the cancelation signal is raised before the query is executed,
then it is immediately terminated.

Change-Id: If2c76e9a7e56ea5e98768b6d4f225f0a1ca61c61
2012-01-27 17:33:21 -08:00
Jim Miller
d3fe9abfb9 am ab9601cd: am 230a7092: Merge "Fix 5863053: Add method to lock screen immediately." into ics-mr1
* commit 'ab9601cdbb95ae94088750eff9a926a572c1a4d6':
  Fix 5863053: Add method to lock screen immediately.
2012-01-20 15:48:21 -08:00
Romain Guy
d2f0dcd182 Merge "Remove unused code" 2012-01-19 17:42:10 -08:00
Romain Guy
68fc1dfce0 Remove unused code
Change-Id: Ife0a43f3cfe64a1e74401b10bf74d37cbeefb5af
2012-01-19 17:41:39 -08:00
Xavier Ducrohet
5bf2802ad9 Fix broken drawCircle LayoutLib.
Change-Id: I5e23bbe0119e385fa2f77854a8f88128351d3759
2012-01-18 17:08:53 -08:00
Jim Miller
93c518e4f8 Fix 5863053: Add method to lock screen immediately.
This fixes a bug where the device fails to lock when DevicePolicyManagerService
requests the device to be locked and the screen was off because the user hit
the power button.

The change allows DPMS to directly invoke screen lock, bypasssing the screen state.

Change-Id: Iecdda6fc61e9c519119de495be23c69c3b983921
2012-01-17 18:11:05 -08:00
Tor Norbye
e98ae0a050 Merge "Upgrade layoutlib generation code to use ASM 4.0" 2011-12-06 13:31:04 -08:00
Jeff Brown
96e942dabe Use a Choreographer to schedule animation and drawing.
Both animations and drawing need to march to the beat of
the same drum, but the animation system doesn't know
abgout the view system and vice-versa so neither one
can drive the other.

We introduce the Choreographer as a drummer to keep
everyone in time and ensure a magnificent performance.

This patch enabled VSync based animations and drawing by
default.  Two system properties are provided for testing
purposes to control the behavior.

"debug.choreographer.vsync": Enables vsync based animation
timing.  Defaults to true.  When false, animations are
timed by posting delayed messages to a message queue in
the same way they used to be before this patch.

"debug.choreographer.animdraw": Enables the use of the animation
timer to drive drawing such that drawing is synchronized with
animations (in other words, with vsync or the timing loop).
Defaults to true.  When false, layout traversals and drawing
are posted to the message queue for execution without any delay or
synchronization in the same way they used to be before this patch.

Stubbed out part of the layoutlib animation code because it
depends on the old timing loop (opened bug 5712395)

Change-Id: I186d9518648e89bc3e809e393e9a9148bbbecc4d
2011-12-05 16:39:59 -08:00
Tor Norbye
f7270ba908 Upgrade layoutlib generation code to use ASM 4.0
Change-Id: I46b3854a05677dc7cadd217efb001dbb25631fbd
2011-12-05 14:26:04 -08:00
Dianne Hackborn
c0b7f65ae0 am 496f6e2a: am b54980d1: Merge "Fix issue #5588689: Black camera preview after coming back from gmail" into ics-mr1
* commit '496f6e2ad656c5bb8a277e191554d16abd290b58':
  Fix issue #5588689: Black camera preview after coming back from gmail
2011-11-28 16:57:17 -08:00
Dianne Hackborn
6d05fd3c79 Fix issue #5588689: Black camera preview after coming back from gmail
Make surface management between SurfaceView and the window manager
much more controlled, to ensure that SurfaceView always gets to report
the current surface is destroyed before the window manager actually
destroys it.

Also a small tweak to allow windows that have a wallpaper background
to still have a preview window.  This makes launching home after it
has been killed feel much more responsive.

Change-Id: I0d22cf178a499601a770cb1dbadef7487e392d85
2011-11-28 14:45:50 -08:00
Tor Norbye
8836c55818 Set theme-tag in render log when failing to find style
Change-Id: I20461a7113eb25469deca13dca870936bdb33a29
2011-11-01 11:51:20 -07:00
Daniel Sandler
0c4ccff369 Add hasNavigationBar() to the window manager.
It is no longer sufficient to check the value of
internal.R.bool.config_showNavigationBar to determine if a
navigation bar (separate from the status bar) is shown on a
device, because the emulator needs to be able to override
this value (now possible by setting qemu.hw.mainkeys to "1"
or "0", for navbar or no navbar, respectively).

This logic is now contained in PhoneWindowManager, and any
clients wishing to know whether the system has a software
nav bar should consult the new hasNavigationBar() method.

Bug: 5404945
Change-Id: I119d32a8c84b88b2ef46f63244e7f11dc5de0359
2011-10-19 16:39:14 -04:00
Jeff Brown
d2183654e0 Fix ownership of CursorWindows across processes.
Bug: 5332296

Ensure that there is always an owner for each CursorWindow
and that references to each window are acquired/released
appropriately at all times.

Added synchronization to CursorToBulkCursorAdaptor to
prevent the underlying Cursor and CursorWindow from being
remotely accessed in ways that might violate invariants,
resulting in leaks or other problems.

Ensured that CursorToBulkCursorAdaptor promptly releases
its references to the Cursor and CursorWindow when closed
so they don't stick around longer than they should, even
if the remote end hangs onto the IBulkCursor for some reason.

CursorWindow respects Parcelable.FLAG_WRITE_RETURN_VALUE
as an indication that one reference to the CursorWindow is
being released.  Correspondingly, CursorToBulkCursorAdaptor
acquires a reference to the CursorWindow before returning
it to the caller.  This change also prevents races from
resulting in the transfer of an invalid CursorWindow over
the wire.

Ensured that BulkCursorToCursorAdaptor promptly releases
its reference to the IBulkCursor when closed and throws
on attempts to access the cursor while closed.

Modified ContentProviderNative to handle both parts of
the wrapping and unwrapping of Cursors into IBulkCursors.
This makes it a lot easier to ensure that the right
things happen on both ends.  Also, it turns out that
the only caller of IContentProvider.bulkQuery was
ContentProviderNative itself so there was no need
to support bulkQuery on ContentProviderProxy and it was
just getting in the way.

Implement CloseGuard on CursorWindow.

Change-Id: Ib3c8305d3cc62322f38a06698d404a2989bb6ef9
2011-10-09 22:10:36 -07:00
Dianne Hackborn
85b9edf2da Merge "Fix issue #5371530: SYSTEMUI_FLAG_HIDE_NAVIGATION reasserts itself immediately" 2011-10-06 15:15:32 -07:00
Dianne Hackborn
9a230e01a1 Fix issue #5371530: SYSTEMUI_FLAG_HIDE_NAVIGATION reasserts itself immediately
This cleans up how ui flags are managed between the client and window manager.
It still reports the global UI mode state to the callback, but we now only clear
certain flags when the system goes out of a state (currently this just means the
hide nav bar mode), and don't corrupt other flags in the application when the
global state changes.

Also introduces a sequence number between the app and window manager, to avoid
using bad old data coming from the app during these transitions.

Change-Id: I40bbd12d9b7b69fc0ff1c7dc0cb58a933d4dfb23
2011-10-06 14:57:37 -07:00
Jeff Brown
2447871b99 Fix build.
Change-Id: I7bb00b8ee0da952f3697b23dccf32dde55733b7a
2011-10-05 18:04:48 -07:00
Xavier Ducrohet
d410bfb200 LayoutLib: fix support for textScaleX.
Change-Id: I821191a40012e9727b4a3573d580483c3ae1de48
2011-10-04 19:39:18 -07:00
Xavier Ducrohet
1409409732 Layoutlib: Typeface support for loading fonts manually.
If the font being loaded is a system font, then we can find the font
file and manually load it.

Change-Id: I95473b1f1b88df64316b77c41ed05d4d09ab61ed
2011-10-04 18:24:30 -07:00
Xavier Ducrohet
178006a0e0 Layoutlib now parses system_fonts.xml instead of its own.
Also parse fallback_fonts.
This lets layoutlib automatically use the same fonts as the base
platforms, for instance it now uses the new ICS fonts.

Change-Id: Id6e778dc0e3f2a9112601e0eaf8499a9713ec433
2011-10-04 18:02:10 -07:00
Xavier Ducrohet
f1dee199a0 Layoutlib: add support for ITextServicesManager.
This include a fix in layoutlib_create to properly handle
delegating a static method of an inner class (was broken and
only worked on non static method).

Added a few comments here and there to *_Accessor classes so
that it's a bit more obvious what they are for and how they are
used.

Change-Id: Ifc31dd1a006393bb0c08e22b6a17f500dd62e090
2011-10-03 09:06:07 -07:00
Xavier Ducrohet
387d078e64 LayoutLib: Fix native delegate for Display.
Change-Id: If097cae2309d340162b3bac1d0f6a2289635adca
2011-09-29 18:33:50 -07:00
Dianne Hackborn
90c52de286 Fix issue #5173952: Opening a Notification From Lock Screen...
...Should Skip Unsecure Lockscreen (ICS)

Also while I am in there, clean up logging of intent objects to include
even less sensitive information, while showing the true Intent in dump
output (since apps can't get to that).

Change-Id: I35fed714645b21e4304ba38a11ebb9c4c963538e
2011-09-23 13:39:33 -07:00
Jeff Brown
01a98ddbdf Handle orientation changes more systematically.
Bug: 4981385

Simplify the orientation changing code path in the
WindowManager.  Instead of the policy calling setRotation()
when the sensor determined orientation changes, it calls
updateRotation(), which figures everything out.  For the most
part, the rotation actually passed to setRotation() was
more or less ignored and just added confusion, particularly
when handling deferred orientation changes.

Ensure that 180 degree rotations are disallowed even when
the application specifies SCREEN_ORIENTATION_SENSOR_*.
These rotations are only enabled when docked upside-down for
some reason or when the application specifies
SCREEN_ORIENTATION_FULL_SENSOR.

Ensure that special modes like HDMI connected, lid switch,
dock and rotation lock all cause the sensor to be ignored
even when the application asks for sensor-based orientation
changes.  The sensor is not relevant in these modes because
some external factor (or the user) is determining the
preferred rotation.

Currently, applications can still override the preferred
rotation even when there are special modes in play that
might say otherwise.  We could tweak this so that some
special modes trump application choices completely
(resulting in a letter-boxed application, perhaps).
I tested this sort of tweak (not included in the patch)
and it seems to work fine, including transitions between
applications with varying orientation.

Delete dead code related to animFlags.

Handle pausing/resuming orientation changes more precisely.
Ensure that a deferred orientation change is performed when
a drag completes, even if endDragLw() is not called because the
drag was aborted before the drop happened.  We pause
the orientation change in register() and resume in unregister()
because those methods appear to always be called as needed.

Change-Id: If0a31de3d057251e581fdee64819f2b19e676e9a
2011-09-21 19:26:15 -07:00
Dianne Hackborn
ce801c4a1b Fix build.
Change-Id: Ife2b4b207270f8017d3acd80c76eaf1c7a50986d
2011-09-18 15:22:24 -07:00
satok
ee5e77cafe Make setAdditionalInputMethodSubtypes async
Bug: 5120261
Change-Id: Ic7869cfaa5361531e08d58d7dfa5ba0feab0613e
2011-09-02 19:22:50 +09:00
Dianne Hackborn
29aae6f36e Fix issue #4279860: previous UI flashes before showing lock screen...
...(when turning display on after recently turning it off)

Also clean up when we decide to turn the screen on to improve that
transition.  There are still problems here with turning it on
before the wallpaper gets dispayed.

Change-Id: I2bc56c12e5ad75a1ce5a0546f43a845bf0823e66
2011-08-23 17:44:52 -07:00
Xavier Ducrohet
8433c36a98 LayoutLib: add native delegate for set/getHinting in Paint.
Change-Id: I1758f8ce861240d72113aa23dcbef5a52abade56
2011-08-22 13:13:16 -07:00
Xavier Ducrohet
7f9f99ea11 Make some methods/fields package private so that layoutlib can access them.
Change-Id: I4aeadfbaf8a4f6a459fa19937c21ac23d9e5fb64
2011-08-11 12:57:51 -07:00
Philip Milne
ea670054d6 Implement native println_native in android.util.Log for LayoutLib
Change-Id: I2ab83a131468490cf789bf17f9c12b6360e953a4
2011-08-09 11:25:25 -07:00
Adam Powell
dfee59afb3 Fix bug 5011824 - New Holo overflow menu for physical menu key devices
The new Holo-style overflow menu now appears from the edge of the screen
where the device's physical menu key can be found. The policy determining
this lives in getPreferredOptionsPanelGravity() in WindowManagerService.

Change-Id: I8851a2265547156591e82044e50b5cfc58d3eefa
2011-08-07 14:17:30 -07:00
Xavier Ducrohet
162c1dcd5e Layoutlib: implement Resources.getBoolean(int).
Change-Id: I44cee203bb9a8fabaebfd689fc20ec2f2a9b3561
2011-08-03 17:23:12 -07:00