History log of /frameworks/base/core/java/android/content/res/Resources.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c36c49ee83123d6083c05a3e333ac43a13f664cd 30-Sep-2012 Craig Mautner <cmautner@google.com> Changing debug for b/7094175.

Fixes bug 7094175 (but not really).

Change-Id: Ice2abb93f479ea0bda931e9643710668c25aa285
/frameworks/base/core/java/android/content/res/Resources.java
0cbfcffe7b99eea85dc17e92ef204035fa6fd4f9 18-Sep-2012 Craig Mautner <cmautner@google.com> Add debug for b/7094175.

Change-Id: Iec83b9350bfeb804dfe3da25986138c2dbaa6d45
/frameworks/base/core/java/android/content/res/Resources.java
5f49c3023a512efbef8bc9515d310c7a72be4af2 07-Sep-2012 Romain Guy <romainguy@google.com> The drawables cache strikes again
Bug #7117785

Draawables created from the ConstantState cache found in Resources must be
mutated before they can be safely modified by apps. Failure to do so results
in all drawables sharing the same constant state to be affected by the
modification.

In the case of the bugreport above, the status bar code plays tricks with
a background drawable and modifies its color to implement a fade in/out
effect. This drawable comes from a cached resource (color 0x0) and the
modifications made by the status bar apply to other clients of this drawable,
most notably the recents panel.

This change fixes several things:
- Simplifies colors caching by removing the assetCookie from the key. This
should result in better reuse of cached drawables
- Makes View.setBackgroundColor() honor the mutate() contract
- Ensure StateListDrawable properly mutates its children before modifying
them
- Optimize Bitmap/ColorDrawable to mark them mutated when they are not
created from an existing ConstantSate. The same optimization should be
applied to other drawables in the future

Change-Id: I54adb5d5b914c7d8930bf9b46f7e3f9dcbf4bcab
/frameworks/base/core/java/android/content/res/Resources.java
5f7979993979466c79ab4f38d83c6f2aca361662 16-Jun-2012 Fabrice Di Meglio <fdimeglio@google.com> Add support for "-rtl" in resources

- fix bug #7035019 Need to have "-rtl" support for Resource

Change-Id: Ic82145c2ac672729d8a6c695a5f343276a1a0a2c
/frameworks/base/core/java/android/content/res/Resources.java
34743ac7d688a7ecf4daec84078fc7ec74a6dac9 15-Aug-2012 Dianne Hackborn <hackbod@google.com> Merge "Add API to create new contexts with custom configurations." into jb-mr1-dev
756220bd1912535840388a6743830d2e59ad4964 15-Aug-2012 Dianne Hackborn <hackbod@google.com> Add API to create new contexts with custom configurations.

This allows you to, say, make a Context whose configuration
is set to a different density than the actual density of the device.

The main API is Context.createConfigurationContext(). There is
also a new API on ContextThemeWrapper that allows you to apply
an override context before its resources are retrieved, which
addresses some feature requests from developers to be able to
customize the context their app is running in.

Change-Id: I88364986660088521e24b567e2fda22fb7042819
/frameworks/base/core/java/android/content/res/Resources.java
a5d1dc9d0322d2c7b7d7f13816fd551a7042c2a3 14-Aug-2012 Scott Main <smain@google.com> am bd63fb87: am 6958c161: Merge "docs: misc bug fixes from external issues" into jb-dev

* commit 'bd63fb875c49d69d5969df35ae159bd17cadb730':
docs: misc bug fixes from external issues
183bf116978e3c44292c9ead2bceb47e972624a1 14-Aug-2012 Scott Main <smain@google.com> docs: misc bug fixes from external issues

Change-Id: I380b65341200c0519a93e2f8969f70f64aec0264
/frameworks/base/core/java/android/content/res/Resources.java
dde331cebd87982faded6818ad5f9927ff994c96 03-Aug-2012 Dianne Hackborn <hackbod@google.com> We can now (kind-of) change screen density on the fly.

Preloaded drawables now have a density associated with them, so we
can load the correct drawable if we are using a different density.

Window manager now formally keeps track of the density for each
screen, allowing it to be overridden like you can already do with
size, and relies on this density to drive itself internally and
the configurations it reports.

