Commit Graph

47 Commits

Author SHA1 Message Date
Steve Block a19954ab37 Rename (IF_)LOGI(_IF) to (IF_)ALOGI(_IF) DO NOT MERGE
See https://android-git.corp.google.com/g/156801

Bug: 5449033
Change-Id: Ib08fe86d23db91ee153e9f91a99a35c42b9208ea
2012-01-04 20:05:49 +00:00
Joe Onorato 99c520a069 Add a new ui mode for "appliance"
The idea is that this is a device which is more-or-less headless.  It
might have some limited interaction capabilities, but it's not something
that you want to rely on having.

Change-Id: Ib92f53a120bf83de781728011721a4859def7d9f
2011-12-15 16:16:14 -08:00
Dianne Hackborn 199512446d am a8d7ea06: am 220cd77d: Merge "Enforce public resource restriction on bag parents." into honeycomb-mr2
* commit 'a8d7ea067cf22baeee2ff0a33e5a8c5a35936942':
  Enforce public resource restriction on bag parents.
2011-06-09 16:06:07 -07:00
Dianne Hackborn d4bfc93113 Enforce public resource restriction on bag parents.
Need to put some more styles in the SDK to avoid breaking apps.

Also, welcome Android 3.2.

Change-Id: Ia31d07c9b1b91ad868d8630437fdc1b5ae24f37d
2011-06-09 15:27:39 -07:00
Dianne Hackborn caf5f71308 am 528c49f1: am b96cbbd1: Add "tv" density for 720p screens.
* commit '528c49f112dce5f9687f30a9751e783196eca0c6':
  Add "tv" density for 720p screens.
2011-05-27 14:27:46 -07:00
Dianne Hackborn c6291e0ff4 Add "tv" density for 720p screens.
Change-Id: I028969b007f2fceea66947d77a2ae31ef1d1a630
2011-05-27 13:40:26 -07:00
Dianne Hackborn fff4e3f140 am c058d386: am ff762299: Merge "Small fixes and cleanup of resource config handling." into honeycomb-mr2
* commit 'c058d38602a1ffe00e14b4ab32c876c252eabe6d':
  Small fixes and cleanup of resource config handling.
2011-05-27 12:47:59 -07:00
Dianne Hackborn c3f07924a5 Small fixes and cleanup of resource config handling.
Change-Id: I402c31b68f2b4825cb4c610a65ee8e1da471c7bb
2011-05-27 12:09:11 -07:00
Dianne Hackborn 2f118cd350 am 4bb78889: am 40277df7: Merge "Add "television" mode." into honeycomb-mr2
* commit '4bb78889d04594c01a6af7f6d38c1764e9f575f9':
  Add "television" mode.
2011-05-23 16:16:54 -07:00
Dianne Hackborn a6b34ef26a Add "television" mode.
Change-Id: Ida1fdb61b036a8b489dbeda196fb4bc82e651b2b
2011-05-23 15:11:08 -07:00
Dianne Hackborn 7583282db6 am c851ea56: am 69cb8757: Add new "-swNNNdp" resource qualifier.
* commit 'c851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a':
  Add new "-swNNNdp" resource qualifier.
2011-05-19 19:34:21 -07:00
Dianne Hackborn 22585947ff Add new "-swNNNdp" resource qualifier.
Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
2011-05-19 18:23:29 -07:00
Dianne Hackborn 89178d4de2 am 46a282f3: am 0ed2e845: Merge "DO NOT MERGE. Integrate add new screen width/height in "dp" configs." into honeycomb-mr2
* commit '46a282f323bc05606e4fe1eba795bd9ac7c99819':
  DO NOT MERGE.  Integrate add new screen width/height in "dp" configs.
