931 Commits

Author SHA1 Message Date
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
Xavier Ducrohet
f8aea99385 Make aapt ignore tools-related data.
This patchset introduces a new standard namespace http://schemas.android.com/tools
which will be used for tools specific XML attributes.
Any attributes using this namespace will not be compiled into the binary XML file.

The namespace node is also not written at all, and its string is not collected
to ensure that there is no impact on the devices.

(cherry picked from commit a5d5e9d906583ebeb590ca200ca9840302a5cd1a)

Change-Id: I62937b8bc34c07ac544930aa8eadd7797e0179d5
2012-02-06 11:25:28 -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
Raphael
7c3bef85da Merge "AAPT fix printf %zd crash on Windows". Do not merge.
There's no printf %zd on Mingw/Cygwin so the verbose
printf crashes aapt.

SDK bugs: 20395, 20986

Bug: 5742142

(cherry picked from commit f51125d8429ffa71c57ba6fbdca9effc72642a9b)

Change-Id: I7545734ce8ce4a1f3e95f8a255daa8a909f870a1
2011-12-11 13:59:02 -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
Iliyan Malchev
64ef6b47e0 add -ldl to host executables
This fixes the build on Linux when RefBase is compiled with reference tracking
enabled.

Change-Id: I3e931e0b463ce836f6fdb30c37068d77144631a3
Signed-off-by: Iliyan Malchev <malchev@google.com>
2011-10-20 16:21:25 -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
Dianne Hackborn
bd9d2bcdeb Whoops, remove left-over debug output.
Change-Id: Ib30571b22a6750629f975319a403d38de5e9462c
2011-10-16 14:17:07 -07:00
Dianne Hackborn
e6b680364d New aapt feature to do smarter filtering of configurations.
This adds a --preferred-configurations flag that specifies the
specific configurations you would like to have.

It is smarter than "-c" because it will avoid stripping a
configuration if that would result in there being no value
for the resource.

It is dumber than "-c" because it can't process as many kinds
of resources.  It is really only intended for bitmaps and use
with density configs.

This required re-arranging AaptAssets to group files together
by config again, like they used to be.  I think this hasn't
broken anything.  Hopefully.

Change-Id: I4e9d12ff6e6dbd1abb8fd4cb1814c6674b19d0e5
2011-10-16 11:52:17 -07: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
58b9157549 Merge "LayoutLib: Fix native delegate for Display." 2011-09-30 09:41:35 -07:00
Xavier Ducrohet
387d078e64 LayoutLib: Fix native delegate for Display.
Change-Id: If097cae2309d340162b3bac1d0f6a2289635adca
2011-09-29 18:33:50 -07:00
Kenny Root
56088a55ca Add package-verifier to aapt dump badging
Print out the package-verifier information when printing out badging.

Change-Id: I9c79c163261d5d4f1094bda76d90b3ff6e1ce540
2011-09-29 13:49:48 -07:00
Eric Fischer
4f217d5ace am a94489b4: Merge "Don\'t lose product variant strings that also vary between locales." into ics-factoryrom
* commit 'a94489b4394350b1727437818cd4f6d845e97dc0':
  Don't lose product variant strings that also vary between locales.
2011-09-28 17:03:07 -07:00
Eric Fischer
914f7e683a Don't lose product variant strings that also vary between locales.
Localized strings with product variants were not being included in the APK,
apparently because the check to ensure that a different variation of the
string had not already been included in the APK was matching the version
of it from the default, untranslated configuration.

Now check to make sure that the string not only exists but also exists in
the correct configuration.

Bug 5372711

Change-Id: I52975570b75e0f11827dc6bcf1cb4a987d0541aa
2011-09-27 16:09:41 -07:00
Jeff Brown
4c253119db Merge "Prevent unintended rotations. Bug: 4981385" 2011-09-23 18:28:01 -07:00
Jeff Brown
c0347aa19f Prevent unintended rotations.
Bug: 4981385

Changed the orientation listener to notify the policy whenever
its proposed orientation changes, and changes the window manager
to notify the orientation listener when the actual orientation
changes.  This allows us to better handle the case where the
policy has rejected a given proposal at one time (because the
current application forced orientation) but might choose
to accept the same proposal at another time.

It's important that the proposal always be up to date.  A proposal
becomes irrelevant as soon as the phone posture changes such
that we can no longer determine the orientation with confidence
(such as when a device is placed flat on a table).