There are a new set of Bitmap constructors where you provide a
DisplayMetrics so they can be constructed with the correct density.
(This will be for when you can have different windows in the same
app running at different densities.)

ActivityThread now watches for density changes, and pushes them
to the DENSITY_DEVICE and Bitmap global density values for that
process.

A new am command allows you to change the density.
/frameworks/base/core/java/android/content/res/Resources.java
908aecc3a63c5520d5b11da14a9383f885b7d126 01-Aug-2012 Dianne Hackborn <hackbod@google.com> Start moving away from DisplayMetrics.DENSITY_DEVICE.

This puts in most of the infrastructure needed to allow us to
switch between different densities at run time. The main remaining
uses of the global are to initialize the Bitmap object (not sure
what to do about that since it doesn't have anything passed in
the constructor to get this information from), and being able to
load drawables if we need a different density than what was preloaded
by zygote.

Change-Id: Ifdbfd6b7a5c59e6aa22e63b95b78d96af3d96848
/frameworks/base/core/java/android/content/res/Resources.java
fb5c3dba4ddac023cfd4cdcabdfdbcf343197c94 19-May-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6440173: MenuItem.setIcon(Drawable) scaling incorrectly...

...when resource is aliased

We were not correctly using the final resolved configuration when
retrieving a drawable through Resources.getDrawable(). (It already
does the correct behavior when going through TypedArray.getDrawable()).

Change-Id: I9032b788b592412178e31e2e6b0181b92c20fe45
/frameworks/base/core/java/android/content/res/Resources.java
5d911c3a95cf4db4cf1cc0c8d4d253553d50c550 13-Apr-2012 Romain Guy <romainguy@google.com> Properly cache color state lists.

Clobbering the typed value's cookie with the alpha channel is not okay.

Change-Id: Ia75481be06699b42f80eb4c59672c6cd6cf8c0a8
/frameworks/base/core/java/android/content/res/Resources.java
32313b161f7c7d17841bf49b3d146fd19dd7fde1 10-Jan-2012 Dianne Hackborn <hackbod@google.com> am d476c8b8: am d3be0a76: Merge "Unhide Resources APIs for getting resources at specific densities." into ics-mr1

* commit 'd476c8b8a8a6fadea7e72426d3e93c4e6b00e543':
Unhide Resources APIs for getting resources at specific densities.
613989772f7d7f7317349568a4809bf08b942bd7 09-Jan-2012 Dianne Hackborn <hackbod@google.com> Unhide Resources APIs for getting resources at specific densities.

This adds Resources.getDrawableForDensity() and
Resources.getValueForDensity(). These are needed for applications
to correctly retrieve larger icons such as in launcher when
running on a tablet. We had already exposed the APIs to tell the
application which density to use for app icons on the current
device, but didn't unhide these APIs that allowed you to
actually retrieve them.

This is safe to do without introducing a new API level (as long
as we do it soon) because we know these APIs already exist in
Android 4.0, and there is no reason for anyone to be removing
them when building a device.

Change-Id: I5138e5dc908197b66a98d20af73c5374cb5d41d3
/frameworks/base/core/java/android/content/res/Resources.java
8f85e80b64b89fd38cc23b129f61ec36ddde7f15 15-Dec-2011 Romain Guy <romainguy@google.com> Generate even fewer GL commands

Change-Id: I0f4dcacb03ef5ee7f6ebd501df98bfead5f0a7f8
/frameworks/base/core/java/android/content/res/Resources.java
ab0f485e64418eb22f0a1d89d7064902b381e9c2 13-Sep-2011 Dianne Hackborn <hackbod@google.com> Fix problems where we were allocating TypedArray when not needed.

Fixes up some recycling of TypedArray objects to reduce the
number we need to allocate during inflation etc.

Change-Id: I948dccc052997779001eaa99db2a710b04be01ae
/frameworks/base/core/java/android/content/res/Resources.java
9b44aaefc0c8c4aafd176c2fe5af86e098422b56 03-Sep-2011 Dianne Hackborn <hackbod@google.com> Some more preloaded drawables.

More to come.

