301 Commits

Author SHA1 Message Date
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
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
d292d2a031 Merge 36a3a392 from mr1.
Protect against OOB index in BridgeTypedArray.

Change-Id: I40be1e039f9eb36c182b6522bd50d6ed98e15b5c
2011-07-11 12:02:51 -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
Brett Chabot
01f0fd84d0 Include testdata in layoutlib-tests.
Change-Id: I79fff895a13d171079b59db54d4b9d2bec555b3c
2011-06-17 17:03:20 -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
Xavier Ducrohet
9f23e60b20 am a13462a9: am 582841e7: am b18e700c: am aa0834e3: Merge "LayoutLib: support the new baseline/margin query API." into honeycomb-mr1
* commit 'a13462a947e634a6893119146a7271369e509586':
  LayoutLib: support the new baseline/margin query API.
2011-05-19 08:58:18 -07:00
Xavier Ducrohet
05b7b69c6c LayoutLib: support the new baseline/margin query API.
Change-Id: I856489df655960820b8eaa4c6179515a5c069b00
2011-05-16 16:29:03 -07:00
Xavier Ducrohet
8c2f85d941 am d0054160: am 6d040a7f: am 738c5e60: am 2fae858d: LayoutLib: implement data binding for most AdapterView
* commit 'd00541603fbbb4e38264e75a2b6abf8705efeb49':
  LayoutLib: implement data binding for most AdapterView
2011-05-13 16:43:37 -07:00
Xavier Ducrohet
2fae858db5 LayoutLib: implement data binding for most AdapterView
Change-Id: I27be96ed2c37573eb22cfbb391d96b6137b3df8c
2011-05-13 15:55:49 -07:00
Xavier Ducrohet
515a08b018 Merge 59aad78e from master. do not merge.
LayoutLib: don't render when shader's local matrix is set to 0 scale.

Change-Id: I02c0ddd856026357f468dcc8b81e0520470118de
2011-04-07 12:02:31 -07:00
Xavier Ducrohet
c5aeac7f15 LayoutLib: Fix issue with rendering mode.
When the layout content is embedded inside a decor layout
to emulate system bar (top or bottom) and title bar (or action bar)
then the code computing the full required size based on the RenderingMode
would fail because the decor layout would prevents the content layout to
take as much room as possible.
There is also an issue with the way we know render dialogs as the
dialogs usually as a frame with some padding and the previous measurements
would not take into account the dialog padding when increasing the
screen size.

This fix makes the code measure the size of the content layout in the
normal rendering, and then separately from the root layout with the proper
MeasureSpec to let the content grown. The difference in size is then added
to the screen size.

Bug: http://code.google.com/p/android/issues/detail?id=15892

Change-Id: Ibb9ca2a67c6c450d10d9f9a8050536e094650f8b
2011-04-05 20:45:48 -07:00
Xavier Ducrohet
67450db03e LayoutLib: TypedArray.getDimensionPixelSize can actually return <0
Change-Id: I17853dc242e28f0c59916cad1b2a57beed480a57
2011-03-17 14:11:23 -07:00
Xavier Ducrohet
9d76581faf LayoutLib: Fix Arc rendering.
Looks like Java2D and Skia go in different directions for angles.

Change-Id: Ia0c9c70cd66c9a0941fa9921fecf8e4e83538af3
2011-03-14 15:12:21 -07:00
Xavier Ducrohet
adaa12cd9e LayoutLib: fix Capabilities and getDimensionPixelSize
Commented out a Capability that is not in ADT 10.

BridgeTypedArray.getDimensionPixelSize shouldn't call
getDimension since most of the code is duplicated, and
it prevents use from properly detecting malformed attribute
values.

Change-Id: I005b17061590dc0668729af16e896fad815f1973
2011-03-08 15:00:35 -08:00
Xavier Ducrohet
6f2fb57064 LayoutLib: Fix dimension parsing to handle negative value.
Also make TypedArray.getDimensionPixelSize properly
handle negative values (which are not allowed).

Change-Id: I960fc1c9e8ad97852d4a14e4f0f71a2c2034b4e7
2011-03-07 20:50:21 -08:00
Xavier Ducrohet
c12b409351 LayoutLib: Implement some missing add###() method in Path.
Change-Id: Ib62b5df0361ba81846483b1e5f8d7cbdbcb57d40
2011-03-07 20:19:38 -08:00
Dianne Hackborn
6482517101 Fix issue #3485923: Gmail crash
Allow application to try to recover if a surface OOM error
happens on the client side.

Change-Id: I0308bd99647a35e4bcac448340b7fc6330a828f6
2011-03-02 22:38:58 -08:00
Xavier Ducrohet
a4510a7575 LayoutLib: fix incorrect indices in one of the 2 native_drawTextRun methods.
Fixes http://b.android.com/15007

Change-Id: Iff06180def92c5fa25e82520b76192c089edd8cc
2011-02-24 18:58:27 -08:00
Xavier Ducrohet
1911a6f781 LayoutLib: move tests to their own project.
Change-Id: I8a9e128e4a17ab57ec7b126a378035d9ce5bc168
2011-02-24 13:51:26 -08:00
Xavier Ducrohet
f0a53435f1 LayoutLib: Add debug mode.
Change-Id: If4263c7dba63a063f84e0c6988c270eb6d291ac3
2011-02-23 18:12:49 -08:00
Xavier Ducrohet
b2c7dd5986 LayoutLib: downsize the SparseArray when possible.
Change-Id: I570b93ab161414b7729f8d2dce8ddadb706f186b
2011-02-23 15:02:58 -08:00
Xavier Ducrohet
c6083f2c9e LayoutLib: misc fixes.
- implement some Paint methods that are needed for 2.x
- fix the phone system bar to display the icons on the right.

Change-Id: I3a938b14ec9a449dbc23a33303a3c8405a5369a8
2011-02-23 12:00:42 -08:00