Simplified the orientation filtering.  Now we just wait 200ms
for the device to be still before issuing a proposal.  The idea
is that if the device is moving around a lot, we assume that
the device is being picked up or put down or otherwise in
the process of being moved.  We don't want to change the rotation
until that's all settled down.  However, we do want to tolerate
a certain amount of environmental noise.

(The previous confidence algorithm was also designed along
these lines but it was less direct about waiting for things
to settle.  Instead it simply made orientation changes take
longer than usual while unsettled, but the extra delay was often
too much or too little.  This one should be easier to tune.)

Change-Id: I09e6befea1f0994b6b15d424f3182859c0d9a530
2011-09-23 17:26:09 -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
Xavier Ducrohet
18fff11e15 Add new dependency generation option to aidl.
The SDK build system does not provide an output file
and instead uses the -o<FOLDER> option and lets aidl figure
out the intermediary folders that represents the packages,
and the filename based on the input file (and its package).

Because of this the -d<FILE> option to generate a dependency
file is not convenient.

Instead the new option, -a (no parameters), automatically generate
a dependency files next to the output file.

Also, when compiling parcelable aidl files, without the -b option,
a dependency file is still generated. This is used by the SDK build
system since it cannot parse the file separately and instead tries
to compile every .aidl file.
The generation of this dependency file (which shows no output) allows
to know when any type of aidl file has been compiled.

Change-Id: If81dc7e1e0a780592c94d1850a1d1b094d6e7908
2011-09-01 14:14:14 -07: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
1797d6086f am d98e1be2: am f4750724: am 9d829f98: am 21e6e2de: Merge "Change generated dependency file names"
* commit 'd98e1be20e1cca5c36c7e0344500d4a5574568aa':
  Change generated dependency file names
2011-08-18 14:51:43 -07:00
Xavier Ducrohet
d98e1be20e am f4750724: am 9d829f98: am 21e6e2de: Merge "Change generated dependency file names"
* commit 'f4750724cf8db972a052cb388dc9a39fc7aa6dd6':
  Change generated dependency file names
2011-08-18 14:48:49 -07:00
Xavier Ducrohet
f4750724cf am 9d829f98: am 21e6e2de: Merge "Change generated dependency file names"
* commit '9d829f98dc19edecb2305b61b9c79517c4f95383':
  Change generated dependency file names
2011-08-18 14:45:36 -07:00
Josiah Gaskin
b711f3f7ee Change generated dependency file names
This changes the name of the generated dependency files to R.java.d
and <ApkName>.ap_.d respectively.

Change-Id: I17e18770fc0d0a5d31c7b37b40ac1949f45ef13a
2011-08-16 08:14:51 -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
Xavier Ducrohet
395c86f7f6 am 6abf2f50: am 0b45ca88: am cd01ad7c: am 20339b24: Merge "Remove Debug Code"
* commit '6abf2f501e60132a5369ad5b15b388912c8e9e5b':
  Remove Debug Code
2011-07-27 18:43:32 -07:00
Xavier Ducrohet
6abf2f501e am 0b45ca88: am cd01ad7c: am 20339b24: Merge "Remove Debug Code"
* commit '0b45ca8884acfd2e9ccdcb3fbe641a46b116bda0':
  Remove Debug Code
2011-07-27 18:40:49 -07:00
Xavier Ducrohet
0b45ca8884 am cd01ad7c: am 20339b24: Merge "Remove Debug Code"
* commit 'cd01ad7cc7813e3067826945c2a472602f1d3509':
  Remove Debug Code
2011-07-27 18:38:50 -07:00
Xavier Ducrohet
20339b2439 Merge "Remove Debug Code" 2011-07-27 18:26:01 -07:00
Josiah Gaskin
7a09ccfb50 Remove Debug Code
This change removes debugging code from FileFinder.
This code was considered harmful because it uses the std::cout
from <iostream>.

Change-Id: Iad9b5e8a631883bd4854abdb29bc6df8a5b4a056
2011-07-27 17:45:32 -07:00
Jeff Brown
3d5a703db8 Merge "Report the external display size to the input reader." 2011-07-27 15:54:50 -07:00
Kenny Root
388432ac43 Merge "Change ZipFile flags anonymous enum" 2011-07-27 15:54:39 -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