Change-Id: I28393c6e52553e960d3a765ba793cfdbf36460ff
/frameworks/base/core/java/android/content/res/Resources.java
6e90a362bc66cc67b1beae27b21d3f0148403b08 15-Aug-2011 Adam Powell <adamp@google.com> Fix bug 5159736 - Make DeviceDefault the default

Have the framework refer to the DeviceDefault themes for ICS apps that
don't explicitly request another theme.

Change-Id: I27dd0bbaa60f71df4f36e47d260f556d923ba075
/frameworks/base/core/java/android/content/res/Resources.java
7f9f99ea11051614a7727dfb9f9578b518e76e3c 11-Aug-2011 Xavier Ducrohet <xav@android.com> Make some methods/fields package private so that layoutlib can access them.

Change-Id: I4aeadfbaf8a4f6a459fa19937c21ac23d9e5fb64
/frameworks/base/core/java/android/content/res/Resources.java
2b31d53161789358de57fd396716a6503855c5da 23-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4770360: older app compatibility mode is really tiny on ICS phones

We were applying the density compat mode scaling multiple times to
display metrics, causing bad values.

Change-Id: Iafafd9a5e94b9d774cd2715bf968e91602a1bd82
/frameworks/base/core/java/android/content/res/Resources.java
5fd2169eabd77e6bfafaf456e58051a3bafb2bca 07-Jun-2011 Dianne Hackborn <hackbod@google.com> Work on issue #4518815: Compatibility mode introduces compatibility regression...

...for Market App iRunner

