385 Commits

Author SHA1 Message Date
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
b69b2c01b4 Fix build.
Change-Id: Id3262bff0df598ecc81a4346dee9febd3aaa60c9
2012-02-24 16:10:26 -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
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
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
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
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
Xavier Ducrohet
569ed05404 Layoutlib: simple comment fix.
Change-Id: I402f6b465706e8edd14e512a973d087a14abbfe3
2011-08-02 10:55:18 -07:00
Xavier Ducrohet
d2f664d42c Misc layoutlib fix in preparation of the access change in framework code.
Change-Id: I873adb7345514be6daa5c4fea4ebabb515f203e2
2011-08-01 15:08:26 -07:00
Jeff Brown
bc68a59c02 Report the external display size to the input reader.
The input reader needs this information so that it knows how to
interpolate touches on an external touch screen.

Changed Display so that it asks the WindowManager what the real
display size is (as opposed to the raw display size).  This means
it now takes into the forced display size set by
adb shell am display-size.

Replaced all calls to getRealWidth() / getRealHeight() /
getRealMetrics() in the WindowManager and replaced them with direct
usages of the mCurDisplayWidth / mCurDisplayHeight so that the WM
doesn't end up making a reentrant Binder call into itself.

Fixed the table status bar HeightReceiver so that it updates the
height on all configuration changes since it is possible that the
display size changed independently of an external HDMI display
being plugged / unplugged.

Improved the Display class documentation to make the distinctions
betweeen the various sizes clearer.

Change-Id: I3f75de559d3ebffed532ab46c4ae52c5e7f1da2b
2011-07-25 20:10:12 -07:00
Xavier Ducrohet
4f727fbdc3 am ed07215e: am 55775e5f: am e70b2b8f: am 9bcf26ea: Merge "Layoutlib_create flag -p: don\'t change all accesses to public."
* commit 'ed07215e482cae1ffedbba707284821b3afc310f':
  Layoutlib_create flag -p: don't change all accesses to public.
2011-07-25 17:24:56 -07:00
Xavier Ducrohet
ed07215e48 am 55775e5f: am e70b2b8f: am 9bcf26ea: Merge "Layoutlib_create flag -p: don\'t change all accesses to public."
* commit '55775e5f34af8d7c22ab3212c253b3a7d34a6f8a':
  Layoutlib_create flag -p: don't change all accesses to public.
2011-07-25 12:21:17 -07:00
Xavier Ducrohet
55775e5f34 am e70b2b8f: am 9bcf26ea: Merge "Layoutlib_create flag -p: don\'t change all accesses to public."
* commit 'e70b2b8fe0c265171f3a367a66c99b36c62567c7':
  Layoutlib_create flag -p: don't change all accesses to public.
2011-07-21 16:25:50 -07:00
Xavier Ducrohet
e70b2b8fe0 am 9bcf26ea: Merge "Layoutlib_create flag -p: don\'t change all accesses to public."
* commit '9bcf26ea7aa108ce4bf4e973b4774d3e60eebafe':
  Layoutlib_create flag -p: don't change all accesses to public.
2011-07-21 16:23:18 -07:00
Raphael Moll
caed59d90d Layoutlib_create flag -p: don't change all accesses to public.
Change-Id: Icb1709ed0cb275a5a51ca34030695a5e94091499
2011-07-19 22:36:13 -07:00
Xavier Ducrohet
af64556de0 Layoutlib: misc fix + start of AndroidBidi support.
Change-Id: If2ce0b683da8cce01679322d503eed8dd474e521
2011-07-19 15:10:23 -07:00
satok
91e88122cf Enable IMEs to set additional subtypes in background
Bug: 4591792

Change-Id: I7e61a576c56d1a3a56001bdf2fd51ad3801add01
2011-07-19 04:59:48 +09:00
Xavier Ducrohet
37b3cc3bbe am 9163a4a6: am aa4b1d8b: am d292d2a0: Merge 36a3a392 from mr1.
* commit '9163a4a686fc25fefc77d5b41c24a4538486a48e':
  Merge 36a3a392 from mr1.