2011-05-13 11:21:26 -07:00
Dianne Hackborn 88c0d696cc DO NOT MERGE. Integrate add new screen width/height in "dp" configs.
You can now specify resource configuration variants "wNNNdp"
and "hNNNdp".  These are the minimum screen width/height in "dp"
units.  This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes.  Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted.  To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I4acb73d82677b74092c1da9e4046a4951921f9f4
2011-05-12 18:39:51 -07:00
Kenny Root f6bbefd581 resolved conflicts for merge of 87b3c0dc to honeycomb-plus-aosp
Change-Id: Ia1a0024aabf531438203eb9fea3a10dd15eabe53
2011-04-12 10:27:15 -07:00
Mårten Kongstad 5f29c87ef2 Runtime resource overlay, iteration 1.
Runtime resource overlay allows unmodified applications to appear
as if they had been compiled with additional resources defined. See
libs/utils/README for more information.

This commit is the first iteration of runtime resource overlay. It
provides the actual overlay modifications and loading of trusted overlay
packages (ie residing in /vendor) targeting framework-res.apk.

This commit loads exactly one overlay package. The overlay,
if present, must target framework-res.apk and be located at
/vendor/overlay/framework/framework-res.apk.

Change-Id: If26ee7754813004a96c043dba37fbe99fa3919db
2011-04-01 14:12:10 +02:00
Dianne Hackborn 402960177f am a1f5e82f: am a30063d8: am 25eb0464: Merge "Normalize output from aapt d"
* commit 'a1f5e82f37c77af7b1d630b5bca715d1742f1234':
  Normalize output from aapt d
2011-01-29 23:07:48 -08:00
Shachar Shemesh ca6fca93fc Normalize output from aapt d
Make the output from aapt dump --values resources and aapt dump xmltree normalized, so that it is unambigously displayed
regardless of the content of the strings.

Change-Id: Ia3bff36c4ee1e9a44f474534e154830948beabdf
2011-01-04 20:52:08 +02:00
Kenny Root 133cde5805 Add path to get different DPI drawables
Allow a caller to request a different density than their current display
allows. This can mean a device displaying mdpi can get a resource that's
in hdpi and have it pretend to be in mdpi resolution. If a drawable
that's returned is not in the requested density, it will set it at the
appropriate density to be scaled up later on.

The API for this is hidden currently.

Bug: 3134688
Change-Id: I6c3908cbdef4907b8d3f1576df9e3b0e7af1755a
2010-10-29 12:47:07 -07:00
Dianne Hackborn c3ef3ae552 More native work.
Implement save/restore of state, and add native APIs for
configuration information.

Change-Id: I2a3ddc2ba605db58d7c8b2b31b9215fb323f90b5
2010-08-11 00:29:59 -07:00
Dianne Hackborn c93a781c24 New xlarge screen size.
Not complete, only for experimentation at this point.

This includes a reworking of how screen size configurations are matched,
so that if you are on a larger screen we can select configurations for
smaller screens if there aren't any exactly matching the current screen.

The screen size at which we switch to xlarge has been arbitrarily
chosen; the compatibility behavior has not yet been defined.

Change-Id: I1a33b3818eeb51a68fb72397568c39ab040a07f5
2010-04-28 16:51:52 -07:00
Dianne Hackborn 82fecb01df Add ability for some manifest attributes to reference resources.
This loosens our restriction on many manifest attributes requiring
literal string values, to allow various ones to use values from
resources.  This is only allowed if the resource value does not change
from configuration changes, and the restriction is still in place
for attributes that are core to security (requesting permissions) or
market operation (used libraries and features etc).

Change-Id: I4da02f6a5196cb6a7dbcff9ac25403904c42c2c8
2010-03-09 17:18:05 -08:00
Dianne Hackborn 2856c5b19a Refactor car mode.
Extract all UI behavior from dock observer and ACTION_DOCK_EVENT.

Also introduce a desk type to go along with the car type all through
the resource system, since we now need to have corresponding high-level
broadcasts for desk dock mode.  As part of that I also reworked some
of the logic for switching modes to all funnel through a single
update() call that looks all of the current state to decide what to
do next, and fixed various locking issues.