There were a lot of serious issues with how we updated (or often didn't update)
the display and resource state when switching compatibility mode in conjunction
with restarting and updating application components. This addresses everything
I could find.

Unfortunately it does *not* fix this particular app. I am starting to think this
is just an issue in the app. This change does fix a number of other problems
I could repro, such as switching the compatibility mode of an IME.

Also a few changes here and there to get rid of $#*&^!! debug logs.

Change-Id: Ib15572eac9ec93b4b9966ddcbbc830ce9dec1317
/frameworks/base/core/java/android/content/res/Resources.java
2f0b17573d4324832f7a20402a3d2b5920bc4866 01-Jun-2011 Dianne Hackborn <hackbod@google.com> Fix issue #4502672: Wrong xml resources used for homescreen widgets.

There was a race in the system process between applying the initial
configuration and executing code in higher-level system services
like the app widget service that relies on the config. For some
reason it starting showing up more after my code changes; it should
now be completely fixed.

Also fix the activity starting window to run in compatibility mode
if its application is going to be in compatibility mode.

And some various cleanup and small fixes.

Change-Id: I0566933bf1bbb4259c1d99a60c0a3c19af1542e5
/frameworks/base/core/java/android/content/res/Resources.java
3904d03dd01dcd43c446744e44b34615825d9679 27-May-2011 Dianne Hackborn <hackbod@google.com> Small fixes and cleanup of resource config handling.

Change-Id: I402c31b68f2b4825cb4c610a65ee8e1da471c7bb
/frameworks/base/core/java/android/content/res/Resources.java
5be8de3420ba4c9d816b98e29bdec11715f6b626 25-May-2011 Dianne Hackborn <hackbod@google.com> More compatibility mode improvements.

We now correctly adjust display metrics, fixing for example issues
seen in Barcode Scanner. In addition the decision about when to use
compatibility mode has a bug fixed where certain apps would not go
out of compatibility mode even though they should be able to.

Change-Id: I5971206323df0f11ce653d1c790c700f457f0582
/frameworks/base/core/java/android/content/res/Resources.java
69cb87576ba163b61bb0e6477a3b7c57a9b11d40 20-May-2011 Dianne Hackborn <hackbod@google.com> Add new "-swNNNdp" resource qualifier.

Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
/frameworks/base/core/java/android/content/res/Resources.java
ebff8f92f13513ce37bd74759eb1db63f2220590 13-May-2011 Dianne Hackborn <hackbod@google.com> 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
/frameworks/base/core/java/android/content/res/Resources.java
e2515eebf42c763c0a2d9f873a153711778cfc17 28-Apr-2011 Dianne Hackborn <hackbod@google.com> Better compat mode part one: start scaling windows.

First step of improving app screen size compatibility mode. When
running in compat mode, an application's windows are scaled up on
the screen rather than being small with 1:1 pixels.

Currently we scale the application to fill the entire screen, so
don't use an even pixel scaling. Though this may have some
negative impact on the appearance (it looks okay to me), it has a
big benefit of allowing us to now treat these apps as normal
full-screens apps and do the normal transition animations as you
move in and out and around in them.

This introduces fun stuff in the input system to take care of
modifying pointer coordinates to account for the app window
surface scaling. The input dispatcher is told about the scale
that is being applied to each window and, when there is one,
adjusts pointer events appropriately as they are being sent
to the transport.

Also modified is CompatibilityInfo, which has been greatly
simplified to not be so insane and incomprehendible. It is
now simple -- when constructed it determines if the given app
is compatible with the current screen size and density, and
that is that.

There are new APIs on ActivityManagerService to put applications
that we would traditionally consider compatible with larger screens
in compatibility mode. This is the start of a facility to have
a UI affordance for a user to switch apps in and out of
compatibility.

To test switching of modes, there is a new variation of the "am"
command to do this: am screen-compat [on|off] [package]

This mode switching has the fundamentals of restarting activities
when it is changed, though the state still needs to be persisted
and the overall mode switch cleaned up.

For the few small apps I have tested, things mostly seem to be
working well. I know of one problem with the text selection
handles being drawn at the wrong position because at some point
the window offset is being scaled incorrectly. There are
probably other similar issues around the interaction between
two windows because the different window coordinate spaces are
done in a hacky way instead of being formally integrated into
the window manager layout process.

Change-Id: Ie038e3746b448135117bd860859d74e360938557
/frameworks/base/core/java/android/content/res/Resources.java
179a3bda60044cf191ce9f47e3349398fc32bafb 18-Feb-2011 Jesse Wilson <jessewilson@google.com> Save a few bytes on the zygote heap.

The default LongSparseArray constructor builds two 10-element
arrays that we don't need.

Change-Id: I83ef4fbd8825109087cbe8990ad66d79eab33e5c
/frameworks/base/core/java/android/content/res/Resources.java
f4f05b8f24183b9e0d6959fe8b71fb88543edd9b 07-Jan-2011 Scott Main <smain@google.com> Update package descriptions with editorial revisions.
Notably, this removes exessive info about resources
from the content package, because it's not a good location
and the info is avilable in the dev guide, but also
added some of the info to the Resources class description.

Change-Id: Ie78af26c9cec66314deb98e53078f48e16c08e70
/frameworks/base/core/java/android/content/res/Resources.java
3b81bc18bb661c02ad8074c39dab16644c1e65d0 15-Jan-2011 Dianne Hackborn <hackbod@google.com> Add manifest API to request a large heap.

You can now do android:largeHeap="true" on an application.

Doesn't yet do anything, waiting for Dalvik API.

Also tweak package parsing so that the SDK API level is set in the
configuration, allowing manifest resource value selection based on
that.

Change-Id: I6e035f9702a97b055416743b88f83a22ba4a9584
/frameworks/base/core/java/android/content/res/Resources.java
6efd2bad954e0e5bd74916a32f036a0f149dcd4d 13-Jan-2011 Christopher Lais <chris+android@zenthought.org> Don't drop the drawable cache completely on configuration change

There was a lot of fancy code just above the clear to ensure
that drawables that aren't affected by the change are kept,
then the entire array was cleared. This patch removes the
clear, so that the drawables that haven't changed are really
kept, matching the logs, comments and larger part of the code.

This patch also fixes the various constant states to return
correct ChangingConfigurations.

Change-Id: Ic11f6179537318d3de16dc58286989eb62a07f15
Old-Change-Id: I22495e6ed232dfe056207ce5155405af1fa82428
/frameworks/base/core/java/android/content/res/Resources.java
d922ae01ca99a2b6d39a9393f86776a1d10ebd14 14-Jan-2011 Dianne Hackborn <hackbod@google.com> Add Holo theme for IMEs.

Also clean up theme selection code to get rid of duplication.

Change-Id: Idf7b21db70ee83fce24756ead877169bd08b77a9
/frameworks/base/core/java/android/content/res/Resources.java
55fc850cf992cdcb0993cb109d2f716613c0dbdd 28-Oct-2010 Kenny Root <kroot@google.com> 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
/frameworks/base/core/java/android/content/res/Resources.java
def1537e9e8d0dd190cde5310ddae8b921088c9b 15-Aug-2010 Dianne Hackborn <hackbod@google.com> More fragment work:

- Introduce FragmentManager as a public API, deprecating the fragment
APIs on Activity. (They will be removed soon.)
- Add APIs to write a fragment reference to a bundle and later retrieve
it.
- Add Fragment API to set another fragment as its target, for delivering
results.
- Change when onInflate() is called and formalize its meaning in relation
to the fragment arguments that were previously introduced.
- Change onDestroyView() to always be called, regardless of when
onCreateView() returns. It now also is called slightly differently,
after the view hierarchy's state is saved.
- Fix some issues with DialogFragment's lifecycle with its associated
Dialog and state save/restore.
- Preference can now have a Bundle associated with it to provide
arguments to a fragment. The data for this Bundle call be supplied
via <extra> tags under a PreferenceScreen.
- PreferenceActivity's header XML tags are now <preference-headers>
and <header>, and you can supply <extra> tags under a <header> to set
arguments for the header's fragment.

Change-Id: I22c212c9fa862d50840201ca16e51f9de5ef0031
/frameworks/base/core/java/android/content/res/Resources.java
7b6d0d99b6904b511996267efae215fe9cb5e98f 11-Aug-2010 Dianne Hackborn <hackbod@google.com> am 679ac09a: am a5ae50cd: Merge "More native work." into gingerbread

Merge commit '679ac09a5c22175354f3a04b28456b323839530e'

* commit '679ac09a5c22175354f3a04b28456b323839530e':
More native work.
679ac09a5c22175354f3a04b28456b323839530e 11-Aug-2010 Dianne Hackborn <hackbod@google.com> am a5ae50cd: Merge "More native work." into gingerbread

Merge commit 'a5ae50cd838b5725c63ed485292aae4edd1a98cb' into gingerbread-plus-aosp

* commit 'a5ae50cd838b5725c63ed485292aae4edd1a98cb':
More native work.
08d5b8fad8d46ccb64db2fdcb4d66972ec87bf48 04-Aug-2010 Dianne Hackborn <hackbod@google.com> More native work.

Implement save/restore of state, and add native APIs for
configuration information.

Change-Id: I2a3ddc2ba605db58d7c8b2b31b9215fb323f90b5
/frameworks/base/core/java/android/content/res/Resources.java
63ae85f0e17f09892e87e2b02de38599289eac5a 21-Jul-2010 The Android Open Source Project <initial-contribution@android.com> am 42ef77f3: merge from open-source master

Merge commit '42ef77f3603ae54990d6718db79afae61e91dc61'

* commit '42ef77f3603ae54990d6718db79afae61e91dc61':
Shoud specify the Resource class instance as an argument of the method
708654c0b8d45001bc333a3b7b9fd845c81c6f26 20-Jul-2010 Masanori Ogino <ogino.masanori@sharp.co.jp> Shoud specify the Resource class instance as an argument of the method
newDrawable and change the name from 'DrawableCacheClear' to 'clearDrawableCache'
(additional changes for ID:15815)
https://review.source.android.com/#change,15815

Change-Id: I6bf19b8e6e187df8c8e3cb57d9e04278ddfe5055
/frameworks/base/core/java/android/content/res/Resources.java
bf4564f03daf9a43bafae8cbfe6c3cecd60847f0 16-Jul-2010 The Android Open Source Project <initial-contribution@android.com> am 5adfe6c5: merge from open-source master

Merge commit '5adfe6c56369b48e10493c0bb9e9b64ac553a19f'

* commit '5adfe6c56369b48e10493c0bb9e9b64ac553a19f':
Fix the problem that color drawable cache key conflicts another drawable one.
c7d9d2790f0b7a036d70bac2f100b42790ff0979 09-Jul-2010 Masanori Ogino <ogino.masanori@sharp.co.jp> Fix the problem that color drawable cache key conflicts another drawable one.
The cache key of a color drawable resource may be the same as another
drawable resource's value.

Change-Id: Ia971bb242ceac5e8f9346094009a10f356399ab9
(Reduced duplicated codes and replace TAB to white spaces)

And try to fix compile error.
/frameworks/base/core/java/android/content/res/Resources.java
1ad636c31501b1f407a3bf504d14689c1d5c7f5a 02-Jul-2010 Elliott Hughes <enh@google.com> Defer to ICU's knowledge of language-specific grammatical quantity rules.

Also improve the documentation to make it a little less unclear what this
is all about. In particular, explain why the original submitter's complaint
about "zero" never being used in English, is expected behavior.

Bug: 2663392
Change-Id: Iade3b4f5c549ce01a95fd0e7e5c6ea394178eda3
/frameworks/base/core/java/android/content/res/Resources.java
2269d1572e5fcfb725ea55f5764d8c3280d69f6d 25-Feb-2010 Dianne Hackborn <hackbod@google.com> Re-arrange android-common so framework no longer links with it.

This is the framework part, moving classes around so the framework
no longer needs to link to android-common. Makes some APIs public,
others that didn't need to be public are private in the framework,
some small things are copied.
/frameworks/base/core/java/android/content/res/Resources.java
e36d6e277e49475076b7872d36ea6a5c5b996e9d 18-Feb-2010 Dianne Hackborn <hackbod@google.com> Work on issue #2263557: PMF3000 showing hybrid of portrait and landscape modes

This is a bunch of reworking of how configuration changes are handled:

- When orientation is changing (for whatever reason), the window manager no
longer tries to pre-emptively compute a new configuration. Instead, it
just determines change is happening and tells the window manager.
- The activity manager is now responsible for giving the window manager the
final configuration it is using. This is both so it knows whem the
activity manager is done with its configuration updates, and so the window
manager can use the "real" configuration.
- When an orientation or other configuration change is happening, freeze the
screen and keep it frozen until the activity manager has given us the
final configuration.
- The window manager can now send new configurations to its clients during
its layout pass, as part of a resize, if it has determined that it has
changed. This allows for a new View.onConfigurationChanged() API for any
view to easily find out when the configuration has changed.
- ViewRoot now also works with the activity thread to make sure the process's
current resources are updated to the new configuration when it receives one
from a window. This ensures that at the time onConfigurationChanged() and
other view callbacks are happening, the correct configuration is in force.
- There is now a sequence number associated with Configuration, which
ActivityThread uses to avoid using stale configurations. This is needed now
that it can receive configurations asynchronously from both the window
manager and activity manager.
- The hack for keeping the locale has been removed, and underlying problem
fixed by having Configuration initialize its locale to "unknown" instead of
a valid default value.
/frameworks/base/core/java/android/content/res/Resources.java
27b28b3f62bd3b54fa13acd5d035940b9be464f3 09-Feb-2010 Tobias Haamel <haamel@google.com> 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.
/frameworks/base/core/java/android/content/res/Resources.java
d4a4729c0cac582a2dcec7c8cfb316b81885a0f0 21-Dec-2009 Tom Taylor <tomtaylor@google.com> Update imports to android-common

Several files were moved to android-common. Update all the references
to import those files from the new location.
/frameworks/base/core/java/android/content/res/Resources.java
553399518f39cd9f31f2bb6f502866c3c9d6d1a5 02-Nov-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2226370: Resource versions match with equality

Also fixed turned-around increment of version number for resources. :(

Change-Id: I604137272da984bcd69cee4f174e6b7f2c786e46
/frameworks/base/core/java/android/content/res/Resources.java
3b3e145d3c41fd68974e08f799b1fd1f8f060cf0 25-Sep-2009 Dianne Hackborn <hackbod@google.com> A variety of work on animations.

- The lock screen now fades in and out.
- Fixed a bug where we would accidentally freeze the screen when switching
to an activity with a different orientation than the current (but
the screen itself is in the current orientation). This would mess up
the animations on the car dock.
- New API to force a particular animation for an activity transition
(untested).
- New wallpaper animations.
- Resources now uses the next API version when in a development build,
to help applications being developed against such builds.

Change-Id: I2d9998f8400967ff09a04d693dc4ce55f0dbef5b
/frameworks/base/core/java/android/content/res/Resources.java
c2974809373697147cbe5754835cc871fb93aef1 14-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2116977: buttons are huge and bent

Now that we are using preloaded drawables in compatibilty mode, when
constructing them from their constant state we need to set the new
drawable's target density appropriately.

Change-Id: I3665cbea09d38b9ac5f45f8c380dc8641f86b266
/frameworks/base/core/java/android/content/res/Resources.java
19382ac1a4e4e7c23a1346d299368763f149de9c 12-Sep-2009 Dianne Hackborn <hackbod@google.com> Some optizations to wallpaper drawing/scrolling.

First, fix some issues with the final wallpaper bitmap
we use: ensure it is always 16bpp, and make sure dithering
of its bitmap is turned off. We take of dithering
when loading, to make sure we don't use it when drawing.

Also add new APIs to return the wallpaper with the equivalent
of Launcher's old FastBitmapDrawable. As doing this, also load
the default wallpaper the same way as custom ones, taking care to
resize it as needed at load time.

Finally implement a mechanism for the window manager to wait
for the wallpaper to redraw at its new position before returning
from the application's call to change the offset. This ensures
that the wallpaper better tracks the application. Note that there
is a timeout in this wait that is relatively short, and if it
expires we will run for a while without waiting.

Change-Id: Ife449437746da85958bd447e0a6cf3d2223b398c
/frameworks/base/core/java/android/content/res/Resources.java
8cae124af2142687a6833dbaab8a43df6dd67b43 10-Sep-2009 Dianne Hackborn <hackbod@google.com> Various cleanup around resources and nine-patches.

Remove the stuff that doesn't use preloaded drawables when in
compatibility mode, since this works fine ever since we were able
to deal with drawables in a different density than the canvas.

Change the snapshot function on View to return a snapshot at
the same size that will actually be drawn on screen (when in
compatibility mode), to be able to show scaling artifacts and
all.

This change was original an attempt to fix issue #2101917: Text
field edges appears to be improperly rounded. That turns out to
probably be something deeper in the graphics system, but also
included here is the debugging code I did to try to track down the
problem to make it easy to turn on again later.

Change-Id: I34bfca629639c7ff103f3989d88874112ef778d9
/frameworks/base/core/java/android/content/res/Resources.java
7341d7a104b47996445d069a695e155a07184606 14-Aug-2009 Dianne Hackborn <hackbod@google.com> More work on wallpapers.

- Do better about figuring out when to stop them and other related window
management.
- Fix problem where we were not redrawing the surface when the orientation
changed. This was the cause of the device hang.
/frameworks/base/core/java/android/content/res/Resources.java
a53b828635fce8b6b2d3e3377d74d72070056623 17-Jul-2009 Dianne Hackborn <hackbod@google.com> 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.
/frameworks/base/core/java/android/content/res/Resources.java
ddd12535f095d8d056716c3290faf50ec52a538a 14-Jul-2009 Mitsuru Oshima <oshima@google.com> Return adjusted display for WindowManager.getDefaultDisplay()
/frameworks/base/core/java/android/content/res/Resources.java
ba3ba57921dedaaef669719c0359c0caf60e008b 09-Jul-2009 Mitsuru Oshima <oshima@google.com> * Use cached resources for widgets
/frameworks/base/core/java/android/content/res/Resources.java
569076c9f6bdadb4d3285a26e069634a839b5b87 03-Jul-2009 Mitsuru Oshima <oshima@google.com> widgets scaling fix. Use container's compatibility info and display metrics when container and widgets disagree.
/frameworks/base/core/java/android/content/res/Resources.java
723738cfaec3dd7b0fe152c872c41bebf94074c4 26-Jun-2009 Dianne Hackborn <hackbod@google.com> 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.
/frameworks/base/core/java/android/content/res/Resources.java
64f59342d41849bd365cb43fad7505d5e3daa417 21-Jun-2009 Mitsuru Oshima <oshima@google.com> * new screen resolution support impl.
* use full window for activities, and shift & clip the content
* refactored the compatibility code, and introdcued Translator class to handle cooridnate translations.
* removed a workaround to handle an activity with configChagne=rotation in old implementation.
* I'll fix background issue on rotation in next CL.

* removed unnecessary scaling code in SurfaceView, which I forgot to remove when I changed SurfaceView
not to scale the content.
/frameworks/base/core/java/android/content/res/Resources.java
fdbf6a7eac39a23e0e910c29678fe00d4eb56c99 19-Jun-2009 Romain Guy <romainguy@android.com> Fixes #1922373. Resolves a case of keys collision in Resources' cache.

The Resources class keeps a cache of known resources. The keys used by the
cache are stored as int primitives. For any given drawable resource, a key
is built thusly:

TypeValue.assetCookie << 24 | TypedValue.data

In the case of a plain color drawable, assetCookie always equals -1, that
is 0xFF once right-shifted and the data contains the color value. Which
means the key for the following two colors is the same:

0xFF000000
0x00000000

Because of the int storage and the use of the (constant in this case)
asset cookie, the alpha channel of a color is ignored. That means that
if you first load an opaque black color (0xFF000000), subsequent loads
of a totally transparent black color (0x00000000) will give you an
opaque black color.

A workaround is to use a transparent color that is not black,
0x00000001 for instance. Note that this issue would arise with any color
and any opacity level.

The solution to fix this issue is simply to change the cache to use
longs instead of ints to represent the keys. A key thus becomes:

TypedValue.assetCookie << 32 | TypedValue.data

This allows us correct storage of all colors at the cost of a few bytes.
The tradeoff is that we can keep caching ColorDrawable, which is
definitely worth it.
/frameworks/base/core/java/android/content/res/Resources.java
e5fb328825995aa33b5b7ecf8b5bee2b17f81715 10-Jun-2009 Mitsuru Oshima <oshima@google.com> resolution support fix/improvement
* adding compatibility menu
* backup gravity
* set expanable=true if the screen size is hvga * density.
* added "supports any density" mode. I'll add sdk check later.
* disallow to catch orientation change event if the app is not expandable. This
was causing layout problem under non-expandable mode. I discussed this with Mike C
and we agreed to do this approach for now. We'll revisit if this causes problem to
a lot of applications.
/frameworks/base/core/java/android/content/res/Resources.java
9189cabb0b6c6c28232fe6f412b7ba7a37352a6a 03-Jun-2009 Mitsuru Oshima <oshima@google.com> * Moved supports-density tag under manifest
* Refactored Compatibility code
* Added CompatibilityInfo class
* Removed getApplicationScale from Context
* Added Resources#getCompatibilityInfo so that RootView can get the compatibility info w/o going through Context
* Expandable support
* Added expandable tag under manifest
* Old application w/o expandable is given the default screen size ([320, 480] x density).
* The non-expandable window is centered.
/frameworks/base/core/java/android/content/res/Resources.java
8169daed2f7a8731d478b884b1f455c747b88478 29-Apr-2009 Mitsuru Oshima <> AI 147976: Compatibility mode support. Part 2.
* Introduced ApplicationScale (may not be good name. CompatibilityScale? CanvasScale? Pls let me know if you have better idea)
* Changes to RootView / SurfaceView
- Makes the app believe it's running in the supported density/resolution.
- Makes the window manager believe it's running at the right density/resolution.
* Added methods to Rect/Event for scaling up/down.
Known issues:
* certain kind of images (such as nine patch for buttons) seesm to be loaded not by app, thus does not take the scale into account,
which, in turn, is causing layout issue.
* ZoomButton in MapView is rendered in wrong place
* Transparent region on Surface is not correct
* Specifying different densities in one process is not working.
BUG=1770627

Automated import of CL 147976
/frameworks/base/core/java/android/content/res/Resources.java
f8a7ceaef2e7d5cd530c9426bde91b6fa9a40b75 11-Apr-2009 Andy Stadler <> AI 145778: Manual merge changes 145382-145384 from cupcake.

Automated import of CL 145778
/frameworks/base/core/java/android/content/res/Resources.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/content/res/Resources.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/content/res/Resources.java
076357b8567458d4b6dfdcf839ef751634cd2bfb 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@132589
/frameworks/base/core/java/android/content/res/Resources.java
3dec7d563a2f3e1eb967ce2054a00b6620e3558c 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@137055
/frameworks/base/core/java/android/content/res/Resources.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/core/java/android/content/res/Resources.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/java/android/content/res/Resources.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/content/res/Resources.java