2011-07-13 14:53:54 -07:00
Xavier Ducrohet
96131eef38 LayoutLib: updated fake accessbility manager and ensure there's an InputMethodManager
We had replaced the accessibility Manager but it lacked some new API. Obvisouly
this is fragile and should be fixed, but this works for now.

After fixing this there was another issue with the lack of InputMethodManager.
To fix this I had to create an implementation of IInputMethodManager which
normally comes from a binder object.

I may want to do a similar trick with the accessibility manager later.

Change-Id: I28c6494e333f39072f348d0199124efac93256a5
2011-07-12 12:35:50 -07:00
Xavier Ducrohet
0a49635b17 LayoutLib: Delegate for Display and IWindowManager implementation.
This allows ViewConfiguration to be properly implemented which is now
required for the rendering to happen.

Change-Id: I55629689fa8f5f874b43fcac2aa0789ce02d58f4
2011-07-12 11:49:22 -07:00
Xavier Ducrohet
77eaa10949 new button graphics for layoutlib.
Change-Id: I12a6bf9df87552321452ca3344449814cd3102bb
2011-07-11 14:40:48 -07:00
Xavier Ducrohet
9163a4a686 am aa4b1d8b: am d292d2a0: Merge 36a3a392 from mr1.
* commit 'aa4b1d8ba9d5e317b67638b764d92d17fb810aa0':
  Merge 36a3a392 from mr1.
2011-07-11 12:46:07 -07:00
Xavier Ducrohet
d292d2a031 Merge 36a3a392 from mr1.
Protect against OOB index in BridgeTypedArray.

Change-Id: I40be1e039f9eb36c182b6522bd50d6ed98e15b5c
2011-07-11 12:02:51 -07:00
Xavier Ducrohet
842725fc64 am 4d825e1f: Merge "Bring in more layout lib changes from hc-mr1." into gingerbread
* commit '4d825e1f3bb6b52ecbea6f0c4aa2081b7f1edc89':
  Bring in more layout lib changes from hc-mr1.
2011-06-28 18:55:46 -07:00
Xavier Ducrohet
9bce27a9ce am 4753498d: Merge "CherryPick 06942bc4 from hc-mr1. do not merge." into gingerbread
* commit '4753498d5c1ac3cf93b0730e77946a95b6913a82':
  CherryPick 06942bc4 from hc-mr1. do not merge.
2011-06-28 18:55:42 -07:00
Xavier Ducrohet
155cf6c1e1 am 9918ffb0: Merge "CherryPick 988eeeb5 from hc-mr1. do not merge." into gingerbread
* commit '9918ffb07f47430e22f6e53576d59b599f5a3534':
  CherryPick 988eeeb5 from hc-mr1. do not merge.
2011-06-28 18:53:54 -07:00
Raphael Moll
b02367778d am f9705ef6: am 2b5f2d01: am e2b41b0d: Merge "Laoutlib_creator: keep original of delegate methods."
* commit 'f9705ef6d3f1502991dd312bfdbfb93cb07fe672':
  Laoutlib_creator: keep original of delegate methods.
2011-06-23 14:30:25 -07:00
Raphael Moll
f9705ef6d3 am 2b5f2d01: am e2b41b0d: Merge "Laoutlib_creator: keep original of delegate methods."
* commit '2b5f2d01558ba338042f486c754f63873c4061fe':
  Laoutlib_creator: keep original of delegate methods.
2011-06-22 18:05:22 -07:00
Raphael Moll
2b5f2d0155 am e2b41b0d: Merge "Laoutlib_creator: keep original of delegate methods."
* commit 'e2b41b0d5c8db85a60cd190c7094052db61114b2':
  Laoutlib_creator: keep original of delegate methods.
2011-06-22 17:44:29 -07:00
Brian Carlstrom
98e1e18c1c Fix build.
git cherry-pick --no-commit  22a614142aacce13fc46a0e524dbfb6ca56bf237

Change-Id: I1409bc3dd1f1b3027c12355e8b6aeffa2d857c83
2011-06-22 11:35:11 -07:00
Xavier Ducrohet
e86c5b2e9f Merge "Add missing delegate to the layoutlib." 2011-06-21 12:19:07 -07:00