In addition I found there were bugs in the configuration change
handling causing us to only switch into the car mode config and
then never get out of it.  Unfortunately now that we are actually
changing the configuration for each mode change, the transitions
between them are really crummy as we restart all kinds of
activities. :(
2010-03-05 10:57:47 -08:00
Dianne Hackborn 8eca036d24 Fix issue #2448075: aapt doesn't fix up activity-alias android:targetActivity links
And related:

- The aapt tool now sets a resource configurations sdk level to match any configs
  that have been set (for example if you specify density your sdk level will be
  at least 4).
- New option to modify the targetPackage attribute of instrumentation.
- Clean up of aapt options help.
- Fix of UI type values to leave 0 for "unspecified".
- Make the UI mode config APIs public.
2010-03-01 20:42:14 -08:00
Kenny Root 9e333ab42c Use UTF-8 strings to avoid duplicate caching, part 1
StringBlock instances containing UTF-8 strings use a cache to convert
into UTF-16, but using that cache and then using a JNI call to NewString
causes the UTF-8 string as well as two copies of the UTF-16 string to
be held in memory. Getting the UTF-8 string directly from the StringPool
eliminates one copy of the UTF-16 string being held in memory.

This is part 1. Part 2 will include ResXMLParser optimizations.

Change-Id: Ibd4509a485db746d59cd4b9501f544877139276c
2010-02-23 10:02:20 -08:00
Tobias Haamel 70fa84f6ab Introduce special UI modes for night and car usage.
The device mode is now called ui mode. Furthermore is the order of
precedence for the resources now in such a way that the ui mode needs
to be specified after the orientation and before the density.

The ui mode can be set, like it is done for the locale, as follows:

IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY;
am.updateConfiguration(config);

To allow users to disable the car mode and set the night mode the IUiModeManager
interface is used.

The automatic night mode switching will be added in a separate change.
2010-02-11 21:25:58 +01:00
Kenny Root ccb5b89029 Add string resource type inspection
Allows "aapt dump --values resource" to print out whether a string in a
ResStringPool is in UTF-8 or UTF-16 encoding.

Change-Id: I6478884a70a3b46fee862dece6cb33454fc34843
2009-12-10 14:22:08 -08:00
Kenny Root 92f5984d2c Optional use of UTF-8 strings in resource bundles
Allows the use of UTF-8 for packing resources instead of the
default of UTF-16 for Java. When strings are extracted from the
ResStringPool, they are converted to UTF-16 and the result is
cached for subsequent calls.

When using aapt to package, add in the "-8" switch to pack the
resources using UTF-8. This will result in the value, key, and
type strings as well as the compiled XML string values taking
significantly less space in the final application package in
most scenarios.

Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
2009-12-07 15:14:15 -08:00
Dianne Hackborn c2a04c3f2d Fix issue #2226370: Resource versions match with equality
Also fixed turned-around increment of version number for resources. :(

Change-Id: I604137272da984bcd69cee4f174e6b7f2c786e46
2009-11-01 21:16:59 -08:00
Dianne Hackborn b5df6d801c Implement issue #1780928: Need support hiding nav keys.
This implements support for devices whose hardware can hide
their navigation keys.  It works much like the existing keyboardHidden
configuration, and for compatibility uses the same configuration
change bit.

Also add FLAG_TURN_ON_SCREEN for windows, which has the system
cause the screen to be turned on when the window is displayed.
Great fun when used with FLAG_SHOW_WHEN_LOCKED!

Change-Id: I0b867f19af85cfd8786a14cea194b34f7bdd9b7a
2009-09-15 22:50:40 -07:00
Dianne Hackborn 3945ae5065 Fix #2018814: System cannot correctly render assets with "wrap_content" attribute in QVGA
It turns out we were not returning the density for anything retrieved from a
TypedArray...  which basically means any bitmap references from a layout or style...!!!

This is now fixed.

Also fiddle with the density compatibility mode to turn on smoothing in certain situations,
helping the look of things when they need to scale and we couldn't do the scaling at
load time.
2009-07-29 19:44:01 -07:00
Dianne Hackborn 60cde60e89 First pass at reworking screen density/size APIs.
This changes the names of the directories in aapt, to what you see
in the list of DpiTest resources.  Also adds a new "long" configuration
for wide screens, which the platform sets appropriate, and introduces
a new kind of resizeability for not large but significantly larger
than normal screens which may have compatibility issues.
2009-07-21 18:28:42 -07:00
Dianne Hackborn b3e8103538 Add "nodpi" density, and expose a bunch of density-related APIs.
Also update the DpiTest app to use nodpi images, and try to have a mode
where it turns off compatibility though it's not quite working.
2009-07-17 16:59:08 -07:00
Dianne Hackborn 0f253efba5 Don't re-parse the framework resources all the time.
A small optimization to the resource code, to not re-parse the framework
resources every time we build a new AssetManager.  Instead, you can now
construct a ResTable from a previously created one...  of course, like the
existing code for using the data in-place, you can't delete the original
ResTable until you have deleted the one that has been constructed from it.
2009-07-06 11:12:37 -07:00
Dianne Hackborn e356292467 Fix issue #1673793: Theme styles don't apply.
It turns out this was not a problem in the resource code at all.  Rather,
the system process has a cache of pre-loaded attributes it uses to avoid
continually reloading things as it needs them.  Well it turns out this
cache wasn't flushed after a package was uninstalled or a configuration
changed, so you could re-install an app where you change its style resources
so its theme now points to one that is inconsistent in the cache.

This is mostly a problem for developers, where they continually install
new versions of an app where resources have changed.  This could possibly
show up when updating an app on a normal phone, although the problem would
eventually correct itself since this cache uses weak references.

Anyway, the cache is now reworked to be flushed appropriately.

This change also includes an update to aapt to be able to dump the
contents of bags in resources.
2009-06-30 13:27:30 -07:00
Dianne Hackborn 21342c5c19 Expand support for different screen sizes.
Applications can now declare that they support small, normal, or
large screens.  Resource selection can also be done based on these
sizes.  By default, pre-Donut apps are false for small and large,
and Donut or later apps are assumed to support all sizes.  In either
case they can use <supports-screens> in their manifest to declare
what they actually support.
2009-06-26 13:37:05 -07:00
Mathias Agopian 52ed26a78b fix warnings that will show up with GCC 4.4 (in master) 2009-06-22 02:35:32 -07:00
Dianne Hackborn be1bc0a1f9 Report densities in badging, debugging for nine patch bug.
The aapt tool now reports all available densities like it already did
for locales.  Also this includes more resource data output, which I
was using to examine bug #1867049 (which at this point I am unable to
reproduce).
2009-06-19 15:13:28 -07:00
Robert Greenwalt fd392958ea Squashed commit of the following:
commit 012b56fc607cf243cf4b29cb2a5f172bcbe0aecd
Author: Robert Greenwalt <robdroid@android.com>
Date:   Wed Apr 22 14:31:26 2009 -0700

    Additional fixes and tests for density.

commit 91fdc8e187551ae69e0029a4325fb3ad38fe411b
Author: Robert Greenwalt <robdroid@android.com>
Date:   Tue Apr 14 14:39:00 2009 -0700

    Fix runtime resource selection logic.

    Fix isBetterThan so that o or this may be supperior at any stage.
    Used to only handle this-better or tie at each stage, biasing against o.
    Also allows reset of unit test to succeed.  Fixes bug 1709202.
2009-04-22 14:35:11 -07:00
The Android Open Source Project 4f68be1a5b auto import from //branches/cupcake_rel/...@140373 2009-03-18 17:39:46 -07:00
The Android Open Source Project edbf3b6af7 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project d5193d9394 auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project 43aa2b1cbf auto import from //depot/cupcake/@132589 2009-03-03 14:04:24 -08:00
The Android Open Source Project 0bb03408de auto import from //depot/cupcake/@137055 2009-03-02 22:54:33 -08:00
The Android Open Source Project a6938bab1f auto import from //branches/cupcake/...@130745 2009-02-10 15:44:00 -08:00
The Android Open Source Project e09fd9e819 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:43 -08:00
The Android Open Source Project 7c1b96a165 Initial Contribution 2008-10-21 07:00:00 -07:00