370 Commits

Author SHA1 Message Date
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
Brett Chabot
3523325159 Merge "Include testdata in layoutlib-tests." 2011-06-21 11:27:29 -07:00
Xavier Ducrohet
fc511683b6 Add missing delegate to the layoutlib.
Change-Id: I8de5c1093052c40c0cd327a4d02b01651d3b76b5
2011-06-21 11:03:29 -07:00
Raphael Moll
865c3bef54 Laoutlib_creator: keep original of delegate methods.
For specific methods, Layoublib_create can rewrite the implementation
of a method to invoke a delegate instead of the original code. This
allows layoutlib to implement native code or override existing behavior.

This patch also 'saves' the original implementation of a rewritten
method so that the delegate can access the original implementation
as needed. Obviously this is only done for non-native methods.

Given a non-native SomeClass.MethodName, we generate 2 methods:
- A copy of the original method named "SomeClass.MethodName_original".
  The content is the original method as-is from the reader.
- A brand new implementation of SomeClass.MethodName which calls to a
  non-existing method named "SomeClass_delegate.MethodName".
  The implementation of this 'delegate' method is done in layoutlib_brigde.

Change-Id: I5ca2cd3ac55991a8e8a51c417e75ee447bf9e9e6
2011-06-17 19:07:13 -07:00
Brett Chabot
01f0fd84d0 Include testdata in layoutlib-tests.
Change-Id: I79fff895a13d171079b59db54d4b9d2bec555b3c
2011-06-17 17:03:20 -07:00
Xavier Ducrohet
ea5f0d0543 Bring in more layout lib changes from hc-mr1.
fe051bb2 : Change the way the layoutlib instantiate its XmlPullParser.

A lot of the init code was duplicated so I made a ParserFactory class.

Also created an extension of the KXmlPullParser to override toString().
This allows easier debugging when dealing with multiple parsers (which
is always the case).

Also added some (disabled) debugging printf to deal with parser stack
as it can be tricky figuring out which parsers are in the stack at
which point.

8969147c : Fix case where the int[] attrs doesn't directly match a styleable.

In the case of the FastScroller the int[] is a custom mix of attr
instead of a int[] that exists as R.styleable.foo.

This makes our reflection based mechanism used to find the styleable
fail, so instead we search for each attribute separately (like
we probably should have done from the beginning).

0c264b35: Fix various cases of getDimension to report error if unit is missing.

if getDimention###() is called for a string that has no unit,
then an error is output through LayoutLog, but the rendering keeps
going by using dp as a default.

0beb7eea: Make (Bridge)TypedArray.getInteger() call out to getInt()

Only getInt() resolved attribute flags/enum and I'm not sure why
there's two to begin with.

Change-Id: I015111263d2a2bee76834978ae71eef79defdae3
2011-06-16 18:26:25 -07:00
Xavier Ducrohet
d6465e10c2 CherryPick 06942bc4 from hc-mr1. do not merge.
Layoutlib - use the new getParser callback when possible.

Change-Id: I72b867aa573fcc07d610f139da3c90b1b654633c
2011-06-16 18:26:25 -07:00
Xavier Ducrohet
6b62c82848 CherryPick 988eeeb5 from hc-mr1. do not merge.
Support for custom declare-styleable attr with enum/flag in layoutlib.

Change-Id: I8a5b7cc629d61996ffade9aabd9d4d10961eb411
2011-06-16 18:26:24 -07:00
Xavier Ducrohet
9340ab4a21 am 0be8522b: am d1abd94f: am 04ce8111: Bring in more layout lib changes from hc-mr1.
* commit '0be8522b430aca8d90023d7c7e5ef510aa48adc7':
  Bring in more layout lib changes from hc-mr1.
2011-06-16 14:04:18 -07:00
Xavier Ducrohet
04ce811131 Bring in more layout lib changes from hc-mr1.
fe051bb2 : Change the way the layoutlib instantiate its XmlPullParser.

A lot of the init code was duplicated so I made a ParserFactory class.

Also created an extension of the KXmlPullParser to override toString().
This allows easier debugging when dealing with multiple parsers (which
is always the case).

Also added some (disabled) debugging printf to deal with parser stack
as it can be tricky figuring out which parsers are in the stack at
which point.

8969147c : Fix case where the int[] attrs doesn't directly match a styleable.

In the case of the FastScroller the int[] is a custom mix of attr
instead of a int[] that exists as R.styleable.foo.

This makes our reflection based mechanism used to find the styleable
fail, so instead we search for each attribute separately (like
we probably should have done from the beginning).

0c264b35: Fix various cases of getDimension to report error if unit is missing.

if getDimention###() is called for a string that has no unit,
then an error is output through LayoutLog, but the rendering keeps
going by using dp as a default.

0beb7eea: Make (Bridge)TypedArray.getInteger() call out to getInt()

Only getInt() resolved attribute flags/enum and I'm not sure why
there's two to begin with.
2011-06-16 13:23:53 -07:00
Xavier Ducrohet
66743a1ec0 Fix changed native method delegates in layoutlib for ICS.
Change-Id: I49306868cd8a41b6b7d919c3e8b108d5c014530e
2011-06-15 14:43:42 -07:00
Xavier Ducrohet
2dcb6e80b9 am 48305f32: am 2e0f7118: am 8ee28811: Merge changes Idbb70f53,I10426a3f into honeycomb-mr2
* commit '48305f327ff3839ddbfa5a6fb42a57150a69480c':
  Merge 06942bc4 from hc-mr1.
  Merge 988eeeb5 from hc-mr1.
2011-06-10 10:31:52 -07:00
Xavier Ducrohet
45b662e1bc Merge 06942bc4 from hc-mr1.
Layoutlib - use the new getParser callback when possible.

Change-Id: Idbb70f5391addd539afa5c2f5b55c70beefed223
2011-06-08 17:11:40 -07:00
Xavier Ducrohet
beb5fb622b Merge 988eeeb5 from hc-mr1.
Support for custom declare-styleable attr with enum/flag in layoutlib.

Change-Id: I10426a3f2c76bed207c03fab7885b4269337a70f
2011-06-08 17:10:11 -07:00
Xavier Ducrohet
f18e311ee5 am abc83871: am f6e47999: am 2a6dc7f1: Merge "Import the Layoutlib from hc-mr1." into honeycomb-mr2
* commit 'abc838716816107754ab0479242d03807ce79fc2':
  Import the Layoutlib from hc-mr1.
2011-06-07 17:17:11 -07:00
Xavier Ducrohet
fb93ce9684 Import the Layoutlib from hc-mr1.
This is squash commit of all the missing patches.

Change-Id: Ie081c46a173290646deddbde503a720d50c4400f
2011-06-03 19:38:14 -07:00