• Home
  • History
  • Annotate
  • only in /frameworks/base/core/java/android/content/res/
History log of /frameworks/base/core/java/android/content/res/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7790f2a4e1eee48c33957cc4ac079c8bce64c0ad 03-May-2018 Richard Uhler <ruhler@google.com> Merge "Fix leak of WeakReferences on mThemeRefs list." into pi-dev
dd6a0dbf2f882b62e70430d6d4deceae0fbfe4f1 26-Apr-2018 Richard Uhler <ruhler@google.com> Fix leak of WeakReferences on mThemeRefs list.

Periodically remove references from the list whose referents have been
garbage collected.

Bug: 73961798
Test: Device boots.
Test: Take a heap dump of systemui and manually check that the state of
ThemeRefs looks reasonable.

Change-Id: I691027feb5dd217bcb60406b28897b9614e2a845
esources.java
53e86ba235f1c290edd53d4d565499d73a0b7f25 02-May-2018 Chia-I Wu <olv@google.com> Update Configuration#isScreenWideColorGamut doc

Clarify that the method does not imply the screen is color-managed.
A global color transform may still be applied depending on the user
settings, such as night light, accessibility, Boosted, or Stretched.

Bug: 78012876
Test: builds
Change-Id: Ie9cdf455cf4ca93be2357a5313cd63555ab91ff9
onfiguration.java
1194b0bdfed798cae594c6e80c13855ea6618f3b 23-Mar-2018 Chris Craik <ccraik@google.com> Remove incorrect @NonNull annotations on getDrawable() and variants.

For compatibility, had to continue returning null when drawables could
not be decoded. Fix annotation to match pre-P behavior (the behavior
was reverted separately).

Fixes: 69543526
Test: make

Partial revert of Ib01eca970c5c9969998ce5b265b120aa7048b41a

Change-Id: I5f612f47793c3f04cf9874e13efdc13397ddd4e8
esources.java
esourcesImpl.java
40a32d9ff0868de97c1a82ece98f7dcc932d1b6f 02-Mar-2018 Adam Lesinski <adamlesinski@google.com> Merge "Refactor AssetManager"
bebfcc46a249a70af04bc18490a897888a142fb8 12-Feb-2018 Adam Lesinski <adamlesinski@google.com> Refactor AssetManager

Bug: 64071469
Test: atest CtsContentTestCases
Change-Id: Ia6856157e8813856268fba003e1e591d690cb26e
pkAssets.java
ssetManager.java
esources.java
esourcesImpl.java
ypedArray.java
mlBlock.java
19130fea91e74c78ff4e1ef175955be3ede315e1 01-Mar-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "More work on issue #73301635: Ability to extract device configuration"
337e01ac10f59f60c5b2a2b7288debc963f6c0e3 28-Feb-2018 Dianne Hackborn <hackbod@google.com> More work on issue #73301635: Ability to extract device configuration

Now include Gl extensions (thanks to whoever wrote the code
I copied!).

Tweak the protos a bit to include missing info and correct
some things.

Add some new test APIs that are needed for CTS.

Bug: 73301635
Test: atest CtsActivityManagerDeviceTestCases:ActivityManagerGetConfigTests
Change-Id: Ie3f8173d217468246e8b6c7f45b7cbfcb352d60f
onfiguration.java
27ddd8a9a43fa0fef2d4c110f95e0cae6dc1eff9 27-Feb-2018 Siyamed Sinir <siyamed@google.com> Use LocaleList.read/writeParcel in Configuration

Instead of parcel and unparceling locales in LocaleList in
Configuration use LocaleList.read/writeParcel.

Bug: 73891437

Test: atest android.content.res.cts.ConfigurationTest
Test: atest android.content.res.ConfigurationTest
Change-Id: Id65a7e36487375f0e3a2c2da44ad8d7c5ea49734
onfiguration.java
bf5ba6bbcca6e06a70d62d87059f5560581aada5 20-Feb-2018 Dianne Hackborn <hackbod@google.com> Implement issue #73301635: Ability to extract device configuration

am get-config can now return its information as a protobuf,
so that we have a nice machine readable representation of the
configuration available. This is available through the new
"--proto" option.

Also add a new "--device" option which will include additional
device configuration information in the output.

Defined the protos to contain all of this information. Updated
Configuration to generate everything it should in the proto.

The output has been changed so that configuration history
will not be returned unless you specify the --days option.

Bug: 73301635
Test: Booted, ran, output

Change-Id: I074b92b45d6b1da1c1a499080db9e006d12b9fea
onfiguration.java
513031d15b78579e39d59b71ab5a1b0afabc5544 15-Feb-2018 Leon Scroggins III <scroggo@google.com> Reland "Call ImageDecoder directly in ResourcesImpl"

This reverts commit 0f05b4895d0e09eb0c59065c30dd04bb884a1983.

Bug: 73083791
Test: CTS (I08618dcd7707e5857ed8f8f01fd78b4129cd5804)

Change-Id: I8a95725c8453d94f406c2c14d2c3555dc1c2901f
esourcesImpl.java
e848e106b6373d7ca73cfcdac26757c0ea763cd8 12-Feb-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert incorrect NonNull assertions in ColorStateList loading"
d6d5e0cc77eb29bf664cbc93665d4463c5e72dc6 10-Feb-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge changes from topic "revert-assetmanager2-02-09-2018"

* changes:
Revert "Replace AssetManager with AssetManager2 implementation"
Revert "libandroidfw: Make sure to set the 'app as lib' flag"
Revert "Make idiomatic use of ApkAssets and AssetManager"
Revert "libandroidfw: Add ApplyStyle and SetConfiguration benchmark"
Revert "libandroidfw: Improve performance of AssetManager2"
Revert "AssetManager2: Allow out of order type/type spec"
Revert "AssetManager2: Fix list function"
Revert "AssetManager2: Fix issue with native cast"
2e41d49d0023cbbb762c3254ef37295d6fb03d14 09-Feb-2018 Chris Craik <ccraik@google.com> Revert incorrect NonNull assertions in ColorStateList loading

Fixes: 73157047
Test: atest CtsContentTestCases:ResourcesTest

Partial revert of ceb269362175e90899e8bdcad4319b91ee13abb6

Change-Id: I7c1db6f8d2b3451692b018212576960c78250d57
esourcesImpl.java
12ff37162752c5af43795abbf43dac11a2ef5df0 09-Feb-2018 Dianne Hackborn <hackbod@google.com> Add AttributeSet.getAttributeNamespace().

Why not.

Bug: 73101753
Test: Build and booted
Change-Id: I8f712ce9d7ed06eceef04d50a733a9471429b94c
mlResourceParser.java
bde1df21adf264d3398b9f3274f353faa6399008 09-Feb-2018 Adam Lesinski <adamlesinski@google.com> Revert "Replace AssetManager with AssetManager2 implementation"

This reverts commit 1187590da38457809dd368d4901c9c47ac5a6958.

Bug: 73134570
Change-Id: I59b4d714e447478ea124f086356f127f42251fb7
pkAssets.java
ssetManager.java
esources.java
esourcesImpl.java
ypedArray.java
mlBlock.java
56c82be0d4075a434217a0d56be8e6544fb05a96 09-Feb-2018 Adam Lesinski <adamlesinski@google.com> Revert "Make idiomatic use of ApkAssets and AssetManager"

This reverts commit 633085456e5047e16e53da6c95e193e2a0189633.

Bug: 73134570
Change-Id: I7c5171e752dd178dcd64497a780ba0f97d03b7a0
pkAssets.java
ssetManager.java
25d7f46aa938fff0eb782fb867a99bb7ba0b6e21 09-Feb-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Revert "Call ImageDecoder directly in ResourcesImpl""
88f284a3d311b8ec8196df19d5542baa3d9a0b57 09-Feb-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Change Resources.getDrawable nullability"
0f05b4895d0e09eb0c59065c30dd04bb884a1983 08-Feb-2018 Leon Scroggins <scroggo@google.com> Revert "Call ImageDecoder directly in ResourcesImpl"

This reverts commit 40c59fdef0087ea0325e447ae0ee113cc8ca7c15.

Reason for revert: b/73083791

Change-Id: I044e534be07c5fd18c99dcc65a14b72eaf1fecd5
esourcesImpl.java
ceb269362175e90899e8bdcad4319b91ee13abb6 02-Feb-2018 Chris Craik <ccraik@google.com> Change Resources.getDrawable nullability

Resources.getDrawable() was annotated @Nullable because there was one
very particular path where Bitmap decoding would fail and trigger a null
return.

As part of the switch to ImageDecoder, that path was changed to now throw
an IOException, which will result as a NotFoundException to the caller of
getDrawable.

This CL annotates that path as @NonNull to reduce pain of dealing with
@Nullable method that was very unlikely to be null in practice.

Also fixes many other missing nullability annotations, and relabel
many @Nullable paths that would never return null in practice as
@NonNull.

Bug: 69543526
Test: ResourcesTest

Change-Id: Ib01eca970c5c9969998ce5b265b120aa7048b41a
esources.java
esourcesImpl.java
3f24e69dbed74fd7724c0a4714ce612f1cb5bc5c 05-Feb-2018 Andreas Gampe <agampe@google.com> Frameworks: Annotate trivial @GuardedBy in core/java

Add @GuardedBy for simple functions that require a single lock
and are named XYZLocked.

Bug: 73000847
Test: m
Test: m javac-check-framework RUN_ERROR_PRONE=true
Change-Id: Icb5114fea2ff2385e1cc7511121026099e05c0ee
ssetManager.java
cffb3604aef4d3f6238d6694201298417bd159fb 06-Feb-2018 Adam Lesinski <adamlesinski@google.com> Merge changes from topic "assetmanager2"

* changes:
libandroidfw: Improve performance of AssetManager2
libandroidfw: Add ApplyStyle and SetConfiguration benchmark
Make idiomatic use of ApkAssets and AssetManager
libandroidfw: Make sure to set the 'app as lib' flag
Replace AssetManager with AssetManager2 implementation
40c59fdef0087ea0325e447ae0ee113cc8ca7c15 01-Feb-2018 Leon Scroggins III <scroggo@google.com> Call ImageDecoder directly in ResourcesImpl

Test: Existing tests

Add a new (hidden) ImageDecoder.Source that accepts an AssetInputStream.
This allows us to create an AnimatedImageDrawable without fear of the
client closing the stream.

Call it from ResourcesImpl instead of Drawable.createFromResourceStream.

Change-Id: I07e00ca60c97538335a6310e830b73211fd8e7bb
esourcesImpl.java
633085456e5047e16e53da6c95e193e2a0189633 02-Dec-2017 Adam Lesinski <adamlesinski@google.com> Make idiomatic use of ApkAssets and AssetManager

Move away from using deprecated addAssetPath methods
and cache the instances of ApkAssets created.

Test: CTS passes
Change-Id: Ie95cd5a9e205a35806e7b142df5af02aa90d83ca
pkAssets.java
ssetManager.java
1187590da38457809dd368d4901c9c47ac5a6958 23-Jan-2017 Adam Lesinski <adamlesinski@google.com> Replace AssetManager with AssetManager2 implementation

Test: atest CtsContentTestCases:android.content.res.cts
Test: make libandroidfw_tests
Change-Id: I2bb6d7656d2516d371e83e541ed02f91405f6d94
pkAssets.java
ssetManager.java
esources.java
esourcesImpl.java
ypedArray.java
mlBlock.java
f7d01dd7e14e01420c39e7fb8eca3cfa0f5f31b6 26-Jan-2018 Adam Lesinski <adamlesinski@google.com> Revert "Replace AssetManager with AssetManager2 implementation"

This reverts commit dcb3c6559b09ec89771858ec27a787027da9af50.

Bug:72511998
Change-Id: I665966ca109f66f85d8665db388c71ea2303c3b8
pkAssets.java
ssetManager.java
esources.java
esourcesImpl.java
ypedArray.java
mlBlock.java
16b3dff2d5e81914d1e57a09931191ff8c8aea17 25-Jan-2018 Artem Iglikov <artikz@google.com> Revert "Make idiomatic use of ApkAssets and AssetManager"

This reverts commit e70b57a659e4486d07f30ebe3b067715b53f1378.

Reason for revert: b/72482083

Bug: 72482083
Change-Id: I36b0aff6d533d7fb59d367a1cd4e96e03df5f462
pkAssets.java
ssetManager.java
e70b57a659e4486d07f30ebe3b067715b53f1378 02-Dec-2017 Adam Lesinski <adamlesinski@google.com> Make idiomatic use of ApkAssets and AssetManager

Move away from using deprecated addAssetPath methods
and cache the instances of ApkAssets created.

Test: CTS passes
Change-Id: I257c72261a97e4aa802abb46dc1f44d80e1d42ad
pkAssets.java
ssetManager.java
dcb3c6559b09ec89771858ec27a787027da9af50 23-Jan-2017 Adam Lesinski <adamlesinski@google.com> Replace AssetManager with AssetManager2 implementation

Test: atest CtsContentTestCases:android.content.res.cts
Test: make libandroidfw_tests
Change-Id: I572eb13c6a4372c7f656f5912821cececd5bf3d4
pkAssets.java
ssetManager.java
esources.java
esourcesImpl.java
ypedArray.java
mlBlock.java
7fb38311361390e24d7e43ce1eb220faccd251ff 23-Jan-2018 Adam Lesinski <adamlesinski@google.com> Revert "Replace AssetManager with AssetManager2 implementation"

This reverts commit b20a0ce59f59cb5ec857748e056cc341dbd13b92.
pkAssets.java
ssetManager.java
esources.java
esourcesImpl.java
ypedArray.java
mlBlock.java
68d10d00a52be904766d69acda98bc934e768e7f 23-Jan-2018 Adam Lesinski <adamlesinski@google.com> Revert "Make idiomatic use of ApkAssets and AssetManager"

This reverts commit c857766ca5aa37df0833c816922e6b3b85a742f9.
pkAssets.java
ssetManager.java
1f62f7c72eaa6477950d6c0bf1bde562a68f6301 23-Jan-2018 Adam Lesinski <adamlesinski@google.com> Merge changes from topic "assetmanager-refactor"

* changes:
libandroidfw: Improve performance of AssetManager2
libandroidfw: Add ApplyStyle and SetConfiguration benchmark
Make idiomatic use of ApkAssets and AssetManager
Replace AssetManager with AssetManager2 implementation
c857766ca5aa37df0833c816922e6b3b85a742f9 02-Dec-2017 Adam Lesinski <adamlesinski@google.com> Make idiomatic use of ApkAssets and AssetManager

Move away from using deprecated addAssetPath methods
and cache the instances of ApkAssets created.

Test: CTS passes
Change-Id: I9e7048bcffd6471ed6a42e5175cc678dc4ac3b96
pkAssets.java
ssetManager.java
69799885f382a9813256526d54f03af5bf672edb 12-Jan-2018 Hyunyoung Song <hyunyoungs@google.com> Merge "Wrap StackOverflowError in NotFoundException. Bug: 67462465 Bug: 66498711 Test: builds and tested using faulty apk with recursive drawable. Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e (cherry picked from commit dc92d925d819d2c385c04e49369e8574fa111d14)" into oc-dev am: 48df033607 am: 69d240d584 am: 3aab9561b2
am: 7ca6bb95de

Change-Id: I449dd9403f7f9eeb92def3ce7162be07971399e2
7ca6bb95de46c2fbb6fb1fa219f0c2d69003ac1b 12-Jan-2018 Hyunyoung Song <hyunyoungs@google.com> Merge "Wrap StackOverflowError in NotFoundException. Bug: 67462465 Bug: 66498711 Test: builds and tested using faulty apk with recursive drawable. Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e (cherry picked from commit dc92d925d819d2c385c04e49369e8574fa111d14)" into oc-dev am: 48df033607 am: 69d240d584
am: 3aab9561b2

Change-Id: I554c6f320ec32b0151097701a5ff3a8d48161d7f
3aab9561b2d3a2f41935dfb453d140d789dc0478 12-Jan-2018 Hyunyoung Song <hyunyoungs@google.com> Merge "Wrap StackOverflowError in NotFoundException. Bug: 67462465 Bug: 66498711 Test: builds and tested using faulty apk with recursive drawable. Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e (cherry picked from commit dc92d925d819d2c385c04e49369e8574fa111d14)" into oc-dev am: 48df033607
am: 69d240d584

Change-Id: I02bf540b41fd9fd026fbe0fad4069526664cd56f
69d240d584f13fcc73831b1b856a19a9b4736c61 12-Jan-2018 Hyunyoung Song <hyunyoungs@google.com> Merge "Wrap StackOverflowError in NotFoundException. Bug: 67462465 Bug: 66498711 Test: builds and tested using faulty apk with recursive drawable. Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e (cherry picked from commit dc92d925d819d2c385c04e49369e8574fa111d14)" into oc-dev
am: 48df033607

Change-Id: Id2510b388bf4ed9cdd8853bc5594349df358f465
48df033607441c1b7d8d4ae6b6645497367327c3 12-Jan-2018 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Wrap StackOverflowError in NotFoundException. Bug: 67462465 Bug: 66498711 Test: builds and tested using faulty apk with recursive drawable. Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e (cherry picked from commit dc92d925d819d2c385c04e49369e8574fa111d14)" into oc-dev
b20a0ce59f59cb5ec857748e056cc341dbd13b92 23-Jan-2017 Adam Lesinski <adamlesinski@google.com> Replace AssetManager with AssetManager2 implementation

Test: Existing CTS tests pass
Test: make libandroidfw_tests
Change-Id: I858f7e1d909c08273b096601136e3f28e15eb5d4
pkAssets.java
ssetManager.java
esources.java
esourcesImpl.java
ypedArray.java
mlBlock.java
ce8db9911494225fcd99711d7df85a130de5a6ce 14-Dec-2017 Jeff Sharkey <jsharkey@android.com> Add more IntDef prefixes for auto-documenting.

Test: builds, boots
Bug: 70177949
Exempt-From-Owner-Approval: annotation-only changes
Change-Id: I76dde6054e06f52240bd4b1a0f196dcb74623608
onfiguration.java
radientColor.java
f3e904d4de8d7391df3a2499d5c5c0553de0fb12 08-Dec-2017 Neil Fuller <nfuller@google.com> Merge "Fix doc typo. Improve class javadoc..." am: e08f918a6e am: 26d28ef826
am: ac8f2c94fd

Change-Id: I3a587c589237460122cd2aacaed20c462e303db9
ac8f2c94fd5cd4848547b9e0bfdd082e1bb4ff0f 07-Dec-2017 Neil Fuller <nfuller@google.com> Merge "Fix doc typo. Improve class javadoc..." am: e08f918a6e
am: 26d28ef826

Change-Id: I7db3a33c933142806cbae90423044ccbac061868
e08f918a6e0a08d7d09c6f5c00a9c8de92e6f84c 07-Dec-2017 Neil Fuller <nfuller@google.com> Merge "Fix doc typo. Improve class javadoc..."
3ee89770bf34543e72878e577c61ac45c29766c9 04-Dec-2017 Neil Fuller <nfuller@google.com> Fix doc typo. Improve class javadoc...

Fix doc typo (value -> valid). Improve class javadoc,
fix lint error in import ordering.

Test: Build
Change-Id: I8899b1f568e052a3d152e6c36fca4d6bbf9584f2
mlResourceParser.java
311a849ee86dcb54313b7c400fcb03d4193b3587 01-Dec-2017 Jon Dormody <jond@google.com> Merge "Docs: Renamed ParcelFileDescritor to ParcelFileDescriptor Test: make ds-docs Bug: 1766768" into oc-dev am: ce7f1e6601 am: 3ba37e1f53 am: 96dad7e0a3
am: c0c7c3bcbb

Change-Id: I6d8c7f76139522fae1b506519aba4ab6f8e54d3b
96dad7e0a3404d1cb5cb8ec9256bb1254405e07e 01-Dec-2017 Jon Dormody <jond@google.com> Merge "Docs: Renamed ParcelFileDescritor to ParcelFileDescriptor Test: make ds-docs Bug: 1766768" into oc-dev am: ce7f1e6601
am: 3ba37e1f53

Change-Id: Ia807c8ccd0db5b37b010f64a417fc8e105c22866
3ba37e1f53ae922061a2d4ec7a5e835b030eeb0f 01-Dec-2017 Jon Dormody <jond@google.com> Merge "Docs: Renamed ParcelFileDescritor to ParcelFileDescriptor Test: make ds-docs Bug: 1766768" into oc-dev
am: ce7f1e6601

Change-Id: If7798db1aea1f1d6cdb42a7d25509c814a31f6ca
1c7c4b2f14af3d218e714e8e11e47c8b8e1a6010 30-Nov-2017 Jonathan Dormody <jond@google.com> Docs: Renamed ParcelFileDescritor to ParcelFileDescriptor
Test: make ds-docs
Bug: 1766768

Change-Id: Idfea122569bb6f80889be3f224f9629cfebc0ca3
ssetFileDescriptor.java
aff04c35ae4dd98bf1a0ea363e5708bd40cf2ad9 10-Oct-2017 Hyunyoung Song <hyunyoungs@google.com> Wrap StackOverflowError in NotFoundException.
Bug: 67462465
Bug: 66498711
Test: builds and tested using faulty apk with recursive drawable.
Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e
(cherry picked from commit dc92d925d819d2c385c04e49369e8574fa111d14)
esourcesImpl.java
b709f3c3225e1c37560234495e4e48b579d403dc 03-Nov-2017 Christian Williams <christianw@google.com> Add missing break to switch in resourceQualifierString().

Change-Id: Ia90b4dd6a2697896ac59fc93bbd61d0d9748f437
onfiguration.java
b2985209fec097fa41c10c16d408072d7a6dbdbc 02-Nov-2017 Sunny Goyal <sunnygoyal@google.com> Preventing recursive referrence in drawables am: 99b25d2817
am: ced997ec10

Change-Id: Iab88125b030bfe21aad82a1b287495cb9e3f54a2
99b25d2817a1058e56c5384a43040e0f3f291ce1 01-Nov-2017 Sunny Goyal <sunnygoyal@google.com> Preventing recursive referrence in drawables

Bug: 68706673
Bug: 66498711
Test: Added CTS tests
Change-Id: I8034f49d16f9a7bc1749714fd6d6231bba5088d0
esourcesImpl.java
ca3872ce36c94090ae18519dc7fe0cf39d834c4a 30-Oct-2017 Dianne Hackborn <hackbod@google.com> Fully implement "install" and "install-write" in PackageManagerShellCommand.

We can use the new mechanism to ask the calling shell to open
a file in order to implement the rest of these commands, allowing
you to give the path to an apk to install. That API is thus
extended to allow you to open readable files, not just opening
file for writing.

Doing this however means we no longer can pass a file path to
AssetManager for the apk to parse, we only have an already open
fd for that. Extending AssetManager to allow adding apks from
fds is not that hard, however, since the underlying zip library
already supports this.

This main thing this changes is in AssetManager.cpp where we
retrieve the open zip file for a particular apk that has been
added. This used to look up the zip file by path every time
it was needed, but that won't work anymore now that we can have
things added by fd. Instead, we keep track of each opened zip
in the AssetManager, so we can just directly retrieve it from
the asset_path representing the item that was added. As a
side-effect, this means for normal paths we no longer need to
look up by name, but just have the opened zip file directly
accessible. (This is probably good, but it does mean that we
no longer run the logic of seeing if the zip file's timestamp
has changed and re-opening it if it has. We probably shouldn't
be relying on that for an active AssetManager anyway, and maybe
it is even good that we don't allow the zip file to change
under it?)

A follow-up change will finally remove the Pm.java implementation
and turn the pm "command" into a simple shell script that runs
cmd package.

Test: manual

Change-Id: Ie103e3bdaa5b706796cc329254f2638151a3924f
ssetManager.java
690e62bb6849aa7ad2d9e012138e8a5054059ed8 19-Oct-2017 Mihai Popa <popam@google.com> Enable variation settings for fonts in XMLs

Bug: 37853920
Test: bit FrameworksCoreTests:android.content.res.FontResourcesParserTest

Change-Id: I1acf9767fb1cecc5f4982b79405f92280b31bfa7
ontResourcesParser.java
e34ad1871b9f7da309af0b4e11b93b1be834f38b 12-Oct-2017 Mihai Popa <popam@google.com> Enable the public TTC index attribute for fonts

This change adds support for specifying the TTC index on font entries,
relevant in the context of .ttc font files used to deliver multiple
fonts in the same file.
Bug: 37853920
Test: adb shell am instrument -w -e class android.content.res.FontResourcesParserTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner

Change-Id: I3f74e87dec78e1f5a68ccead80b0f637af1aa7a3
ontResourcesParser.java
a91a0c5dc41b6eb5d15a6dd38abef1ebf900346f 11-Oct-2017 Hyunyoung Song <hyunyoungs@google.com> Merge "Wrap StackOverflowError in NotFoundException. Bug: 67462465 Test: builds and tested using faulty apk with recursive drawable. Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e" into oc-mr1-dev am: 384689934d
am: 3702ce391d

Change-Id: I2ca8d4fb271245e3fc9b7f406456e3dc54dd96cd
dc92d925d819d2c385c04e49369e8574fa111d14 10-Oct-2017 Hyunyoung Song <hyunyoungs@google.com> Wrap StackOverflowError in NotFoundException.
Bug: 67462465
Test: builds and tested using faulty apk with recursive drawable.
Change-Id: I47691343dae892beb5ed8c1c66c33edefade321e
esourcesImpl.java
1985976b6672f2c858b0dc46ca8e43c65cde388b 18-Sep-2017 Michael Wright <michaelwr@google.com> Improve WMP dumpsys readability.

It's hard enough to read bugreports without having to decipher all of
the various IntDef's littered around; let's go ahead and just translate
them to something readable.

Bug: 65563703
Test: adb shell dumpsys window policy
Change-Id: Iea6cd309eb3411a65e54217fef814a66107a8e31
onfiguration.java
0d5609ba8c64710dbab020d99c832f8d470c716a 13-Sep-2017 Wale Ogunwale <ogunwale@google.com> Added WindowConfigurationProto and friends

Also added WindowContainerProto and ConfigurationContainerProto
Will be used by cts tests in upcoming CLs that replace StackId APIs.

Test: adb shell dumpsys window --proto
Bug: 64146578
Change-Id: Id6ca2a93e3d15ac696ab54cb241870e973985967
onfiguration.java
822e5121271be122da5bfb57bb94f5725abd88e1 26-Jul-2017 Wale Ogunwale <ogunwale@google.com> Introducing WindowConfiguration

Used to house configurations that don't affect resources and that
we don't want to communicate to apps, but need to be propagated
along side Configuration.

Test: bit FrameworksServicesTests:com.android.server.wm.WindowConfigurationTests
Test: adb shell am instrument -w -e package com.android.server.wm com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner
Change-Id: I97de3efbe6d5e1d3b07156a8cfbce9be5eae5cb5
onfiguration.java
94795bcaf81ce2de8562c3aa226fe0be88711daf 31-Jul-2017 Bryce Lee <brycelee@google.com> Merge "Do not call onConfigurationChanged for appBound position changes." into oc-dr1-dev am: 33d4702a12
am: 05865fb40a

Change-Id: Ia5817040ce14ee6dbd995bd83444f34e78bef375
69aac0a7b6ca915cd558097c73b33ce36a3523a5 31-Jul-2017 Bryce Lee <brycelee@google.com> Merge "Do not call onConfigurationChanged for appBound position changes." into oc-dr1-dev
am: 33d4702a12

Change-Id: Id6748aab9ee83844303324ea397d4ac699fb5839
658d984f048e846b9039b7a44dc44fd22756c830 28-Jul-2017 Bryce Lee <brycelee@google.com> Do not call onConfigurationChanged for appBound position changes.

Since appBounds encodes both dimensions and positions, movement will
cause a diff change. This happens in situations where the dimensions
stay constant, such as dragging a PiP window around.

To avoid flooding the client side with configuration changes, this CL
checks whether the new configuration is equivalent to the existing
configuration with the exception of the position of the appBounds
before sending to the registered callbacks.

Change-Id: I8fbc94458fd9ed3b39494c3587f25e704ec02a7d
Fixes: 63927944
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests
Test: go/wm-smoke
onfiguration.java
96d54d41f43494300adca390c17533a0b0885e98 28-Jul-2017 Bryce Lee <brycelee@google.com> Merge "Remove rotation and app bounds from Configuration diff." into oc-dr1-dev am: 5b76ce1b2b
am: d6dfd4a8b4

Change-Id: I38aeed5d2ab2cf7932e98e97800fa1cd73c7a3ec
84fa183e7d8a2126f460013355912fd7c1907747 28-Jul-2017 Bryce Lee <brycelee@google.com> Merge "Remove rotation and app bounds from Configuration diff." into oc-dr1-dev
am: 5b76ce1b2b

Change-Id: Ibf899e9a08cdab31ae38897add813fc4c8089474
0e4a6dfb3facd926a6424b4274bcab9b9734307c 27-Jul-2017 Bryce Lee <brycelee@google.com> Remove rotation and app bounds from Configuration diff.

The presence of these new flags leads to issues with application that
do not expect their presence. Since these flags can appear at
critical times, such as on orientation change, these issues are
brought to the surface often.

This CL remedies this problem by first removing the rotation
property. It is not used and the original issue of orientation and
Configuration alignment has been addressed. For app bounds, the CL
reverts the behavior back to identifying diffs as a screen size
change.

Fixes: 64004417
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests
Test: go/wm-smoke

Change-Id: I1fabb564dfb5c13d897336708523cf7cd5099fa0
onfiguration.java
d6a2ed194c474d1894a53636353760120c8a11d7 26-Jul-2017 Bryce Lee <brycelee@google.com> Merge "Do not report app bound differences as a Configuration change." into oc-dr1-dev
am: 512e5d1b9b

Change-Id: If5c2ce81a92d751c3481d7613611b9373060f78a
0ee2ac73e97c2b328ebc80bfd9223c7fec40f48f 26-Jul-2017 Bryce Lee <brycelee@google.com> Merge "Do not report app bound differences as a Configuration change." into oc-dr1-dev am: 512e5d1b9b
am: a9ba9c3ed6

Change-Id: Iaa194f131f171d01854afdf4b07d7648c4f14964
600daddb679e356f5767a9e898751cc4c1cba3b4 25-Jul-2017 Bryce Lee <brycelee@google.com> Do not report app bound differences as a Configuration change.

App bounds are an internal Configuration field and should not
influence the diff that determines whether the Configuration has
changed. This changelist ensures this by introducing a new flag that
is identified server side and filtered before informing the client
that the configuration has changed.

Change-Id: Ibf1387f73eaa9b39e6213e1a1109c4cd57554e7c
Fixes: 63927944
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests#testAppBoundsConfigurationDiff
Test: go/wm-smoke
onfiguration.java
aa6560c148909ae0e0be4cbc3d14562ba3eceb77 14-Jul-2017 Makoto Onuki <omakoto@google.com> Two more numbers in the preload log

Bug 63136392
Test: Manual

Change-Id: I0fa1dffa80d4d06cbfc41e0b40ddce5d324052ec
esourcesImpl.java
1480b67635cdc4c2c5e735741bf30393fd70d738 14-Jul-2017 Makoto Onuki <omakoto@google.com> Better preload drawable logging

Bug 63136392
Test: Manual test

Change-Id: I8753b36f632cf2ff57a5ef28df29f3fc5657f607
esourcesImpl.java
8f18579afe6f24b737b2d08229e9af47a815b410 13-Jul-2017 Bryce Lee <brycelee@google.com> Merge "Do not use rotation as indicator to relaunch from config change." into oc-dr1-dev am: fa62d79a02
am: b3d51770d1

Change-Id: I267b6be7a95c19b927e8ecb01e597342e6bee1d3
cd2d38d65e738735698319ae0576ae23201e71c0 13-Jul-2017 Tenghui Zhu <ztenghui@google.com> Merge "Update the annotation for getAnimation"
b529256264402ae7b4240a2ba95f698ddae0ecd7 12-Jul-2017 ztenghui <ztenghui@google.com> Update the annotation for getAnimation

b/63584307
Test: None
Change-Id: If0581ec3302956735bc4cc549a70c5a5ab9b4e2a
esources.java
248fbb180db7cc1f57ab3a8d0387e1c18caf668d 11-Jul-2017 Bryce Lee <brycelee@google.com> Do not use rotation as indicator to relaunch from config change.

Rotation is a hidden member inside configuration that should not
influence configuration related logic. This CL ensures that we do
not consider changes to the rotation as grounds for relaunching an
activity.

Change-Id: I9e6d4a1a75fd3ee3beb63f307433e9c3fcfd6dd4
Fixes: 63533208
Test: go/wm-smoke
Test:cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerConfigChangeTests
onfiguration.java
649053810fa221d173fdf4c908f43838d76b4850 10-Jul-2017 Bryce Lee <brycelee@google.com> Merge "Add app bounds to Configuration#compareTo." into oc-dr1-dev
4eb4129c2940dde9a9769cffda6d8d2b17075f8e 06-Jul-2017 Adam Lesinski <adamlesinski@google.com> Fix Configuration#updateFrom() when assetsSeq doesn't change

Compare the value of assetsSeq when updating Configuration from
a delta.

Bug: 63352177
Test: manual
Change-Id: I9e1205cd64c4a1e0192b7049c82d36d53fb4af36
(cherry picked from commit 2123c415bf4cc67ad2c50e9613c7748956cd0c46)
onfiguration.java
c5fe0eedb6332705882306d7a23edaa78eb8cc31 30-Jun-2017 Bryce Lee <brycelee@google.com> Add app bounds to Configuration#compareTo.

This CL takes app bounds into consideration when comparing two
Configurations with compareTo.

Change-Id: I9894f312429626975a2651b837cae8d80548c271
Fixes: 63160229
Test: go/wm-smoke
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests#testConfigurationCompareTo
onfiguration.java
c1f2f2a9d3136ff44b3abf773cec93aacf0ba280 23-Jun-2017 Bryce Lee <brycelee@google.com> Add rotation to configuration.

Certain activities are dependent on the rotation of the device to
determine layout. In these cases, orientation does not provide enough
details.

This CL adds the field (hidden) to the configuration.

Change-Id: Idb3ba10cb4de8838737c25e92264e6cee224e264
Fixes: 32839232
Test: go/wm-smoke
onfiguration.java
e89d0bba66d76fe4c0d316f065a3d0f96f375c75 20-Jun-2017 Romain Guy <romainguy@google.com> Only enable wide color gamut support on capable devices

Bug: 62827458
Test: CtsColorModeTests, more tests going in MR1
Change-Id: Idca2804b04ae6bdcbec6bcda6fd74dc6ada89c31
onfiguration.java
46b01655b3448706797dfadc3d9a7c6495bb6e5c 08-Jun-2017 Bryce Lee <brycelee@google.com> Revert "Coordinate configuration changes and window frame size."

This reverts commit afb45bba8379df530182dae882ec70329423dcfe.

Bug: 32839232
Fixes: 62424393
Change-Id: Ifaa0176e18100ec85b8c81268a26fb16ffe9b5f3
onfiguration.java
afb45bba8379df530182dae882ec70329423dcfe 27-Apr-2017 Bryce Lee <brycelee@google.com> Coordinate configuration changes and window frame size.

Previously, it was possible for the view hierarchy to be measured,
laid out, and drawn around a window frame size that did not match
the current configuration. This stems from new configurations not
always propagating back from WindowSession#relayout, which is
called from ViewRootImpl.

This changelist makes WindowManagerService#relayoutWindow always
return the latest configuration. It also adds rotation to the
configuration.

Fixes: 32839232
Test: go/wm-smoke
Test: Open Camera while rotating phone to landscape. Added
temporary logs to detect inconsistencies between measurements
and reported rotation on draw.
Change-Id: I39daca338b4f87eff1a509eb99493f01e710ced1
onfiguration.java
24c18af14a3cc39d28e7fb507b37f8700f605463 26-May-2017 Adam Lesinski <adamlesinski@google.com> Merge "Add ResourceId validation helper method" into oc-dev
36d6a985cd0595061a2f5a9facc91aa013aea72a 26-May-2017 Tenghui Zhu <ztenghui@google.com> Merge "Create a new drawable after caching the DrawableContainer" into oc-dev
9553fb3240f6d2e52012f94fb59271348a07b94d 24-May-2017 Adam Lesinski <adamlesinski@google.com> Add ResourceId validation helper method

An invalid, 'null' resource ID is defined as 0. Apps often use -1.

Add a helper method that makes checking valid IDs easy and more
centralized.

Eventually make it public API.

Bug: 38393777
Test: manual
Change-Id: I969ec4a45e86bdab3d7f57d357d475b77c7f8a78
esourceId.java
esources.java
4fed971437d957e09f86b67c540b27a6e15920bb 23-May-2017 Adam Lesinski <adamlesinski@google.com> Resources: fix race with creating theme

Bug: 38353957
Test: none
Change-Id: Id78770b475b979635da6a4067db6269e3a1b04d6
esources.java
ee7e8f13ea2293e93ef9dd9f3f088186edd4864e 17-May-2017 ztenghui <ztenghui@google.com> Create a new drawable after caching the DrawableContainer

fix:37135264

Test: Add new CTS test
bit
CtsGraphicsTestCases:android.graphics.drawable.cts.DrawableContainerStateTest,
CtsGraphicsTestCases:android.graphics.drawable.cts.DrawableContainerTest,
CtsGraphicsTestCases:android.graphics.drawable.cts.Drawable_ConstantStateTest

Change-Id: I8bb868d16a944f746ec41d3e37ae4215b964d949
esourcesImpl.java
2ea169a2ecbb7e589fcef78cb1486d007a8fb867 16-May-2017 Seigo Nonaka <nona@google.com> Introduce early exit path for non resource path.

Developer can specify android:fontFamily with three ways, pre-defined
font family name, e.g. "sans-serif", path to the font file in resource
directory, e.g. "res/fonts/Roboto-Regular.ttf", or path to the XML font
family file, e.g. "res/fonts/Roboto.xml".

Resources.getFont treats font files and XML files but pre-defined family
name is handled by TextView. Thus, we can early exit if the passed value
is not likely resource path.

This improves the inflation performance.
The score without this patch:
gfx-avg-frame-time-50: 6.9
gfx-avg-frame-time-90: 9.4
gfx-avg-frame-time-95: 10.4
gfx-avg-frame-time-99: 16.7

The score with this patch:
gfx-avg-frame-time-50: 7.0
gfx-avg-frame-time-90: 8.9
gfx-avg-frame-time-95: 9.7
gfx-avg-frame-time-99: 16.5

Measured on bullhead-userdebug.

The APCT perf test improves from
String FontFamily: 200,086 -> 132,561
File FontFamily : 199,256 -> 161,843
XML FontFamily : 203,681 -> 158,553

Measured on angler-userdebug.

Bug: 38232467
Test: UiBenchmark
Change-Id: Ia601ae7207ae8c60848c9efdbb9396267a57257c
esourcesImpl.java
32e7501a27f0f19bccdf9e91f9b87869c093f695 10-May-2017 Adam Lesinski <adamlesinski@google.com> Fix support for @empty in style resolution

If @empty is encountered in XML, do not fallback
to searching through the theme.

Bug: 36891052
Test: make aapt2_tests
Test: bit CtsContentTestCases:android.content.res.cts.TypedArrayTest
Change-Id: Ie3bf7b70af9c7913513a1092afd95d26bec5e635
ypedArray.java
a5fa9e8a63e5764244b709f37bc4a54d2bb96890 05-May-2017 Seigo Nonaka <nona@google.com> Resolve styles by font table if not specified.

android:fontStyle and android:fontWeight is an optional attribute.
If they are missing, we are using non-italic 400 weight, but this is
not good idea. We should resolve these style value from font metadata.

Bug: 37988154
Test: am instrument -w -e class android.content.res.cts.ResourcesTest
android.content.cts/android.support.test.runner.AndroidJUnitRunner

Change-Id: I80a436cd3632d8c58fa3d8bdaedac73b95f61a8c
ontResourcesParser.java
5e0aed49a874b32b135bbd8da620357764b69ad4 01-May-2017 Seigo Nonaka <nona@google.com> Fix NPE happens if no source was specified to font element.

This also fixes unexpected fallback to the old implemntation by calling
allowUnsupportedFont() which is only for backward compatibility.

This CL also remove getResourceId() method. Nobody uses this method.

Bug: 37865521
Bug: 37844248
Test: am instrument -w -e class android.content.res.cts.ResourcesTest\
android.content.cts/android.support.test.runner.AndroidJUnitRunner
Change-Id: I987448add728c53c916f24a2ea8f337be417248f
ontResourcesParser.java
esourcesImpl.java
2e6886550a085a6e6220f35cc4d099c41f252290 21-Apr-2017 Stefan Ramsauer <str@google.com> Fix parameter name mismatch in getResourceIdentifier.

Test: No test since change is NOP.
Change-Id: Id069f18e7e75f3b34448cfbabb8ba84d7bb18d87
(cherry picked from commit dd48cc8ad42baab0b7548db38ceffd592a92f191)
ssetManager.java
50954d2b4ea938d787ef5021d75f6bc02826607a 15-Apr-2017 Adam Lesinski <adamlesinski@google.com> Propagate density through AdaptiveIconDrawable and BitmapDrawable

Resources#getDrawableForDensity now propagates the overridden
density through to AdaptiveIconDrawable so that the density can be
propagated to leaf BitmapDrawables correctly.

This enables AdaptiveIconDrawable to support higher resolution
foreground/background bitmaps for use in Launcher.

Bug: 36039665
Test: bit CtsContentTestCases:android.content.res.cts.ResourcesTest
Change-Id: Iaa9a5592626e38e1ff839a76f7c6cfb9e16e5dc1
esources.java
esourcesImpl.java
ypedArray.java
ec05bc0fda9e10fe16cb98c5d3a4de37773ad5f8 18-Apr-2017 Adam Lesinski <adamlesinski@google.com> Fix issue with fontScale changes not taking effect

If a configuration change occurs, and an underlying ResourcesImpl is
swapped out under a Resources object, the DisplayMetrics cached by
TypedArray will be stale and not up-to-date.

Bug: 34120637
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerConfigChangeTests
Change-Id: Id78a6d259250950387c2e95c4a2292fdd095c7af
ypedArray.java
b3f69261c5506fcd46d82af84985cbe79722816f 14-Apr-2017 Romain Guy <romainguy@google.com> Fix javadoc typos

Bug: 37328228
Test: compiles
Change-Id: I75323ef5afb30381aa473ebe7172ebb145eac8f3
onfiguration.java
80b7a214bac14d48c08abeeb4cdd9499a0f40117 13-Apr-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Update docs for obtainStyledAttribute" into oc-dev
5ec8875d2088876b4706dc25dab62cb083509e63 12-Apr-2017 Adam Lesinski <adamlesinski@google.com> Update docs for obtainStyledAttribute

Include the requirement that the input attribute ID array
must be sorted.

Bug: 34802757
Change-Id: I3244178c52df77078afae656652c3a44447fa645
Test: none
esources.java
4a81674b45b7250c4e2a80330371f7aa1c066d05 02-Feb-2017 Jiaquan He <hejq@google.com> Detect unhandled keyboard focused state.

A View uses a Drawable as its background, which changes
its appearance according to the View's state. This commit
adds an algorithm to detect undefined state_focused in
state specs for those Drawables.

Test: cts-tradefed run singleCommand cts --skip-device-info
--skip-preconditions --abi armeabi-v7a -m CtsGraphicsTestCases
-t android.graphics.drawable.cts.DefaultFocusHighlightTest
Bug: 35096940

Change-Id: I5e9f07141679881fe88f9040aa116ea2f9d537c9
olorStateList.java
7566d76c618a48b8dcc981dac3cab1e42f864063 30-Mar-2017 Bryce Lee <brycelee@google.com> Add app bounds to configuration.

The system previously overrode the display size for a specific scope
(task/activity/etc.) by setting the associated Configuration's
screenWidthDp/screenHeightDp. This leads to two issues. First, the
conversion of screen size from pixels to display independent pixels
and then upconverting later on leads to rounding errors. Secondly,
the screenWidthDp and screenHeightDp values account for insets, such
as the status bar. These however are not reflected in the display
size when returned from Display#getMetrics/getSize.

This changelist addresses the issue by adding a Rect value to
Configuration which stores the app display bounds. This is always set
at the display level and overridden as appropriate. As the proper
app insets are accounted for at the root configuration, all overrides
(outside of specific exceptions) are the result of the intersection
between the requested bound and the parent bound.

Change-Id: I2c4fcd0bee92af12aabbca258de05b4ec061d0e1
Fixes: 34338931
Bug: 36812336
Bug: 36676979
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsAppTestCases android.app.cts.AspectRatioTests
Test: cts/hostsidetests/services/activityandwindowmanager/util/run-test CtsServicesHostTestCases android.server.cts.ActivityManagerDisplayTests
Test: bit FrameworksServicesTests:com.android.server.wm.AppBoundsTests
onfiguration.java
2821eeae9732002c1a4bd9d6812a45ea65b7b6a0 17-Mar-2017 Clara Bayarri <clarabayarri@google.com> Preload fonts from an array

Until now we were reusing the font tags, but it is not needed,
we can declare the list of fonts to preload with a simple
resources array.

Test: manual
Bug: 36119246
Change-Id: I39819018012c322aff62e13aa69ab35467be57ac
esources.java
esourcesImpl.java
fb483cc90c27a9c0fcafa28343a8fd644f8384a4 21-Feb-2017 Clara Bayarri <clarabayarri@google.com> XML Support for non system font providers

The certs needed to identify non preinstalled providers
can now be declared in XML, using a resources array.

Test: runtest --path frameworks/base/core/tests/coretests/src/android/provider/FontsContractTest.java
runtest --path frameworks/base/core/tests/coretests/src/android/content/res/FontResourcesParserTest.java
Bug: 35025705
Change-Id: Ibf12ad409aa5a873ddb32b1383c147728e664c23
ontResourcesParser.java
5dd59219e3c04fe871b2eca318222a860c5e564e 21-Mar-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "[Resources] preloaded drawables few"
a8a66ccf1c6c042a71817d61fc159f10c21f4844 20-Mar-2017 Alan Viverette <alanv@google.com> [Resources] preloaded drawables few

Symptom: preloaded drawables few
Root Cause: all Java-side usages of config flags Must use Java flags
Solution: all Java-side usages of config flags Must use Java flags
Project: N70
Note:
Test: No

Fixes: 36448068
Change-Id: Iba4ac0067405bf1605cb1a98aa4dfc6263bbe5f8
esourcesImpl.java
ba9576d977c0379f5fb302c7db1b234b253919ad 17-Mar-2017 Adam Lesinski <adamlesinski@google.com> AssetManager: Guard against null in array retrieval

Resources does the right thing and throws NotFoundException
if the result from AssetManager.getResourceTextArray() is null,
but AssetManager itself doesn't guard from the native implementation
returning null.

This lets callers always protect against missing resources via
catching NotFoundException.

Change-Id: I4f7ad32819bc9598efb28dbb10a59ff5201ecfca
Test: manual
ssetManager.java
ac873c9f25d2a687c9195226b9d680f51c91fa30 08-Mar-2017 Seigo Nonaka <nona@google.com> Clean up public FontConfig APIs

This CL contains following clean up:

- Hide unnecessary constructors.
- Change List<XX> to XX[] since actually all fields are immutable.
- Change font's variant type from String to int.
- Decouple resource related members to FontResourcesParser.
- Add NonNull/Nullable to all fields.

Test: ran android.content.res.FontResourcesParserTest

Change-Id: If456266ffff86d41342572a19662cc8f3cd13181
ontResourcesParser.java
esourcesImpl.java
3c4be77db95ea716889568bde853be082e764da9 07-Feb-2017 Clara Bayarri <clarabayarri@google.com> Support non-system Font Providers

To do this, the developer must specify the set of certificate
hashes that represent the authority's app. This allows us to
verify that the authority we find is indeed the one intended
by the developer.

Bug: 35025705
Test: runtest --path frameworks/base/core/tests/coretests/src/android/provider/FontsContractTest.java
runtest --path frameworks/base/core/tests/coretests/src/android/content/res/FontResourcesParserTest.java
CTS attached to topic
Change-Id: I605f9a93bbca8705936ead08efb4a5b4fdcc4882
ontResourcesParser.java
bd60e5bf2e58a5e6ef48281d684197aaf4f113fd 02-Mar-2017 Jason Monk <jmonk@google.com> Let ResourcesManager generate CompatResources

This will let the ResourcesImpl be updated and handle null cases
better.

Test: Select text while composing email.
Change-Id: Ia8aed22f02b040a202db9cbb2bc02687c693cfa1
Fixes: 34761805
Fixes: 35869547
ompatResources.java
ompatibilityInfo.java
fe25b1adaffbc9e84e6c8c5d5f863264becb3484 16-Feb-2017 Tim Zhang <tim.zhang@spreadtrum.com> Remove FastJNI optimization on AssetManager to avoid dead lock.

I found there was a dead lock among main, android.display and GC threads
when running monkey test.
- Main thread got a mutex and was suspended by GC thread.
- Android.display thread waited for mutex held by main thread.
- GC thread waited for suspention of android.display thread.

This will lead to ANR or screen freeze.

Fixes: 32480078
Test: builds

Change-Id: I13cf1eca3cb3b7c01aa754874f2b48aab0b472e8
ssetManager.java
bd9836496cc4fb7ba5ae14c6a3091ec06ee40e35 24-Feb-2017 Jason Monk <jmonk@google.com> Provide some compatibility story for devs in the past

They should be providing themes when resolving certain resources,
but they aren't anyway, so try to provide it free of charge, when
possible. Also, nothing is ever free.

Test: Open app that uses old/bad resource methods
Change-Id: Icd57aadf1202ddffb1dd73ab45119fae7e5d6130
Fixes: 35656110
ompatResources.java
8a362bb9a5bb3dd77f4b514dbc7b67024adeced4 24-Feb-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Fix mStringBlocks race in the AssetManager"
22723ffabaf37a23c39870f4ffc4794c76b3a755 10-Aug-2016 Johan Redestig <johan.redestig@sonymobile.com> Fix mStringBlocks race in the AssetManager

There were a few places where access to the mStringBlocks were
not protected.

The crashes seen where similar to:

java.lang.NullPointerException: Attempt to invoke virtual method \
'java.lang.CharSequence android.content.res.StringBlock.get(int)' on a null object reference
at android.content.res.AssetManager.getResourceValue(AssetManager.java:222)
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:188)
at android.content.res.Resources.loadXmlResourceParser(Resources.java:2110)
at android.content.res.Resources.getLayout(Resources.java:1111)

java.lang.NullPointerException: Attempt to invoke virtual method \
'java.lang.CharSequence android.content.res.StringBlock.get(int)' on a null object reference
at android.content.res.AssetManager.getPooledStringForCookie(AssetManager.java:312)
at android.content.res.TypedArray.loadStringValueAt(TypedArray.java:1212)
at android.content.res.TypedArray.getValueAt(TypedArray.java:1198)
at android.content.res.TypedArray.getColor(TypedArray.java:446)

What happened was that thread 1 was creating a new mStringBlocks in
makeStringBlocks while thread 2 was accessing mStringBlocks. The
makeStringBlocks starts off by overwriting mStringBlocks with a new
empty array and when thread 2 accessed its content NPE happened.

Bug: 30802713
Test: None (just added synchronization to help prevent races)
Change-Id: I810da26b161a6528b0dd241048dde5b239089244
ssetManager.java
766b9b255bd9db10f22ddf81c8168085224c7e59 18-Feb-2017 Jiaquan He <hejq@google.com> Fix ColorStateList bug.

A ColorStateList should be stateful when it has at least one
non-wildcard state.

Test: Manually
Bug: 35487255
Change-Id: Id94b6a8d172e22a522f73fcb378e342656f95e39
olorStateList.java
4b5a4d221f377686a730182a3bffb8c6f190e313 27-Jan-2017 Clara Bayarri <clarabayarri@google.com> Declarative downloadable fonts

Implement support for downloadable font requests in xml. Given the
xml fonts feature in O, this adds support to not only declare
local font files as font resources, but also Downloadable fonts
from a fonts provider.

A provider returns a font family (of one or more files) given a
query, so the new attributes are added to the font-family tag.

Additionally, add support to pre-declare downloadable font resources
in the Android Manifest. These will then be fetched at app startup
time so they are available to use from the Typeface cache asap.

When retrieving downloadable fonts via resources, the cache is
checked to see if the font is already there and is used, otherwise
a request is sent to the provider and the default font is returned
as we need a result synchronously.

To do this, the developer declares an additional fonts xml resource
file with the list of fonts to preload and links it in the manifest
with a meta-data tag.

E.g.:

res/font/mydownloadedfont.xml

<font-family xmlns:android="http://schemas.android.com/apk/res/android"
android:fontProviderAuthority="com.example.test.fontprovider"
android:fontProviderQuery="myrequestedfont">
</font-family>

res/font/preloaded_fonts.xml

<?xml version="1.0" encoding="utf-8"?>
<font-family xmlns:android="http://schemas.android.com/apk/res/android">
<font android:font="@font/mydownloadedfont" />
</font-family>

and in the AndroidManifest.xml

<meta-data android:name="preloaded_fonts"
android:resource="@font/preloaded_fonts" />

Bug: 34660500, 34658116
Test: WIP, need to add more
Change-Id: I1d92555e115e241bf23b59e6f5c6cca6c7361de7
ontResourcesParser.java
esources.java
esourcesImpl.java
b12397e57e79c5dd9e8b2cb3839f5cd30b5d515f 27-Jan-2017 Clara Bayarri <clarabayarri@google.com> Cache Downloaded Fonts in Typeface

If the requested Typeface is already loaded into memory, return
from the cache.

Test: none, optimization
Change-Id: I32422c47c68502ba83b7d976f6e05f70dda5daed
esourcesImpl.java
9b161fbdbc198d0162c02e28c1c5573cc1d66215 02-Feb-2017 Clara Bayarri <clarabayarri@google.com> Fix bugs in FontResourcesParser and add coretests

Bug: 34920360
Test: runtest --path frameworks/base/core/tests/coretests/src/android/content/res/FontResourcesParserTest.java
Change-Id: I41da558957d25a6f7ee62a4ed9fecf470b74f1d0
ontResourcesParser.java
fe98ad919bebaf41191b7fdf0a1d841198d4f46a 30-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Implement .xml font resource support"
0ee455a8997c14ff0f8cd99f11c80e1e3c236de3 27-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Convert native changing config flags to Java flags"
ed00bfdfae5d5cbc9e13f4e8affdece48f4c5b7f 20-Jan-2017 Clara Bayarri <clarabayarri@google.com> Implement .xml font resource support

This change implements the loading and parsing
of xml type font resources, and makes sure it is
used properly by TextView styles.

Test: run cts -m CtsContentTestCases -t android.content.res.cts.ResourcesTest
run cts -m CtsWidgetTestCases -t android.widget.cts.TextViewTest#testFontResources*

Change-Id: I5a2930b3ba7dad67d9607e9036a5dde6bab0c5a4
ontResourcesParser.java
esources.java
esourcesImpl.java
ypedArray.java
9ad386b37c4c4ebe1176caa8eeab131387fc93ed 26-Jan-2017 Alan Viverette <alanv@google.com> Convert native changing config flags to Java flags

Also adds more annotations.

Bug: 33080269
Test: ResourcesTest#testChangingConfiguration
Change-Id: I08d438821b96e3d74da1c1c34009673c77caf27e
ssetManager.java
esources.java
esourcesImpl.java
408afbf06040ea29d1a9d60e9dc50d1923068de4 25-Jan-2017 Romain Guy <romainguy@google.com> Change configuration's color mode based on the display's color mode

Bug: 32984164
Test: CtsContentTestCases

Change-Id: Iedc7d1cc488b80718576082667b6e96956c4f847
ssetManager.java
esourcesImpl.java
4832745b84d6a358582f2264d22acacf25e01b07 24-Jan-2017 Romain Guy <romainguy@google.com> Add color mode to activity/window

The color mode lets an application request a wide color gamut for
a specific window. This will also be used in the future to request
HDR. The color mode is currently either default (sRGB) or an undefined
wide gamut color space chosen by the platform. These attributes could
later be used to choose a specific color space if we deem this important
or useful.

This change also renames the various "colorimetry" attributes and
constants to "color mode" for consistency. These symbols were
added in O and can be safely renamed.

Test: CtsColorModeTestCases
Bug: 32984164
Change-Id: I4d4691dd12dbe3f3aa6a5cf893cff39aa16c739e
onfiguration.java
18e9f9f3778318918c44d944489cb50daaf45d1c 19-Dec-2016 Clara Bayarri <clarabayarri@google.com> Expose Resources.getFont

Based on the work already done in aapt2, load a Font from a
resource id.

Test: WIP
Change-Id: Idc06bfbfd16452a328bfcc6ea9dcfb723b633f0c
esources.java
esourcesImpl.java
c9ba55902123be5abcf2dcda5af9995be0b8d3d8 19-Jan-2017 Romain Guy <romainguy@google.com> Add wide color gamut and HDR resource qualifiers

Bug: 32984164
Test: Config_test, AaptConfig_test and aapt2_tests
Change-Id: Ie9c82bfe2d36b1d6180ee223250ab5bb2ce90dd4
onfiguration.java
8f3b174d90e3bf2093751fb1a1bd0603adac0222 19-Jan-2017 Adam Lesinski <adamlesinski@google.com> Merge "Teach apps to refresh AppInfos without restarting"
49a4a1dfceeebc4b94022827b7e68cc971689c84 12-Jan-2017 MÃ¥rten Kongstad <marten.kongstad@sonymobile.com> Teach apps to refresh AppInfos without restarting

Teach running applications to refresh already loaded ApplicationInfo
objects without resorting to restarting the application process.

Activities will be scheduled for restart via the regular life-cycle.
This is similar to a configuration change but since ApplicationInfo
changes are too low-level we don't permit apps to opt out.

This change is intended to be used with runtime resource overlays and
split APKs.

Test: Manual - command to update application via ActivityManagerShellCommand
Change-Id: Ice10a1691cced90eee95e3278fd784b8a9206d87
onfiguration.java
5471cfc7508a2d4de7a0e86ed2525a78d20b8947 17-Jan-2017 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add doc to Configuration.setTo() method"
d30149eeae0350242c6803651a2183ff9c2e1848 13-Jan-2017 Chet Haase <chet@google.com> Add doc to Configuration.setTo() method

Bug: 11187275
Test: doc fix only, no test
Change-Id: I121aa2e986dacbb794a26fdfba84f4f7b34bea86
onfiguration.java
1a6acdbb86c3e72bdb0a4dcab3bda58cbc4ea34c 13-Dec-2016 Zak Cohen <zakcohen@google.com> Introduce new UI_MODE_TYPE_VR_HEADSET and qualifier.

Bug: 30989383
Test: Unit test for aapt2
Change-Id: I66dc65af6327b94fed74538bee08cada0b8be4fa
onfiguration.java
abd917d1393318f34ad434138b47623b675faaf2 05-Jan-2017 John Reck <jreck@google.com> Workaround for custom TypedArray injectors

Fixes: 33814858
Works around a crash for apps that inject custom
TypedArrays, which is completely unsupported, but
given the ease with which the crash can be worked
just going with higher compatibility on this one.

Test: App referenced in bug launches

Change-Id: Iac9a9b4fefd08815544211ffa49b02259920381f
ypedArray.java
b8eac24ff27665fbf837f3b11c8b65ae098865e9 13-Dec-2016 Rob Carr <racarr@google.com> Merge "Correct error in Configuration.updateFrom"
df259d3021d892ff404afb857176465bc82cd8bb 06-Dec-2016 Robert Carr <racarr@google.com> Correct error in Configuration.updateFrom

When updating the non direction members of screenLayout
we check that they are not in total undefined, before
accepting the new value in full. This was enough for LONG/SIZE
which are always undefined or set together. It seems we have paths
now where SCREENLAYOUT_ROUND however can be undefined and the others
will be set. In this case if we pass a configuration with
SCREENLAYOUT_ROUND_UNDEFINED but LONG/SIZE set to updateFrom then
we will overwrite our previous SCREENLAYOUT_ROUND value.
This triggers extra configuration changes. We take extra care with
SCREENLAYOUT_COMPAT_NEEDED as it doesn't have an undefined value.

Bug: 33098677
Test: bit FrameworksCoreTests:android.content.res.ConfigurationTest
Change-Id: I6e7d123d5444f93c511aeb6e0f3adfea2a480352
onfiguration.java
929a81b81dc5ebdedf0fb4ba0aaa0ba544829304 07-Dec-2016 Wale Ogunwale <ogunwale@google.com> Merge "Revert "Correct error in Configuration.updateFrom""
64145dcbebdde22bc005f8968d72dc53045cff37 07-Dec-2016 Wale Ogunwale <ogunwale@google.com> Revert "Correct error in Configuration.updateFrom"

Change is preventing the device from showing the lock screen
after the boot animation.

This reverts commit 4647acb60e407670356c628d3a823c172dfeea64.

Bug: 33098677
Change-Id: If7ecb04b74d5b626c7c3517e7e8d1dc1566ccb17
onfiguration.java
892c750f17cc8542d0048c2cdc5bda57d38f9f1c 06-Dec-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Correct error in Configuration.updateFrom"
4647acb60e407670356c628d3a823c172dfeea64 06-Dec-2016 Robert Carr <racarr@google.com> Correct error in Configuration.updateFrom

When updating the non direction members of screenLayout
we check that they are not in total undefined, before
accepting the new value in full. This was enough for LONG/SIZE
which are always undefined or set together. It seems we have paths
now where SCREENLAYOUT_ROUND however can be undefined and the others
will be set. In this case if we pass a configuration with SCREENLAYOUT_ROUND_UNDEFINED
but LONG/SIZE set to updateFrom then we will overwrite our previous SCREENLAYOUT_ROUND value.
This triggers extra configuration changes.

Bug: 33098677
Test: bit FrameworksCoreTests:android.content.res.ConfigurationTest
Change-Id: I6eb321d27011a2af2134d0ed5b6864d4cd902dc3
onfiguration.java
f32adf447511d54c2aa0948d3c1ef44d461538ac 23-Nov-2016 John Reck <jreck@google.com> Clean up ApplyStyle JNI

Bug: 32573798

Mark input uint32_t[] as const. Use Read-only JNI
array access for input as it's faster than critical access.

Use non-movable arrays for TypedArray so that the address can
be resolved and stored, avoiding the need to do JNI array
access for the output.

Indicies is always non-null, so remove the optional checks.

Eliminate unused return value.

Benchmark results:
twelveKeyInflate 4963us -> 4713us
simpleViewInflate 73us -> 60us

Test: Device boots, benchmarks show faster

Change-Id: Ic3bde5aee31407d8903913f97f2218daf074499a
ssetManager.java
esourcesImpl.java
ypedArray.java
58857c8b2bd64272d2320f62fd860783bb671da8 29-Oct-2016 Alan Viverette <alanv@google.com> Always propagate changingConfigurations to newly-created drawables

Bug: 32395972
Test: ResourcesTest#testChangingConfigurations
Change-Id: I555f3271854bdb6026db15f855847714c4986af3
esourcesImpl.java
a8a9bc5860c5d6139366f01b2f66e3f592da92e1 14-Oct-2016 Andrii Kulian <akulian@google.com> Make usage of Configuration.EMPTY safe

With current approach there is a high chance of making a programming
error and altering the state of singleton Configuration.EMPTY object,
because previously configuration was usually set by link to it.

This CL changes the behavior to create Configuration member objects
only once and alter their state afterwards.

Test: Manual and existing tests still pass.
Change-Id: Ie267c2fbf555f137670b7bd2cd251b817c69bc8e
esourcesKey.java
32995223a85a3b774789091d97987dfacc1e9ef3 07-Oct-2016 John Reck <jreck@google.com> Convert utils fastjni -> @FastNative

Test: builds & boots, refactor no behavior change
Change-Id: Ieb569a70fd05b88a8d2bd7b285099c1fc1888a75
ssetManager.java
mlBlock.java
b10330d5191ebb50c397d8f3de50fda44698337a 16-Sep-2016 Andrii Kulian <akulian@google.com> Use Configuration#unset() instead of #setToDefaults() for clearing

Now Configuration.EMPTY has fontScale set to 0 instead of default 1.
To get config equal to empty unset() method should be used.
Because of incorrect usage of setToDefaults() there was a black flash
when exiting split-screen because override config was no completely
empty. Fixing that also allows us to simplify things a bit when checking
if override config changed.

Bug: 31533188
Test: manual - long-press overview to enter split-screen, repeat to exit.
Change-Id: I6bf7994ff88ebb42db2e2357b762857710432a58
onfiguration.java
bad43fcae487a19865c174483c11829379817c8a 19-Jul-2016 Adam Lesinski <adamlesinski@google.com> Fix undefined fontScale issue in Configuration

When using a Configuration object as a delta for use
as an update to an existing Configuration object,
the fontScale property is always defaulted to 1.0, which
is not considered "undefined". That means that fontScale will
always get overridden to 1.0.

This changes the undefined value of fontScale to 0.0, which is
set when the Configuration object is constructed. Thankfully,
the documentation for Configuration states that until
Configuration#setToDefaults() is called, the Configuration is in
an invalid state. That means that apps can not rely on fontScale == 1.0
without calling setToDefaults().

Bug:29924927
Change-Id: I19342c55f7057423f1ca8c5d8dce1dff07617d90
onfiguration.java
esourcesImpl.java
aa19d5e49e6258bc85fa7121fe489b63926ecfcc 16-Jul-2016 Adam Lesinski <adamlesinski@google.com> Deprecate Resources constructor and updateConfiguration() method

These methods were never meant to be public. Instead, developers
can use Context#createConfigurationContext().

Bug:30088019
Bug:29999297
Change-Id: I2b864136163deda0af99fa3bfe9ef4ee1077341a
esources.java
ce9cf64eb34242bd26bf4877d25c2058cbb52302 14-Jul-2016 Adam Lesinski <adamlesinski@google.com> Merge \"Don\'t hold on to AssetManager instances\" into nyc-dev
am: f8e99e72e7

Change-Id: I71b7499c6399ecbf1d8e8d93bf410aabbb2a1044
e60064ab3c399fdd084de11dada73af48735d2fc 13-Jul-2016 Adam Lesinski <adamlesinski@google.com> Don't hold on to AssetManager instances

If we enter multi-window mode or load WebView
assets into a Resources object, then the underlying
AssetManager instance may change.

crbug.com/627586

Bug:30118654

Change-Id: I837637bdad5370809db7f060d7d8536b536cad9e
ypedArray.java
ac3e0e590a7b425af20e2ac70569ced789155dde 24-Jun-2016 Adam Lesinski <adamlesinski@google.com> Update DisplayMetrics when resizing

Previously the DisplayMetrics passed to a new ResourcesImpl
object would be generated from the default DisplayAdjustments.
We now use the correct DisplayAdjustments for the ResourcesImpl
and make sure to update them for things like rotation changes.

Bug:29619314
Change-Id: If2ba0d7670a4554dcd3fde9766e2337f20a191fd
(cherry picked from commit 8e8d23214a71d8813ebd3676b192924c530cb913)
esources.java
esourcesImpl.java
8e8d23214a71d8813ebd3676b192924c530cb913 24-Jun-2016 Adam Lesinski <adamlesinski@google.com> Update DisplayMetrics when resizing

Previously the DisplayMetrics passed to a new ResourcesImpl
object would be generated from the default DisplayAdjustments.
We now use the correct DisplayAdjustments for the ResourcesImpl
and make sure to update them for things like rotation changes.

Bug:29619314
Change-Id: If2ba0d7670a4554dcd3fde9766e2337f20a191fd
esources.java
esourcesImpl.java
e894efa9b6b40865d6d5666a5d776ba4e7185156 22-Jun-2016 Adam Lesinski <adamlesinski@google.com> Merge \"ContextImpl: Keep DisplayAdjustments and Display in sync\" into nyc-dev
am: 0bf31c3fa6

Change-Id: Id0d16d2f9d69b87d4b4c01370eeceafe329d1817
4ece3d6bb18a609afcd0e82f0340b7d36ba24eea 17-Jun-2016 Adam Lesinski <adamlesinski@google.com> ContextImpl: Keep DisplayAdjustments and Display in sync

Make sure that when our Resources get updated, that DisplayAdjustment
and Display properly reflect the potentially new screen dimensions.

Bug:28388969
Change-Id: I340550ea094ece87abc8790dd46aaa60ab3cedd3
esources.java
esourcesImpl.java
309ebd6430a7df246110f614966e614290d6486b 18-Jun-2016 Roozbeh Pournader <roozbeh@google.com> Fix AAPT-compatible output format for locales

The previous code used a format that is not supported by AAPT,
although it claimed it was. The new code generates locale codes in
the format AAPT can consume, using xx and xx-rYY for simple locales,
and the b+ format for everything else.

Bug: 25599046
Change-Id: I34d432f23b84913d313d6562c110d7fad87c457a
onfiguration.java
4b2b615669edf0cb3e2b1dbf3116281477e1f0b7 08-Jun-2016 Alan Viverette <alanv@google.com> Return correct default theme on API >= 24

This method was broken, but it was returning light theme on N preview
builds, so we'll keep it consistent as we move into N release.

Bug: 29192690
Change-Id: I0d16abbe48756070dcd653c39d0da4124ea66b28
esources.java
380f3b12a4725a0534d62ada7c6f3bd67ebd0d01 02-Jun-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Release AssetManagers when ejecting storage." into nyc-dev
98bf12f99989ba2550fac83ee48ecbb6f1582f07 26-May-2016 Jeff Sharkey <jsharkey@android.com> Release AssetManagers when ejecting storage.

When ejecting a storage device, the system process needs to rapidly
release any open FDs to prevent itself from being killed by vold.

This change examines all ResourceImpls cached inside the system
process and evicts any that reference the storage device being
ejected. (ResourcesManager will gladly recreate any evicted entries
when asked again in the future.)

Also replace broken use of WeakHashMap, since we want the values to
be weak references, not the keys.

Bug: 28867548
Change-Id: Ib9cfc66497149b6d3f8d49213e9779408a331d2a
esourcesKey.java
f12fce1a3aa4b28335e3644057c346e205693189 28-May-2016 Andrii Kulian <akulian@google.com> Update override config to include some changes from global config

In override config for task we set Configuration#screenLayout field based on
initial global config + shrink to fit the area on screen given for this task.
However this field also contains information (like layout direction) that we
do not intend to override and it can be changed in global config separately.
In this case we need to update the override config with changes from global
config.

Bug: 28616488
Change-Id: I22673257621b3f9ae7933b37bd0fb9446c6042ea
onfiguration.java
f135b271bfaa5a23f3af5a15ce59fd4ffb44a6be 28-May-2016 Christopher Tate <ctate@google.com> Don't call .toString() on potentially null CharSequence

We're building an exception message string, but by explicitly invoking
.toString() we're accidentally triggering an NPE rather than the typed
exception we want to throw. Build the string in a way that will be
safe and sensical even if the CharSequence is null.

Bug 29009255

Change-Id: I1813260f0b36fd44506b8327f997dd20c2d6c8bf
esourcesImpl.java
b61e405397200f78b1c652143cba7c751df05a00 20-May-2016 Adam Lesinski <adamlesinski@google.com> Improve performance of LocaleList with Resources

We allow each individual Resources object to select the best
Locale for the given APK. This allows one update to the configuration
instead of multiple updates, once the locale is chosen.

The Java locale is selected from the app context's locale.

Bug:28625993
Bug:27325465
Change-Id: I99e1e53f522e560f3b80bbd1e1c605f552dbdff0
onfiguration.java
esourcesImpl.java
bd5cac67b8b3087c030cb9068e4db8ea19a3d72a 13-May-2016 Seigo Nonaka <nona@google.com> Clear locales without changing layout direction.

Calling Configuration.setLocales with emtpy LocaleList may change the
layout direction to LTR. To clear the locales in Configuration without
layout direction change, introduce hidden API to Configuration.

Bug: 28695661
Change-Id: I47c339dffb83099bd329ddb60237dab27b05f593
onfiguration.java
23cbe85610f780134cc77dd4a54732a22ed6e86e 18-May-2016 Yohei Yukawa <yukawa@google.com> Move LocaleList to avoid layering violation.

Since LocaleList needs to depend on android.os.Parcelable, we cannot let
that class belong to "android.util" package, which causes layering
violation.

Bug: 28819696
Change-Id: Ia8de2ee9df3dd0a42b1fe84574439519b680fe18
onfiguration.java
esourcesImpl.java
582dcac856268f13121d5775497c5e1ca13e47af 16-May-2016 Alan Viverette <alanv@google.com> Update docs for ColorStateList to include alpha

Bug: 28760030
Change-Id: I309364002220b9896f5ddf29dabde79636a722e9
olorStateList.java
3723194dc831f4734d465602b2e21449d9357c2e 12-May-2016 Adam Lesinski <adamlesinski@google.com> Merge "BluetoothManager: Make requestControllerActivityInfo one call" into nyc-dev
2d609eda74ea8e50018e020b923b2da92f866ead 09-May-2016 Greg Kaiser <gkaiser@google.com> GradientColor: Fix typo in documentation.

Bug: 28678266
Change-Id: I8f551108643698a1b6c573911509a4e48ad88783
radientColor.java
991357fe25b3addabf85b871df3f4098fc4b833b 10-May-2016 Adam Lesinski <adamlesinski@google.com> BluetoothManager: Make requestControllerActivityInfo one call

Instead of making multiple calls into the Bluetooth service,
make one call that can timeout. This helps prevent cases
when the Bluetooth process hangs and the system_server is calling into
it and causes a WATCHDOG restart.

Bug:28658141
Change-Id: I37778b7b6e508be420a21bdf23593ae89b38f5b8
esourcesImpl.java
10ea92aefa7051eb432383e0b56e7c44664fd560 02-May-2016 Raph Levien <raph@google.com> Make LocaleList constructor non-nullable

This commit makes the LocaleList constructor require non-null
arguments in all cases, and fixes all uses of LocaleList that could
previously pass a null to use getEmptyLocaleList() instead (which is
preferred anyway becaues it avoids an allocation.

Bug: 28460668
Change-Id: I4b8b3cfa82914412731c2b79003951c46cb2afa1
onfiguration.java
b163870d46488df0cc068b27f91fb8df6ea66515 27-Apr-2016 Raph Levien <raph@google.com> Give guidance on alternatives to deprecated locale field

The deprecation message for the "locale" field should clearly state
what to do instead when only the primary locale is needed.

Bug: 27532422
Change-Id: I3e83cc1e9054d4e199d7e34b1a42b7bcd6c77f62
onfiguration.java
952802e2d1ccfd93c6640de512105f4e400ce473 04-Apr-2016 Alan Viverette <alanv@google.com> Fix bad workaround docs in Resources.getDrawable()

The real solution is to use ContextCompat, but we can't reference support
library from framework. C'est la vie.

Bug: 27727320
Change-Id: Ib9bcd5f2bdce1996f02fd44877df9ba202b26edc
esources.java
e03c469fd416cf68c9d27268140f058028cd8666 17-Mar-2016 Teng-Hui Zhu <ztenghui@google.com> API review: Hide ComplexColor and GradientColor

b/27532267

Change-Id: I01582e067ec8f4897c34dcec0f7c14700c40e02b
omplexColor.java
radientColor.java
esources.java
ypedArray.java
0b9295d06750dc6da032a2b2092e2c500c65393f 10-Mar-2016 Alan Viverette <alanv@google.com> Push flags from top-level TypedValue into ComplexColor changing configs

Previously a ComplexColor that was defined within varying configs would
not push the flags into its changing configs, so it wouldn't get reloaded.

This implementation follows the Drawable implementation, where the base
changing configs are stored in the superclass.

Bug: 27573177
Change-Id: I1da5ee6ab998d8296f8860c1a99d3e1399438543
olorStateList.java
omplexColor.java
radientColor.java
esourcesImpl.java
ac85f90466dd60d2af8ffc3942d503a0de606726 11-Mar-2016 Alan Viverette <alanv@google.com> Ensure all Java-side usages of config flags are using Java flags

Previously we were using native config flags in some places that expected
Java flags, and vice-versa. All usages of config flags are now annotated
to ensure we're using the right type.

Cleans up annotations on most methods that were touched.

Bug: 21161798
Change-Id: Ifd87dfb12199fc8258915d8a510e03ddb681ca89
ssetManager.java
olorStateList.java
onfiguration.java
onfigurationBoundResourceCache.java
onstantState.java
radientColor.java
esourcesImpl.java
hemedResourceCache.java
ypedArray.java
082614c6a57a115ee0c5975e3579bf34a178c0f8 04-Mar-2016 Adam Lesinski <adamlesinski@google.com> Cache per-Activity Resources objects

Each Activity has a Resources object whose underlying state changes
when a configuration change occurs, both global and for that activity only (multi-window).
Views and other clients of the Resources object can safely cache it knowing that
they always have a reference to the most up-to-date resources.

This applies to Resources.Theme objects as well.

Bug:26854894
Change-Id: Ifd3da5a1086e17f747dfc265a447fe92a3a5c692
esources.java
esourcesImpl.java
esourcesKey.java
e4e4da5cc6436c66765130e9ce498d29717c5f33 08-Mar-2016 Tenghui Zhu <ztenghui@google.com> Merge "Add tileMode support into GradientColor" into nyc-dev
1664a829eb08dd5c0f567f6466368ef1d1895e36 05-Mar-2016 Teng-Hui Zhu <ztenghui@google.com> Add tileMode support into GradientColor

So VectorDrawable can have tileMode supported Gradient color.
b/27126035

Change-Id: Icbf5983be165f04dc640627f6208fb1292f15625
radientColor.java
fb302ccd8e0610a09691ea5503ff8111dc7a2e41 01-Mar-2016 Adam Lesinski <adamlesinski@google.com> Move the guts of Resources to ResourcesImpl

In order to satisfy the requirement that clients can
cache a Resources object when a configuration change happens,
we move the caches and all other method bodies to ResourcesImpl.
These can then be swapped out for the correct version when needed,
while allowing clients to keep holding the existing Resources references.

This is part 1 of 2 CLs. The next one will do the actual switching of implementations
based on configuration changes for multiwindow.

Bug:26854894
Change-Id: I41156194a3541e59053b4048c3a15981c7d8a506
onfigurationBoundResourceCache.java
rawableCache.java
esources.java
esourcesImpl.java
ypedArray.java
5c64b957dd710cce27134cd480e0b83563c50d7f 28-Feb-2016 Alan Viverette <alanv@google.com> Use asset cookie in XML block cache key

Ensure we're using file paths from the correct package. Also cleans up
synchronization to avoid synchronizing on local variables which, while
not an issue in the current implementation, is generally unsafe.

Bug: 27313689
Change-Id: Ib8550909e7b02ea88d19ce2fc43756a16f9664ab
esources.java
5b90e82827dbd0aa7fe9a0893f9174aab1a1602a 24-Feb-2016 Alan Viverette <alanv@google.com> Use correct index when obtaining unresolved attribute value

Change-Id: I03e12157f74901e3188fec6663ae22cfaa849176
ypedArray.java
fde021371668fa8feb62569af155efeecda18026 23-Feb-2016 Alan Viverette <alanv@google.com> Remove @Nullable annotation from getDrawable() methods

Developers usually do not need to check the result of getDrawable(), so
we shouldn't be annotating it like they do.

Bug: 27134828
Change-Id: I0db0ca806fd89c18781da452fe3f31ef344f3cca
esources.java
fee44846376c212114223fc4259382921e6dca7a 05-Feb-2016 Roozbeh Pournader <roozbeh@google.com> Various LocaleList cleanups

- Remove the LocaleList#getPrimary() API. It had become confusing
after locale negotiation was completely implemented. For example,
it could create the confusion that calling getPrimary() on the
default locale list would provide the default locale, etc.
- Use the adjusted locale list from LocaleList.getAdjustedDefault()
in Paints created with no locale list provided.
- Change LocaleList#get() to treat out of bound indexes from both
negative indexes and too large indexes the same way.

Bug: 26984092
Bug: 26193251
Bug: 26834387
Change-Id: I75f77aea6b75e38793ed8477e5e5a4420d5e6d85
onfiguration.java
esources.java
dbee9bb342cdfaa5155b1918f90262c05e2464cb 15-Dec-2015 Teng-Hui Zhu <ztenghui@google.com> Gradient for VectorDrawable's fill and stroke

Add ComplexColor interface for both GradientColor and ColorStateList.
Set up constant state, factory, theme attrs for GradientColor, while
refactoring the ColorStateList's similar code. (Functionality in CSL should
be the same).

Support themeing in both the root and item level in GradientColor.
For example, both startColor in <gradient> tag or color in <item> tag can
have theme color.
Add tests for both simple and complex cases with themeing etc.

Hook up the native VectorDrawable implementation using 2 extra JNI calls for
simplicity. Such calls only happen at inflate and applyTheme call.

b/22564318

Change-Id: Ibdc564ddb4a7ee0133c6141c4784782f0c93ce0e
olorStateList.java
omplexColor.java
radientColor.java
esources.java
ypedArray.java
834641b3908b21e7054c290e116d76e3d5e6888c 24-Jan-2016 Roozbeh Pournader <roozbeh@google.com> Move locale negotiation to ResourcesManager

Previously, locale resolution happened at Resources level, which
could result in different Resources in the same app using different
locales.

This change moves the locale negotiation to ResourcesManager, which
remembers the locales supported by each Resources as they are
created, and negotiates the locale based on their union.

It also makes sure that the old model of apps getting the default
locale by accessing it through the Configuration's locale attribute
continues to work, since the negotiated locale will be moved to the
top of the list before Resources are created and when they are
updated with a Configuration change.

Bug: 25800576
Bug: 26404653
Change-Id: I0dd81df288327fd8d1229188c9544ee2209c161a
esources.java
1f0945e9f6fc81f5c58da24a29c86e1efa2714ef 20-Jan-2016 Raph Levien <raph@google.com> Update mResolvedLocale more aggressively

A client that mutates the locale of the Configuration being updated
can cause failure of the test that mResolvedLocale needs to be
recomputed. This patch stashes the previous locale list privately
so that updates can be detected even in this case.

Bug: 25993843
Change-Id: I1ea17dffd722177fb5b65ee77b9f5ce9a943f15b
esources.java
946502f50a4e4d757df03e16bcc72f21db487a43 06-Jan-2016 Alan Viverette <alanv@google.com> Merge "Cache XML blocks against file name rather than resource ID"
b7e3363359eea808a3225f5e9133175f2cf4106c 06-Jan-2016 Alan Viverette <alanv@google.com> Merge "Clean up asset manager package-private methods"
ec76b2a1d8c14dc01986d86718dae3acf6a09288 06-Jan-2016 Alan Viverette <alanv@google.com> Merge "Skip the cache when loading drawables from a foreign density"
10979613899ca3963c7d64d25d5f8ef7db1dde84 06-Jan-2016 Alan Viverette <alanv@google.com> Cache XML blocks against file name rather than resource ID

Caching against resource ID leads to incorrect cache hits, since multiple
files (ex. within drawable-mdpi, drawable-ldpi) may map to the same ID.

Also adds nullability annotations.

Bug: 26400880
Change-Id: I4d83caf3c44dc9b546511753e9e72171e8850eb2
esources.java
7941a7fd8e2976922172ef28106b803caa49d7d1 06-Jan-2016 Alan Viverette <alanv@google.com> Skip the cache when loading drawables from a foreign density

Bug: 26400880
Change-Id: I87c06b30afc61495fe62aa6a9dfe77990200cde7
esources.java
fb9236cb0c7bdad05ad01b722806edde7385b296 16-Dec-2015 Roozbeh Pournader <roozbeh@google.com> For locale negotiation, assume English is always supported

In practice, a lot of apps provide English resources as their default
resources, so assume that English is always supported.

With this change, users can safely set secondary locales after
English in their preferred locale lists. Such settings would help
the apps (and parts of the system that are aware of multiple locales)
consider the user's familiarity with the secondary locale or the
user's preference for glyphs forms in the secondary locale. This
change makes sure that no app unintentionally switches to such
secondary locales.

Note that this doesn't break from the tradition of previous releases.
Traditionally, if the user had set the system locale to English, they
would get the default resources when the app didn't explicitly
provide English resources. This will continue to be the case where
the user's locale list has English in it before another supported
language. (English will be the first locale in most cases.)

Bug: 26192817
Change-Id: I2c1a003760299157786c1b3f9fb116ce18db3b8c
esources.java
e273b93651785d0692e21d3f93f324aa496c4696 05-Jan-2016 Alan Viverette <alanv@google.com> Clean up asset manager package-private methods

Refactors duplicate code, flattens methods by inverting if blocks, updates
nullability annotations, fills out missing javadoc, uses consistent
variable names. No functional changes.

Change-Id: I4c3a139197697a9d6f6afc9c428a193c02fc777c
ssetManager.java
1c686f2ce6cbfa3fdb598f452aa31d38f3eb2320 18-Dec-2015 Roozbeh Pournader <roozbeh@google.com> Avoid matching system locales in locale negotiation

Also:
1. Add AssetManager method for finding non-system locales: This is
used in per-app locale negotiation. (Normally,
AssetManager#getLocales() returns both system and non-system
locales.)

2. Match pseudolocales correctly in locale negotiation.

Bug: 25800576
Bug: 26236938
Change-Id: I116caf3a91c290deb4ad68b291c65b7035b18dd4
ssetManager.java
esources.java
dad100699a8cb2537d8a4ec1d1c3df9aaff6a6eb 15-Dec-2015 Roozbeh Pournader <roozbeh@google.com> Negotiate locales during Resources contruction and updates

This also adds a new API to Resources, to get the resolved locale
from the Resources.

Bug: 25800576
Change-Id: I431f1c1b4b6775fcbc097936d0d607400db47f7d
esources.java
1168548de3e8a5df514c7758da9e3d860f58b948 09-Dec-2015 Roozbeh Pournader <roozbeh@google.com> Merge "Fix null locale edge cases in Configuration and Resources"
c078c605ab904b0e4a5d793cbeffd78c340f2816 08-Dec-2015 Alan Viverette <alanv@google.com> Attach drawable resource ID and name to getDrawable() exceptions

Wraps the entire getDrawable() method in a try/catch block. Clears the
stack trace from the re-thrown exception, since we only need the trace
from the original exception.

Also clears stack traces from re-thrown RuntimeExceptions in applyTheme
implementations.

Change-Id: I92396abf9e748eef78777174b297a09e118f5e70
esources.java
8a412e0bb76e22d65cb2e3de1eff9945e502ecc3 03-Dec-2015 Roozbeh Pournader <roozbeh@google.com> Fix null locale edge cases in Configuration and Resources

Previously, Configuration#setTo() would not copy a null locale, and
Resources#updateConfiguration() could fail if it was updated with a
configuration with a null locale or empty locale list.

Bug: 25874762
Change-Id: I76ef5769a16a5165b91c8e5ec5d926c67ef4f3c5
onfiguration.java
esources.java
4d07bc99f014dfa112f635148cc2fbb3d73e983e 16-Nov-2015 Alan Viverette <alanv@google.com> Clean up usage of temporary TypedValue in Resources

Reduces the amount of time that a lock is held and reduces the scope of
the lock to only manage the temporary TypedValue. Also ensures that the
typed value is consistently returned to the (single item) pool.

Additionally, performs some refactoring:
- removes unused variables and constants
- moves the NotFoundException cause into the constructor for consistency
with other Exceptions
- inlines sPreloadedDensity which was not used anywhere
- fixes line wrapping and indentation in nearby code

Aside from improvements to locking, there are no functional changes in
this CL.

Change-Id: I8c3059261e3cc2288a086e6637ab946e0b7d3741

Clean up usage of temporary TypedValue in Resources

Reduces the amount of time that a lock is held and reduces the scope of
the lock to only manage the temporary TypedValue. Also ensures that the
typed value is consistently returned to the (single item) pool.

Additionally, performs some refactoring:
- removes unused variables and constants
- moves the NotFoundException cause into the constructor for consistency
with other Exceptions
- inlines sPreloadedDensity which was not used anywhere
- fixes line wrapping and indentation in nearby code

Aside from improvements to locking, there are no functional changes in
this CL.

Change-Id: I8c3059261e3cc2288a086e6637ab946e0b7d3741
esources.java
417bbe017906c995aabe4f82e7a341d4e9f513e3 10-Nov-2015 Roozbeh Pournader <roozbeh@google.com> Fix case where some locales may have empty langauges.

This is to make the behvior the same as before
47f71a697a50e76565fef520a0f51e5d6826ceee for cases when some of the
locales' languages are empty.

Change-Id: Ifee92e199f20130e060670f244eb3b4b7be13872
onfiguration.java
87e1db355b55b1ecbe755cdcd9748f8edf612dde 10-Nov-2015 Roozbeh Pournader <roozbeh@google.com> Merge "Use the full locale list in resourceQualifierString()."
47f71a697a50e76565fef520a0f51e5d6826ceee 07-Nov-2015 Roozbeh Pournader <roozbeh@google.com> Use the full locale list in resourceQualifierString().

Previously, only the first locale was dumped to the output in
android.content.res.Configuration#resourceQualifierString(). Now the full
locale list is part of the output.

Change-Id: I5d4b73738a14d48533ee96c38dbc6c4b204ea998
onfiguration.java
0d02bd8442f6c062130aa6b9e6be5f87fddf7fb3 07-Nov-2015 Roozbeh Pournader <roozbeh@google.com> Removed unused setLocale() method.

The setLocale() method in android.content.res.AssetManager was not
used. Removing it to reduce maintenance cost.

Change-Id: I1b168fe84c2465d1ebc2b62bb965eda885e1220a
ssetManager.java
47571c76afadc23b8c2b4407a960e427e9db2472 01-Sep-2015 Roozbeh Pournader <roozbeh@google.com> Add LocaleList support to content.res.Resources.

Also remove the adjustLocales() method, since it's no longer possible
to create non-adjusted Locale objects using the public API.

The implementation is still in progress: currently only the first
locale in the list is passed down to the native code.

(Also fix the order of imports based on Android style.)

Change-Id: I325d7a2c0d86a9bf5cd202081f0b02299660364a
esources.java
bc5a6c5f0c090852ae2c52328a82c69d680bad3f 22-Sep-2015 Filip Gruszczynski <gruszczy@google.com> Preserve windows during stack resize.

It also adds debugging information for configuration changes, so it's
easier to observe what exactly changes.

Change-Id: Ia2cd4df9a868a8cea216ce137d67a1bb8ed2e6c7
onfiguration.java
ab5bca1519cb9acb4fd140e99a250fc50868ff2f 09-Sep-2015 Tao Bai <michaelbai@google.com> Merge "Load app resource as shared library."
a6d7e3fb9c9233b9ae46b702d17433854c43d6a0 02-Sep-2015 Tao Bai <michaelbai@google.com> Load app resource as shared library.

- Added aapt command line flag --app-as-shared-lib to build app resources
that could be loaded as shared lib at runtime.
- Added new method AssetManager.addAssetPathAsSharedLibrary() to load an
app resource as shared library.

Bug 22487604

Change-Id: Ib9b33c35f9c2b7129f3ba205de03d4564623ea39
ssetManager.java
b1a4bf2c4be73c72d2628b6087cf7b256376122a 04-Sep-2015 Wale Ogunwale <ogunwale@google.com> Ignore empty locale list when diffing Configuration objects

b46fdd4 introduced the concept of locale list to Configuration objects.
However, the change alway returned a locale difference when the delta
object locale list is set to the defualt (empty). We now don't return
a difference if the delta object as an empty locale list which is
consistent with what we did before the change and in line with how we
diff other configuration fields.

Bug: 23744091
Change-Id: I8c2c39d9a7e91e6a3a283312b745c4fdf6874396
onfiguration.java
b46fdd427c5fc2ca69506cad0b35ea805477319d 19-Aug-2015 Roozbeh Pournader <roozbeh@google.com> Make res.Configuration support locale lists.

We also deprecate the locale attribute, but works around the cases in
which people would call it.

Also add various methods to LocaleList to support the features
Configuration requires.

Change-Id: Iacc537e5fc1a3d4c1ea7e5517347876ca4e07e0a
onfiguration.java
02fc5fef36357467eba22a0ee250a96734daf791 27-Aug-2015 Alan Viverette <alanv@google.com> Extract drawable inflation to its own class, inflate from class name

Bug: 22627299
Change-Id: Icd2ac88af4f3102e08e52f6f0f7565839da6437a
esources.java
02e8c2d4188a99077686451b320e7d1860e49bd7 13-Aug-2015 Alan Viverette <alanv@google.com> Merge "Rebase system theme on configuration change"
8d38e7c905e6f9fd242081ec4d822753f5e4182f 13-Aug-2015 Deepanshu Gupta <deepanshu@google.com> Merge "Add StyleableRes annotation to TypedArray."
395cd017e66b81f9b223f5310cce9b827d156b4c 11-Aug-2015 Alan Viverette <alanv@google.com> Rebase system theme on configuration change

Also makes native theme accesses thread-safe to avoid a race condition
when modifying the theme off the UI thread. Since drawable loading can
occur off the UI thread, we need to ensure Theme access is thread-safe
anyway.

This reverts commit c12ec70def2a5682c6cd7fdb3adaa82cc34d5bf6.

Change-Id: If8fecde76d62738a8e55eddf898eafc468afdba2
esources.java
2349332f9f69189d7889692b9aafd6f80070e352 30-Jul-2015 Filip Gruszczynski <gruszczy@google.com> Only relaunch activity on significant size configuration changes.

Currently if the configuration width/height/smallest width changes, we
relaunch the activity or invoke onConfigurationChanged callback. When it
comes to size based configuration changes it might not be necessary: if
the size change doesn't pass one of the threshold defined by the
resources, it means there is no need to relaunch the activity.

In this CL the ActivityManager will receive the thresholds from the
application and use them to decide, whether to relaunch the activity.
The application reads the thresholds from the resources, specifically
from resource qualifiers used by the app.

Change-Id: Ie3cf0a172dc1ba0b865cf30c2962e7cfd9ad8436
ssetManager.java
esources.java
d7bb3f802973352dbbfdf2c9ce70f9027b5a3797 06-Aug-2015 Deepanshu Gupta <deepanshu@google.com> Add StyleableRes annotation to TypedArray.

Change-Id: Ice79b7791f72485aa3a6c2777334946316e72ff5
ypedArray.java
42969008ef898f204fc9f3504f85bb82ffc810c3 05-Aug-2015 Filip Gruszczynski <gruszczy@google.com> am 94858568: am c3080d78: am 841d7b75: am 52d3312a: Merge "Make ResourceKey always use non-null configuration override." into mnc-dev

* commit '94858568a1ee6af7b40ae0fcc5c4453dffca1cb8':
Make ResourceKey always use non-null configuration override.
a01f48681cdaf34e0943609683d0bbb26e761a58 04-Aug-2015 Filip Gruszczynski <gruszczy@google.com> Make ResourceKey always use non-null configuration override.

We don't differentiate between null conifguration and
Configuration.EMPTY, but if ResourceKey uses both, it will produce
different hashes and won't be equal. This CL makes ResourceKey always
hold a non null reference to the Configuration object.

We started delivering the configuration overrides in
Ib2c7be0b427f5ce05e7a362bcdd496ddbc9164f0, which changed behavior from
using always null, to using both null and Conifguration.EMPTY for empty
confgiuration. Now we will switch to using only one value, which is
Configuration.EMPTY.

Bug: 22620824
Change-Id: I090fd90ac21a6b3ebc7f2974a91dd7c861af10d7
esourcesKey.java
c447689d2770a5f09bbef19a3097236f4a8e7445 21-Jul-2015 Alan Viverette <alanv@google.com> am 872cb95c: am 9362d96a: am 783b3d9d: am 001f1e7e: Merge "Add missing invalidation check to drawable cache" into mnc-dev

* commit '872cb95cf211b6d30c8ac6f7670bbd5de19d33cb':
Add missing invalidation check to drawable cache
7ef1e773fdf5f7aadf151a682c7f55a1e4f3c502 20-Jul-2015 Alan Viverette <alanv@google.com> Add missing invalidation check to drawable cache

Bug: 22478448
Change-Id: Ic9da1898cd921d8c133ef5397fc97a664601a863
rawableCache.java
1913dc11b1bd6d23a13949f9bfa34ca3029d90a8 17-Jul-2015 Neil Fuller <nfuller@google.com> resolved conflicts for merge of 71165ea6 to mnc-dr-dev-plus-aosp

Change-Id: I21f2f14186965bdfc66ed3a2e6957d613837e138
b27b3057687fa6dda8f10d6661eef200f44fdfdf 15-Jul-2015 Rayhaan Jaufeerally <rayhaan@google.com> Migrate Resources.java to use ICU4j drectly.

This change means that NativePluralRules can be removed in its entirety
because this is the only usage of that class.

Using a small benchmark from the NativePluralResources test, ICU4c code
takes 38.6 us and ICU4j code takes 49.2us to execute.

Change-Id: I5dbf643807c024a9c9c0f1292363fa8e39db965a
esources.java
4feb3260152b2ddbd4a96c43c09cd1ed3cf2d3fb 13-Jul-2015 John Reck <jreck@google.com> Improve resource loading by ~3x

Bug: 22392651

ColorStateLists were never cached because the lazy-create
of the constant state had a typo.

Resource caching in general was broken because ThemeKey did not
clone the hash code, so all keys in the cache had a hashCode
of 0 which did not match the real, uncloned ThemeKeys hash code
so the binary search in ArrayMap based off of hash code was failing.

Change-Id: I9df1628b226bfa797bed97875354c19bf64f41ad
olorStateList.java
esources.java
0f1c95edf8c14ad16b96f350b5507664fccc2ba0 05-Jun-2015 Alan Viverette <alanv@google.com> Avoid NPE when drawable fails to load

Bug: 17760671
Change-Id: I99364e915e318b3e49fc758811784939a937de7c
esources.java
069767717a8323bbb05988137a91d40968af2972 02-Jun-2015 Alan Viverette <alanv@google.com> Remove strict mode violation from value to string coercion

The legitimate uses of value to string coercion, including the
interaction between lax attribute formatting and AAPT type inference,
combined with the low likelihood of unintentional coercion and low cost
of most string coercions, makes the value to string coercion violation
overkill.

Bug: 21563086
Change-Id: I7892e776d3e5479fcba507749b074c2abdf1b781
ypedArray.java
50ba321fbcecd0b050d755ff5a02eba7ab97bb00 01-Jun-2015 Alan Viverette <alanv@google.com> Prevent crash when ColorStateList has unresolved attrs

Bug: 21471789
Change-Id: Ieba6ab62b5e82eb716934a65efb6bfef2fc4e15a
olorStateList.java
d0699fa5697ba43c64c142ee67b245e0a346acfe 27-May-2015 Alan Viverette <alanv@google.com> Merge "Avoid strict mode violation during saveAttributeData" into mnc-dev
a6f354b78ecba3add458df2857d4fbd7b3f0dcbc 19-May-2015 Alan Viverette <alanv@google.com> Avoid strict mode violation during saveAttributeData

Adds a new framework-private method for obtaining a string without
throwing a strict mode violation on coercion.

Bug: 21109507
Change-Id: I5a7f091fc92d5abfde9e1c31f30d59ed02c7569b
ypedArray.java
49e7ff9647e6547c2b852944a5435a05794b9951 15-May-2015 Adam Powell <adamp@google.com> Add Configuration data for round displays

Add round values to the screenLayout field for Configuration
and a convenience method to check roundness.

Plumb this through the DisplayManager, making roundness the property
of a DisplayAdapter. The built-in main display will read the
configuration resource config_mainBuiltInDisplayIsRound to determine
its roundness. Device-specific resource overlays should set this to
true for devices with round primary displays.

By default, this config resource inherits from the existing
config_windowIsRound value currently used by some Android Wear
device configurations.

This change awaits another for aapt/native resources code to make the
resource filtering system aware of this property.

Change-Id: I1daced7ca6d6e172789e7c32bebfd43753bfa2ae
onfiguration.java
ac67409582aafd7c3f3f58a79b7b3292221a88b8 08-May-2015 Alan Viverette <alanv@google.com> Use correct array index for Theme.getTheme()

Change-Id: Ic462a7b8a81bb87bf08136bb30e3432f10269918
esources.java
0d857b9028f2702ce439e13feccde8182d40e1e5 22-Apr-2015 Siva Velusamy <vsiva@google.com> Improve hierarchy viewer dump hierarchy latency

Hierarchy Viewer obtains the properties for each view by using
reflection and looking for fields and methods that have the
@ExportedProperty annotation. Using reflection made it quite slow
for large view hierarchies.

This CL adds a new method (encode) to each class that wishes to
export data to hiererachy viewer. Inside this method, the object
can write a sequence of key, value pairs corresponding to the
values it wants exported.

With this change, the dump hierarchy operation that used to take
more than 10 seconds can be performed in a few hundred milliseconds.

Change-Id: I199ac2e7ca3c59ebcfec7e6bd201e134c41fd583
esources.java
e54d245b993e1347cb32c23a6bdc907a45fab324 06-May-2015 Alan Viverette <alanv@google.com> Improve keying for theme caches, rebase system theme on config change

Themes now use an array of applied styles rather than a String to store
their history. They are keyed based on a hash code computed from the
history of applied styles. The themed drawable cache has been abstracted
out into its own class.

Also updates system context to use DayNight as the default and ensures
that GlobalActions uses the correct context, which exercises the change.

CTS tests have been added in another CL.

Bug: 20421157
Change-Id: I9eb4b7dffd198ad24d02f656eaf0839570b59caa
ssetManager.java
onfigurationBoundResourceCache.java
rawableCache.java
esources.java
hemedResourceCache.java
c1d527926e1c82828e42bdc0c7abf50f6decc0a7 05-May-2015 Alan Viverette <alanv@google.com> Add API for obtaining changing configurations bitmask from Theme

Required to know when to reload the system context's theme in response
to configuration changes, and thus needed to support the DayNight theme.

Bug: 20267825
Change-Id: I7df5e28b7a6d8b611ea030032544cf4800788514
ssetManager.java
esources.java
8310f87d96791e8b864df5e821fe65273c2dd874 30-Apr-2015 Alan Viverette <alanv@google.com> Merge "ActionBar SearchView's default hint shouldn't override SearchableInfo" into mnc-dev
b4004dfc84b7c51519645020ea9431b051f5db62 30-Apr-2015 Alan Viverette <alanv@google.com> ActionBar SearchView's default hint shouldn't override SearchableInfo

Moves the queryHint to defaultQueryHint, specifies the override order
as queryHint > SearchableInfo > defaultQueryHint.

Cleans up annotations and comments for several related methods.

Bug: 20614122
Change-Id: Ib58ec309e6814cd512df147d789ec0cd546018af
esources.java
f601440e21f352f5e59dd27e6709c7137cd90090 30-Apr-2015 Alan Viverette <alanv@google.com> Stash modulation alpha until ColorStateList has resolved base color

Fixes an issue where specifying an explicit modulation alpha and a
theme-dependent base color discarded the modulation alpha during
applyTheme().

Sets the YOU MESSED UP YOUR THEME color to magenta, which matches the
behavior for RippleDrawable and should expose any remaining issues in
a painfully obvious way.

Bug: 20690409
Change-Id: I7a44f4bc4a5a85be6d3f27087b2d6c9ea12e1d29
olorStateList.java
9d1878674c86ab651926e192845d459bfafb6898 07-Apr-2015 Narayan Kamath <narayan@google.com> Merge "Don't set userSetLocale from Configuration.setLocale."
863ba4c4bfdf1e1f701ec85c078aa80ba4d67e83 06-Apr-2015 Alan Viverette <alanv@google.com> Merge "Unify drawable caches"
70392818f07f175d4914cef13b12c215ff08f1df 23-Mar-2015 Narayan Kamath <narayan@google.com> Don't set userSetLocale from Configuration.setLocale.

This seems to have been a mistake : userSetLocale controls whether
a locale is persisted and as written it's too easy to make system wide
locale changes without intending to. Third party apps do not have
sufficient permissions to set global locales anyway, so they won't care
whether it's set or not.

Also, set userSetLocale = true in the LocalePicker.updateLocale internal
API, which is what all platform apps use to set the locale.

In addition, this commit fixes a bug where we were not setting RTL
directionality for the default locale loaded by the activity manager
service.

Change-Id: I2e11ad31e012dfa314ab8d78034f986b49ecae60
onfiguration.java
2a53812cfad79e136a92d7a33a0dcab7ac063758 03-Apr-2015 Tor Norbye <tnorbye@google.com> Merge "Fix resource type annotations for obtainStyledAttributes"
c91531a863d65e4a74fa30ac9a20d02ccd31f5ca 02-Apr-2015 Tor Norbye <tnorbye@google.com> Fix resource type annotations for obtainStyledAttributes

Change-Id: I7681249ff46d687675d0dcd7d4f077646efba687
esources.java
4325f8e02a6aff999a11ad711d9e8aecc59c4ae2 02-Apr-2015 Alan Viverette <alanv@google.com> Unify drawable caches

Drawables that don't need a theme are now stored in a separate cache,
rather than storing a separate copy in each theme-specific cache.

Bug: 19992973
Change-Id: I98a67ea480af3d381469303439f4aea44ba1e909
esources.java
e0f95f39c5a669a48ee3ebb8dc45bf2d7ee940f1 01-Apr-2015 Alan Viverette <alanv@google.com> Fix issues with theming of preloaded ColorStateLists

Ensures changing configurations mask is propagated to the host drawable
so that it can be properly cleared from cache on configuration changes.
Also fixes constant state handling of the mask in the Inset and Rotate
drawables.

Hides new ColorStateList methods related to theming, since they should
only be used during preloading or internally by framework drawables.

Fixes bug where the cached versions of themeable ColorStateLists were
modified by calling applyTheme() on the host drawable.

Also cleans up some docs and naming in GradientDrawable.

Bug: 19966397
Change-Id: I8c8d3cabbaf94b488c2b8fe9fd423e07d824c19c
olorStateList.java
esources.java
0f09c3d0b6d483bbb457c62d67fac921f85e073a 27-Mar-2015 John Spurlock <jspurlock@google.com> Merge "Fix a few found doc problems."
a8636c9414d02e80998b538ceb2726c8f2c68fd0 27-Mar-2015 Alan Viverette <alanv@google.com> Clean up lint warnings in Resources

Change-Id: I28dff6f293c5b6c24fc451f282d11d648042d5dd
esources.java
bc4cf00dc5bf6e0e3c01206d5c46e64306df260a 25-Mar-2015 John Spurlock <jspurlock@google.com> Fix a few found doc problems.

Change-Id: I98567f4a0fc96f501c00bf361688e2c55232f78d
onfiguration.java
0ef59ac0e57e9b99d174d4a53f7d9639357743ac 23-Mar-2015 Alan Viverette <alanv@google.com> Update DatePicker and CalendarView to latest Material spec

Bug: 19431364
Change-Id: If364a051a5208d170495de4182e46b32c7560e08
olorStateList.java
4a357cd2e55293402d7172766f7f9419815fc1e8 19-Mar-2015 Alan Viverette <alanv@google.com> Replace usages of deprecated Resources.getColor() and getColorStateList()

Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
esources.java
tringBlock.java
93795053da04b0f16dadb6e56f6056bd2dd37875 09-Mar-2015 Alan Viverette <alanv@google.com> Make TypedArray and LayoutInflater exceptions more useful

Include unresolved TypedValue data in TypedArray exceptions, wrap all
LayoutInflater exceptions with the parser position.

Bug: 19658760
Change-Id: I8965bdc4d0c58c082cb7129c3b692a3e5418cfdb
ypedArray.java
80756e38882720860db52f1fcc21fa1505a02abf 02-Mar-2015 Tor Norbye <tnorbye@google.com> Annotate ARGB integer parameters with @ColorInt

Change-Id: I307f72a382272cf18ddb6b07d9fcb81228568d9a
olorStateList.java
esources.java
ypedArray.java
08c7116ab9cd04ad6dd3c04aa1017237e7f409ac 28-Feb-2015 John Spurlock <jspurlock@google.com> Remove unused imports in frameworks/base.

Change-Id: I031443de83f93eb57a98863001826671b18f3b17
esources.java
ypedArray.java
62c79e9a64c3b2cafd5500ed3064977dff7b7da3 26-Feb-2015 Alan Viverette <alanv@google.com> Implement landscape layout for time picker dialog

Adds support overriding default alert dialog panel elements by including
them in the dialog's custom content view, but no public API (yet!) since
the panel IDs have never been public. Some minor cleanup and refactoring
in TimePickerDialog. Removes Holo styles for "clock" and "calendar" style
pickers since they are new in Material. If the new styles are used against
Holo they will match Material but with Holo primary/accent colors.

Also implements themed color state lists to resolve TODOs in both time
and date pickers.

Bug: 19431361
Change-Id: I095fd8d653e02d9e5d20d66611432a08a7a5685e
olorStateList.java
7b9c912f536925ac6ec43935d6e97506851b33d6 31-May-2013 Tor Norbye <tnorbye@google.com> Add @ResourceInt annotations on APIs

Change-Id: I119cc059c2f8bd98fd585fc84ac2b1b7d5892a08
esources.java
ypedArray.java
60454dbc4d815c90ff2713e224953d6547fc3ad5 24-Jan-2015 Wale Ogunwale <ogunwale@google.com> Support activities in the same process having different resources.

Activities can be of various sizes in a multi-window environment.
This change allows them to have override configurations that allows
different resources to the loaded if needed.

Bug: 19002213
Change-Id: Ib2c7be0b427f5ce05e7a362bcdd496ddbc9164f0
esources.java
esourcesKey.java
6bbb47b7d5ac1b49d916679e5f081fe181d8f162 06-Jan-2015 Alan Viverette <alanv@google.com> Clean up TypedArray docs & formatting, remove coercion warnings

Establishes a clear contract regarding when exceptions will be thrown,
when default values will be returned, and when values will be coerced
to a different type.

Since we have both getInt() and getInteger() where one handles coercion
without throwing an exception, it seems reasonable that we should clearly
document the behavior so that developers can make an informed decision.
Once we document the behavior, there is no reason to log warnings on
coercion. If a developer chooses to use a particular API or data type,
that is still correct according to the API.

BUG: 18625719
Change-Id: I385f0b719182d3c0358943e1d6c3d7bedc756eb5
esources.java
ypedArray.java
304ea5aac77cae03b4e8440a7c73c18086d96a20 06-Jan-2015 Alan Viverette <alanv@google.com> Merge "Allow use of theme attributes in color state lists"
45c4bbbbce6bbad50a033efcba7948a23f1f117a 05-Jan-2015 Alan Viverette <alanv@google.com> Allow use of theme attributes in color state lists

BUG: 17384842
Change-Id: Ibdc413acbd00e37b908432abd55f6521c22b8fc9
olorStateList.java
esources.java
ypedArray.java
d6ebb3a75ef9c87ff5294462dc0637ca802d1e59 05-Jan-2015 Alan Viverette <alanv@google.com> Remove null entries from constant state cache

We insert null entries on cache miss, which can cause NPE on prune, but
we ought to remove these entries during prune.

BUG: 18842826
Change-Id: I9c0bca04f34575d1403de943abd8d12b18c9c032
esources.java
c4ec5b633e6162cbe9bb00b8f90ae89b871b9fbf 17-Dec-2014 Jeff Sharkey <jsharkey@android.com> Iterate based on index, not key.

Bug: 18785949
Change-Id: I5d92fedac9f71b997f87f7035635fde276756faa
esources.java
9267fda30c73558d4fddfc8e1834782498af742b 08-Dec-2014 Alan Viverette <alanv@google.com> Prune the resource cache before adding new caches

BUG: 18666986
Change-Id: I5f7e4983100c2d5e4478a4d82c21bb59fa87810e
esources.java
6c23ba0d8d39aed98197071c7cf9ffc0b6c633b5 03-Dec-2014 Alan Viverette <alanv@google.com> am a6779bc5: am 9a888816: Merge "Deprecate one-arg getDrawableForDensity, update currents.txt" into lmp-mr1-dev

* commit 'a6779bc51772aae2ba4cc94db2ae47b76a2cc972':
Deprecate one-arg getDrawableForDensity, update currents.txt
a6f8b2ce552debde1f8a1ea673d689f96c56d67b 03-Dec-2014 Alan Viverette <alanv@google.com> Deprecate one-arg getDrawableForDensity, update currents.txt

BUG: 18579576
Change-Id: I7df6ec2952ab121e2be8ae0a016ccf36f6fba2ff
esources.java
0cd6296c0afb92f63487247ef4c9c73715113926 03-Dec-2014 Alan Viverette <alanv@google.com> am 63c7a655: am 1b33396e: Merge "Deprecate Resources.getDrawable(int) in favor of the two-arg version" into lmp-mr1-dev

* commit '63c7a655beab21da934d21bb4004889bfb6e4417':
Deprecate Resources.getDrawable(int) in favor of the two-arg version
9438ad1599716176fb6c593e77a2e93b265bbcb5 03-Dec-2014 Adam Lesinski <adamlesinski@google.com> am e580d661: am e89a2865: Merge changes If2c7e09f,Ie21f227c

* commit 'e580d6617f67a1db5eff7ffe5450684cfc7e1a2b':
RRO idmap: pad with 0xffffffff, not 0x00000000
RRO: reintroduce lost ResTable insert of assets
c10e3960d9107f8663daa842ac57dedded4736e3 02-Dec-2014 Alan Viverette <alanv@google.com> Deprecate Resources.getDrawable(int) in favor of the two-arg version

This is a landmine for developers. If they need to obtain an unthemed
drawable, they should be using an explicit null theme.

BUG: 18579576
Change-Id: Ibca6b4c3e8e50dca144571244e035caec6fa91f8
esources.java
e89a286541e242ad96705fcdd1fe2c6a9eafb4a0 02-Dec-2014 Adam Lesinski <adamlesinski@google.com> Merge changes If2c7e09f,Ie21f227c

* changes:
RRO idmap: pad with 0xffffffff, not 0x00000000
RRO: reintroduce lost ResTable insert of assets
67c55be39a76fb17cff79d926914a37fe56d452d 25-Nov-2014 Alan Viverette <alanv@google.com> am 0d05788f: am 760cfb02: Merge "Check for null drawable in theme-less getDrawable()" into lmp-mr1-dev

* commit '0d05788fd06b24068c269bfa80dd96deafb00357':
Check for null drawable in theme-less getDrawable()
7e0aaae3db11e0f23dca8c4cddff261f0132266c 24-Nov-2014 Alan Viverette <alanv@google.com> Check for null drawable in theme-less getDrawable()

BUG: 18507509
Change-Id: I64e2950dc3a30f3979ec179789a6f6e055c9f86d
esources.java
47379f3050265453655ff82edd4c36bda01ba48f 21-Nov-2014 Alan Viverette <alanv@google.com> am e442e904: am 47172f53: Merge "Use parseColor instead of getHTMLColor"

* commit 'e442e904ae19f0b59ebfd4a7c735648b64bc955e':
Use parseColor instead of getHTMLColor
eed1fba6b54b3305af811b4dd9e367eab01a241b 13-Nov-2014 Narayan Kamath <narayan@google.com> Merge "Add detailed javadoc for AssetManager.getLocales." into lmp-mr1-dev
d9f3fdf45bd3e3b5b02f2d21b6df6598cbaf1c70 12-Nov-2014 Alan Viverette <alanv@google.com> Ensure time picker dialog fits on small screens

Also fixes dialog padding in landscape mode and a bug in the
ColorStateList method used to apply a selected color.

BUG: 18251582
Change-Id: Id5b8c7893ec42fd4d5f4a7520e6ac170839d3143
olorStateList.java
11bce123b91cee70380bffa3fffa3c9d19ef3ebd 12-Nov-2014 Narayan Kamath <narayan@google.com> Add detailed javadoc for AssetManager.getLocales.

bug: 18218661
Change-Id: Idcbd8678b6dd1b28f993c4dab000e284db76edc0
ssetManager.java
a987d9af69ca5447a888a3d5b50f3511d4b8f0da 10-Oct-2013 Stefan Wysocki <stefan.wysocki@sonymobile.com> Use parseColor instead of getHTMLColor

getHTMLColor is not aware of ARGB color format which is commonly used in
android xml files. This causes problem with coloring spans in resources.

Instead of above it should be changed to parseColor() with supported
formats: #RRGGBB #AARRGGBB

Bug: https://code.google.com/p/android/issues/detail?id=58192

Change-Id: I16bdf4c5c2a3b5e216b44e5c1955cac0104b3e12
tringBlock.java
30113131fb958850ef92c6a8f7f2aa2ed92a8ffe 07-Nov-2014 MÃ¥rten Kongstad <marten.kongstad@sonymobile.com> RRO: reintroduce lost ResTable insert of assets

With the recent introduction of AssetManager::appendPathToResTable,
overlay packages were not properly added to the AssetManager, and once
added, were not properly inserted into the ResTable.

Bug: 17765434
Change-Id: Ie21f227c654c98730f74a687d0e16ee2b80e747e
ssetManager.java
7f4a63d1ebc13c6499a48331ecb78c4d27446dbc 30-Oct-2014 Alan Viverette <alanv@google.com> Ensure we don't pass null values in to Theme.resolveAttributes

BUG: 18182274
Change-Id: I08acf877cb81478cc205254edf92a31fcf05991d
esources.java
f2969405020a72e282c348a6ea201d56e9f8d4ba 30-Oct-2014 Alan Viverette <alanv@google.com> Distinguish unspecified and explicit null values in resources

BUG: 17919345
Change-Id: Ic4f04f7dd0f986f58a749b5950d80c1cfdb074ea
ypedArray.java
1bb18c435dbf967f3a9bc9d680411471b8bab4ac 18-Aug-2014 Adam Lesinski <adamlesinski@google.com> Add dumpsys output to UsageStatsService, along with --checkin support

Bug:17814138
Change-Id: If414ae5f4b8e4a2838f63f52d80e764915cee934
onfiguration.java
d422dc358f0100106dc07d7b903201eb9b043b11 25-Sep-2014 Yigit Boyar <yboyar@google.com> Added a generic configuration and theme based cache

For now, only animators use it but we can consider migrating
drawable cache to it as well.

Bug: 17456416
Change-Id: I571b96856805edb171f0fc52e6bff5a365f46b70
onfigurationBoundResourceCache.java
onstantState.java
esources.java
9086562a6a524cc0c96231411863cd65d8785bfe 17-Oct-2014 Adam Lesinski <adamlesinski@google.com> Minor resource notation/compatibility fixes

- Change the format of mnc/mcc when printing a resource-qualifier
formatted string from a Configuration object.
- Correctly bump the SDK to 21 when using anydpi in a resource qualifier.

Change-Id: I3c31e344dc5384d45398d6e9f264a073abab65d1
onfiguration.java
727cae197b123ef764a1f8fbe08a995b000d14c3 08-Oct-2014 Alan Viverette <alanv@google.com> Mutate and apply theme if needed before caching themed drawables

This ensures that drawables are completely separated from their cached
constant states before applying a theme. After this, we can remove the
implicit (and incomplete) mutation in the clone constructors.

Also implements missing mutate() method on ClipDrawable.

BUG: 17646144
Change-Id: If0d66b0a85724d76e0a4f506758c7ba3c0aa3410
esources.java
60004caeba750c49aa258056e57ada898a086fc0 23-Sep-2014 Alan Viverette <alanv@google.com> am 9e84a6a0: Merge "Fix inaccurate TypedArray.getDrawable() documentation" into lmp-dev

* commit '9e84a6a08b4ff50b745a6eaf35e52b9c7aef4c39':
Fix inaccurate TypedArray.getDrawable() documentation
fde4e3b17a5ead9f1a0848bf35b4f49f16600795 23-Sep-2014 Alan Viverette <alanv@google.com> Fix inaccurate TypedArray.getDrawable() documentation

The documentation implied that you could override
Resources.getDrawable(int) to load custom drawables, which is
not the case.

BUG: 16635905
Change-Id: I06c0febe2d6d4194ef5a31f167b378fe311b7a2d
ypedArray.java
56c4f5c139e6aa863bc971557d2aed5d1bec02e0 14-Sep-2014 Alan Viverette <alanv@google.com> am 84670eef: Merge "Reduce instructions required to obtain and recycle TypedArray" into lmp-dev

* commit '84670eef1f2d685efc98644914d2bb191d0e665c':
Reduce instructions required to obtain and recycle TypedArray
8b5b25b4487e22eb8a7dae32ee32f420210321a0 14-Sep-2014 Alan Viverette <alanv@google.com> Reduce instructions required to obtain and recycle TypedArray

Eliminates several field and method accesses by making the TypedArray
pool local to a single Resources object. Removes an unnecessary
synchronization.

ReadXmlAttrs averaged 0.069 ms/op before, 0.064 ms/op after.

BUG: 17484798
Change-Id: If790a5ba6596b47a04f117c8912974798a592052
esources.java
ypedArray.java
3068d14257e3a78c506301bb136e6a3871e5b9e1 06-Sep-2014 Jon Miranda <jonmiranda@google.com> am 9f7fee39: Merge "Added getStyleAttributes to access all Theme attributes." into lmp-dev

* commit '9f7fee392640eeba2922820e02d577a1a950702f':
Added getStyleAttributes to access all Theme attributes.
05cc48292b7c49be7aa11310173013cd3b656e08 06-Sep-2014 Jon Miranda <jonmiranda@google.com> Merge "Added getStyleAttributes to access all Theme attributes." into lmp-dev
042ad633bc68bdda2bb0c50216706d73575a5992 04-Sep-2014 Jon Miranda <jonmiranda@google.com> Added getStyleAttributes to access all Theme attributes.

ViewDebug uses getStyleAttributes to get the attributes, and then gets the
attribute name and value so that Hierarchy Viewer can display it.

Bug: 17407087
Change-Id: I3577e32ae99668383701dc908bb46db14a75c3c4
ssetManager.java
esources.java
58a31042065922209fbafdcd33ef82646853bb21 04-Sep-2014 Adam Lesinski <adamlesinski@google.com> am 0c0fcce6: Merge "Add Configuration changes to UsageStats" into lmp-dev

* commit '0c0fcce6a5ce39df0161a78fbb0577d4c70a7a87':
Add Configuration changes to UsageStats
7f61e96db7c90c1f4418359672aa4656aebee500 03-Sep-2014 Adam Lesinski <adamlesinski@google.com> Add Configuration changes to UsageStats

Bug:17354208
Change-Id: I9b2f595e51b656607e30e798926cfb7e25134944
onfiguration.java
05e6dde3a0b9ba1eb3d13d511fe2e27a0d10c851 01-Sep-2014 Wink Saville <wink@google.com> ksd to lmp-sprout-dev

Change-Id: I94eb65c62231b5831570bb0cbbbd9c916bee0a37
esourcesKey.java
31245b4f06003f1c8cd44c31b387c96ab4e282f9 23-Aug-2014 Adam Lesinski <adamlesinski@google.com> Introduce anydpi density resource qualifier

This is meant to be used with scaleable vector
drawables, and are chosen as the best match unless
there is a configuration that matches the density
requested exactly.

Bug:17007265
Change-Id: Ic3288d0236fe0bff20bb1599aba2582c25b0db32
onfiguration.java
ebc3e4cbf14f62a2134aded9068e147ea8cbc23b 21-Aug-2014 Adam Lesinski <adamlesinski@google.com> Report the right resource version in am get-config

Change-Id: I79ed3db45d91d8ec7e6f67608533ce3adf22ab27
onfiguration.java
836c0a8b949d71293c996761691e065f0651acef 11-Aug-2014 Jon Miranda <jonmiranda@google.com> Exposes style and theme data, adds developer option.

Adds support for a String[] return type in ViewDebug; and in addition to that,
the hasAdjacentMapping method can use the String array as means to map a key to
its value.

Adds DEBUG_VIEW_ATTRIBUTES to Settings so that the heavy per-view
computations only affect those who opt in. This setting is used in
CoreSettingsObserver to avoid impacting start time.

Change-Id: I8f507e4e5361414c30d247e8d9815205feb5e91f
esources.java
54130de7d2a0827179acaa35980dbce419cb4fca 20-Aug-2014 Adam Lesinski <adamlesinski@google.com> Fix crash when launching Activities in 'android' package

The LoadedApk for the 'android' package doesn't have a resource
directory set. This is fine since the AssetManager loads the
'android' package's resources by default.

This is a regression caused by https://googleplex-android-review.googlesource.com/#/c/525840/

Bug:17104110
Change-Id: I8a2158a75b4ff0e941837c11a2cb77a7aad09270
esourcesKey.java
34a14f967ab6c88829c9a36ce6e909c47b3ee398 16-Aug-2014 Alan Viverette <alanv@google.com> Better handling of unresolved theme attributes

Also adds a (very obviously wrong) default color to RippleDrawable

Change-Id: I6d29b371f4e59accbebf25eb059b1f372b9184b0
esources.java
b1e1dbfb36b658bd2710fedf8c0381a5d89fa302 08-Aug-2014 Alan Viverette <alanv@google.com> Update disabled states to be less opaque

Also adds Resources method for retrieving floating-point values.

BUG: 16374059
Change-Id: I68c6a40cbe5badfad624548b9abf2d657dbc2019
olorStateList.java
esources.java
60727e07c6ef72e2f494266939c02494a3df28f8 29-Jul-2014 Alan Viverette <alanv@google.com> Clean up TimePicker and DatePicker styling

Removes the time and date picker specific themes and defaults their
theme attributes to use the alert dialog theme attribute's value.

BUG: 14973897
Change-Id: Id5cc74ea0c1a379fc1ee76b354a1bb5ba329585a
olorStateList.java
500c56089f7e3e2735a105954a05801025d56921 29-Jul-2014 Alan Viverette <alanv@google.com> Partial revert "Add better errors for unresolved attributes, remove unused code"

This reverts commit 0e42f4b98752b6457b04887e2a557fa007da73d7.

Change-Id: Ic3f0cb709c7aaa0a9892d728311886714ba73f22
ypedArray.java
216d3e6d8114a819758850c1be8d62fef59a107f 29-Jul-2014 Alan Viverette <alanv@google.com> Add better errors for unresolved attributes, remove unused code

Change-Id: Icf81a81b9ce97b5a5edff85569e6e3da93149436
ypedArray.java
4c6ce23816acdede6eb589cba07916a5340d0a38 18-Jul-2014 Narayan Kamath <narayan@google.com> Remove copy of Locale.adjustLanguageCode.

(cherry picked from commit 1d31a5f8243fd6befb14d8a2ba25d28e006511f8)

Change-Id: I7b30a153a44dc1f99a9ddfe256b770d7305a74b7
esources.java
7df3625d5bb28d11cce9ac23429f5e3c6ebac030 16-Jan-2014 Martin Kosiba <mkosiba@google.com> Allow for appending of resources to an AssetManager.

BUG: 11505352
Change-Id: Ifa290580a6dc63c2f471d0bbf5f066db14aed4d7
ssetManager.java
da96e137bcc8191c584ada7b5de31eaae92f244f 15-Jul-2014 Jeff Sharkey <jsharkey@android.com> Parse more split APK manifest details.

Allow split APKs to define activities, services, receivers,
providers, and metadata. However, support for many manifest items
are explicitly omitted.

Only dexopt split APKs that include code.

Bug: 14975160
Change-Id: I2fbf99e2a62328aa2185e5924755af33060282fc
ssetManager.java
5cd9dde5a2a77c5095f985186d8f03147fd22870 15-Jul-2014 Deepanshu Gupta <deepanshu@google.com> Support Locale.toLanguageTag on Java 6

Change-Id: I255e79e2c288cd24b350b7c26128bbbb0b2cb9a3
esources.java
8e5e11b99fac942122ee2d6cdd30af51564861ae 07-Jul-2014 Alan Viverette <alanv@google.com> Handle configuration changes in drawable attributes

Adds themeable attribute support to InsetDrawable, adds support
for attribute configuration changes to all themable drawables.

BUG: 16045735
Change-Id: I3dc62d28801760ac69d303be81b6c78bb9bb5aca
ypedArray.java
9cd14fc710cf81cc6d1c47d599abe349d3aa87dc 20-Jun-2014 Alan Viverette <alanv@google.com> Add support for tint attribute in VectorDrawable

Fixes NPE from previous change. Also fixes docs reference in TypedArray.

BUG: 15375203
Change-Id: Icf3b5759780276b0875a4fb70b29522ab7c8cb90
ypedArray.java
5ff885cd3b8013da4d122127bcf9c30b95e3aeb2 20-Jun-2014 Dianne Hackborn <hackbod@google.com> Revert "Add support for tint attribute in VectorDrawable"

This reverts commit ab41ea17e6b0407fa76bc9f9183190a9bbc7f560.

Was causing system UI to crash.
ypedArray.java
9a77cb92da2b7d3d2c513c9fbc24955fdc0e0693 20-Jun-2014 Alan Viverette <alanv@google.com> Add support for tint attribute in VectorDrawable

Also fixes docs reference in TypedArray.

BUG: 15375203
Change-Id: I8cd2f43bd73f50084e21e5b986af9dc1c1447ad6
ypedArray.java
2c749d242759ea36c0229ea933f22b6363337b19 04-Jun-2014 Adam Lesinski <adamlesinski@google.com> New command to get device config

Change-Id: I7172a3a150fd83e2382ca3e4e4a0188758189f14
onfiguration.java
b6f9152b7027e78c7c0c07b1dc10ca4900b1fca7 03-Jun-2014 Alan Viverette <alanv@google.com> Fix drawable cache, add quantum assets to preload list

BUG: 15409352
Change-Id: Idb18fd99dc4229aace9082d6e26c88faf81d15bf
esources.java
6dbe51b50e82057af4d29882889444d22ac19c9c 03-Jun-2014 Alan Viverette <alanv@google.com> Clean up drawable theming APIs

Removes APIs for themed creation of a drawable from a stream, since
that doesn't involve any inflation. Also cleans up tinting methods
left over from previous clean up.

BUG: 15089957
Change-Id: I2af7aa9a6d351ae61b33ee1216c674fae1bffe11
Signed-off-by: Alan Viverette <alanv@google.com>
esources.java
75257cefcd64cf5cc73083d9546d27825b29a595 23-May-2014 Alan Viverette <alanv@google.com> Handle hybrid themes correctly in Drawable cache

BUG: 15155868
Change-Id: I00326e6000027c2dae5305e816c80883119449c0
esources.java
3b5c4272db3e089c4a06d2db2ddf2aee5ebb6281 20-May-2014 Alan Viverette <alanv@google.com> Various API review fixes to resources and drawables

BUG: 15025565
Change-Id: If00c85816f8288338967f7a85453d21f858f5ca7
olorStateList.java
esources.java
0cfb877f5a0a1bff82d9c3ee969195bf7812c0b5 15-May-2014 Alan Viverette <alanv@google.com> Simplify attribute extraction for themed Drawables

Also fixes a bug in GlowPadView that randomly popped up.

Change-Id: Id20508a44ea02b4a14c8f794de36e13a2c06587c
esources.java
ypedArray.java
5effd7e89f83824ac8982a6cbcebbf5cc331e436 05-May-2014 Alan Viverette <alanv@google.com> Partial revert "Load device default theme mapping from resources"

This reverts commit e4ab72d54cf41d16819b72e94d9b0d0d51289647.

Change-Id: Id17170312c75993fc1f7859d52c7e050b2aeaf80
esources.java
0810b63739c9981f993063749f804b54faed0ba5 01-May-2014 Alan Viverette <alanv@google.com> Load device default theme mapping from resources

Also adds a few missing styles and reorganizes some XML files. Makes
stackViewStyle public since it's defined in DeviceDefault.

Change-Id: I8f6a0f93410948b38619594474d60dc40ece5917
esources.java
e9abc279fd0e1cd3a7c0bfb878c9b5ae22840b9b 08-Apr-2014 Deepanshu Gupta <deepanshu@google.com> Merge "Fix theme/style resolution in Layoutlib"
bfec73c2db5a34ced248213edf5519c80727a65f 12-Mar-2014 Deepanshu Gupta <deepanshu@google.com> Fix theme/style resolution in Layoutlib

Change-Id: Icfb91e566666408802dadc0e2070991151b16b9d
esources.java
0a0454fdcc7aeac6e57f9466da8f39bcf5f3f6ec 04-Apr-2014 John Spurlock <jspurlock@google.com> am 642421aa: am 5c31e487: Merge "Introduce new UI_MODE_TYPE_WATCH and qualifier." into klp-modular-dev

* commit '642421aa7f284817cc1a972a7f9c7a64696a0116':
Introduce new UI_MODE_TYPE_WATCH and qualifier.
642421aa7f284817cc1a972a7f9c7a64696a0116 04-Apr-2014 John Spurlock <jspurlock@google.com> am 5c31e487: Merge "Introduce new UI_MODE_TYPE_WATCH and qualifier." into klp-modular-dev

* commit '5c31e487c4577e1c47ee7c949325d6a13f0d462e':
Introduce new UI_MODE_TYPE_WATCH and qualifier.
6c191299a73388cd593809c0b66bafbd08fd2982 03-Apr-2014 John Spurlock <jspurlock@google.com> Introduce new UI_MODE_TYPE_WATCH and qualifier.

Default ui mode to watch if we have FEATURE_WATCH.

Bug:13395758
Change-Id: Ie5ff95de60e69e91ad3612c7d2f1fca7f49061bd
onfiguration.java
6259933ec99dee566f200c5fdfe1756ee72b1513 01-Apr-2014 Alan Viverette <alanv@google.com> Switch framework Holo references to Quantum.Light

Change-Id: Ib545a143f1959b6104adbc9d594dd626851d90b3
esources.java
351f0c1d26999af7b86f9e0c7eca707121739ee0 28-Mar-2014 Alan Viverette <alanv@google.com> Remove unthemed drawable cache, since canApplyTheme != isThemed

Change-Id: I460673bfa491e67ea239f8ebb03898a0633e7565
esources.java
fd274a0d4ab5a6777213fecb8ddf6e8099675283 27-Mar-2014 Alan Viverette <alanv@google.com> Enforce restrictions on recycled TypedArrays

No calls may be made to recycled TypedArrays, and we'll throw a
detailed exception if developers attempt to do so. Also fixes the
place where we were doin' it wrong.

BUG: 13673783
Change-Id: Ia7a382d90fce8aef7741d926028b2d01b57435ae
ypedArray.java
776abc24cdd18610232a50b997cce3cffa74609b 07-Mar-2014 Adam Lesinski <adamlesinski@google.com> Uses VMRuntime.newUnpaddedArray for ideal array sizes

Bug:13028925

Change-Id: I0a9301248b10a339afbdc5e4ffe3310ac4fa1fb7
olorStateList.java
1cd4612cc04ee715a916de3c437fc52d76d166cb 26-Mar-2014 Alan Viverette <alanv@google.com> Fix attribute extraction, use color attrs in Quantum drawables

Removes some unused entries in the Quantum themes and styles and
collapses identical styles since we don't have separate drawables
anymore. Adds some Quantum text appearances as styles.

BUG: 12368046
Change-Id: I9334feb87391cd54ad3b77b297d135de436e1417
ypedArray.java
de898ff42912bd7ca1bfb099cd439562496765a4 30-Jan-2014 Adam Lesinski <adamlesinski@google.com> Shared library resource support

Shared libraries can now export resources for applications
to use.

Exporting resources works the same way the framework exports
resources, by defining the public symbols in res/values/public.xml.

Building a shared library requires aapt to be invoked with the
--shared-lib option. Shared libraries will be assigned a package
ID of 0x00 at build-time. At runtime, all loaded shared libraries
will be assigned a new package ID.

Currently, shared libraries should not import other shared libraries,
as those dependencies will not be loaded at runtime.

At runtime, reflection is used to update the package ID of resource
symbols in the shared library's R class file. The package name of
the R class file is assumed to be the same as the shared library's
package name declared in its manifest. This will be customizable in
a future commit.

See /tests/SharedLibrary/ for examples of a shared library and its
client.

Bug:12724178
Change-Id: I60c0cb8ab87849f8f8a1a13431562fe8603020a7
ssetManager.java
ypedArray.java
mlBlock.java
52b999f0721b53e9c6e18a4bd664e89aeb65b2d5 25-Mar-2014 Alan Viverette <alanv@google.com> Implement APIs for obtaining, caching themed Drawables

When Drawables are inflated during preload (or otherwise without a theme)
they cache their themeable attributes in their constant state as an array
keyed on attribute index. Drawables inflated with a theme will simply
resolve theme attributes as part of normal inflation, and they will not
cache any themeable attributes.

Drawables obtained from Resources are pulled from theme-specific cache
when possible. If an unthemed Drawable exists in the preload cache, a
new constant state will be obtained for the Drawable and the theme will
be applied by resolving the cached themeable attributes and overwriting
their respective constant state properties. If no cached version exists,
a new Drawable is inflated against the desired theme.

Constant states from themed drawables may be cached if the applied theme
is "pure" and was loaded from a style resource without any subsequent
modifications.

This CL does not handle applying themes to several Drawable types, but it
fully supports BitmapDrawable, GradientDrawable, NinePatchDrawable,
ColorDrawable, and TouchFeedbackDrawable.

BUG: 12611005
Change-Id: I4e794fbb62f7a371715f4ebdf946ee5f9a5ad1c9
ssetManager.java
esources.java
ypedArray.java
39fa59fc4907d3c8faad41bf20e1f855dbcda5e6 25-Feb-2014 Jorim Jaggi <jjaggi@google.com> Change appearance of notifications to light theme.

Change-Id: Ic15e96582d6b46b4dc195b1c7c0cef38f25f0d38
olorStateList.java
21fc8ba39c4799a346caf95218d2bd60ee42ca1a 05-Mar-2014 Narayan Kamath <narayan@google.com> Support deprecated language codes.

Locale.toLanguageTag will transform the obsolete (and
deprecated) language codes "in", "ji" and "iw" to
"id", "yi" and "he" respectively.

All versions of android prior to "L" used the deprecated
language tags, so we will need to support them for backwards
compatibility.

bug: 13230947

Change-Id: Ib63567786bcbe780ceb0487d8f583b75a5452aea
esources.java
a393735a5d637d211713b2b580bdd16f8eba2f7d 27-Feb-2014 Narayan Kamath <narayan@google.com> am 2589067d: am 9fc8e6fe: am f61add84: am 2000fe58: Merge "Make getAssetInt throw unconditionally."

* commit '2589067d10b5f6a67eb1f789b4cf5943914dd9d2':
Make getAssetInt throw unconditionally.
2d19d202bdf6c16b8e01b73f3a742b2670bff907 25-Feb-2014 Narayan Kamath <narayan@google.com> Make getAssetInt throw unconditionally.

All callers have been moved over to getNativeAsset, and
this method has been hidden from the public API internally.

Change-Id: I5f29b5ddb4449adadf426e49a4085c7320289a15
ssetManager.java
cc3f33853b8ea5ce56ebfb14fdc3c000a45e0d78 23-Feb-2014 Alan Viverette <alanv@google.com> Allow alpha modulation in ColorStateList items

This makes it much easier to define a disabled state color as an alpha
modulation of some base color.

Change-Id: Ie2ecf40b1f6560fcd8eda208d780616dddfc0d08
olorStateList.java
857ba4af8519479298a671461cd6f5cace35b99b 15-Feb-2014 Deepanshu Gupta <deepanshu@google.com> Fix layoutlib by avoiding Java7 calls

This change also fixes a NPE in TypedArray caused by changes in the
framework.

Change-Id: Ie64237c567fa16c35c807db22ce9a4b609ee411d
esources.java
788fa41482b9d398591b7db8b0b01839029611ad 21-Jan-2014 Narayan Kamath <narayan@google.com> Extended locales in AAPT / AssetManager.

Support 3 letter language codes, script codes &
variants. The bulk of the changes are related to
the implementation of command line filtering of
locales etc. The previous code assumed that the
value of each "axis" (locale, density, size etc.)
could be represented by a 4 byte type. This is
no longer the case.

This change introduces a new class, AaptLocaleValue
which holds a (normalized) locale parsed from a
directory name or a filter string. This class takes
responsibility for parsing locales as well as
writing them to ResTable_config structures, which is
their representation in the resource table.

This includes minor changes at the java / JNI level
for AssetManager. We now call locale.toLanguageTag()
to give the native layer a well formed BCP-47 tag.
I've removed some duplicated parsing code in
AssetManager.cpp and replaced them with functions on
ResTable_config. The native getLocales function has
been changed to return well formed BCP-47 locales as
well, so that the corresponding java function can use
Locale.forLanguageTag to construct a Locale object
out of it.

Finally, this change introduces default and copy
constructors for ResTable_config to prevent having
to memset() the associated memory to 0 on every
stack allocation.

(cherry-picked from commit 91447d88f2bdf9c2bf8d1a53570efef6172fba74)

Change-Id: I1b43086860661012f949fb8e5deb7df44519b854
esources.java
d5c8044e7e1f1402fdd4a035690329294ab07b33 12-Feb-2014 Nick Kralevich <nnk@google.com> resolved conflicts for merge of 1cbea39f to master

Change-Id: Ib33484546c6a03cbc4cd96e97d9d785d68e10700
91447d88f2bdf9c2bf8d1a53570efef6172fba74 21-Jan-2014 Narayan Kamath <narayan@google.com> Extended locales in AAPT / AssetManager.

Support 3 letter language codes, script codes &
variants. The bulk of the changes are related to
the implementation of command line filtering of
locales etc. The previous code assumed that the
value of each "axis" (locale, density, size etc.)
could be represented by a 4 byte type. This is
no longer the case.

This change introduces a new class, AaptLocaleValue
which holds a (normalized) locale parsed from a
directory name or a filter string. This class takes
responsibility for parsing locales as well as
writing them to ResTable_config structures, which is
their representation in the resource table.

This includes minor changes at the java / JNI level
for AssetManager. We now call locale.toLanguageTag()
to give the native layer a well formed BCP-47 tag.
I've removed some duplicated parsing code in
AssetManager.cpp and replaced them with functions on
ResTable_config. The native getLocales function has
been changed to return well formed BCP-47 locales as
well, so that the corresponding java function can use
Locale.forLanguageTag to construct a Locale object
out of it.

Finally, this change introduces default and copy
constructors for ResTable_config to prevent having
to memset() the associated memory to 0 on every
stack allocation.

Change-Id: I899a56a9a182ee6be52b9389d1ae59266f5482e9
esources.java
8eea3ea5591e59f55cbb4f6b2b7e9363a285ced3 04-Feb-2014 Alan Viverette <alanv@google.com> Add APIs for obtaining themed Drawable from Theme, Context

BUG: 12611005
Change-Id: Ic0057be4e4c2d0c61ce02a019b3f7d0625e3a016
esources.java
ypedArray.java
48d22323ce39f9aab003dce74456889b6414af55 31-Jan-2014 MÃ¥rten Kongstad <marten.kongstad@sonymobile.com> Runtime resource overlay, iteration 2

Support any number of overlay packages. Support any target package.

UPDATED PACKAGE MATCHING
------------------------
In Runtime resource overlay, iteration 1, only a single overlay package
was considered. Package matching was based on file paths:
/vendor/overlay/system/framework-res.apk corresponded to
/system/framework-res.apk. Introduce a more flexible matching scheme
where any package is an overlay package if its manifest includes

<overlay targetPackage="com.target.package"/>

For security reasons, an overlay package must fulfill certain criteria
to take effect: see below.

THE IDMAP TOOL AND IDMAP FILES
------------------------------
Idmap files are created by the 'idmap' binary; idmap files must be
present when loading packages. For the Android system, Zygote calls
'idmap' as part of the resource pre-loading. For application packages,
'idmap' is invoked via 'installd' during package installation (similar
to 'dexopt').

UPDATED FLOW
------------
The following is an outline of the start-up sequences for the Android
system and Android apps. Steps marked with '+' are introduced by this
commit.

Zygote initialization
Initial AssetManager object created
+ idmap --scan creates idmaps for overlays targeting 'android', \
stores list of overlays in /data/resource-cache/overlays.list
AssetManager caches framework-res.apk
+ AssetManager caches overlay packages listed in overlays.list

Android boot
New AssetManager's ResTable acquired
AssetManager re-uses cached framework-res.apk
+ AssetManager re-uses cached 'android' overlays (if any)

App boot
ActivityThread prepares AssetManager to load app.apk
+ ActivityThread prepares AssetManager to load app overlays (if any)
New AssetManager's ResTable acquired as per Android boot

SECURITY
--------
Overlay packages are required to be pre-loaded (in /vendor/overlay).
These packages are trusted by definition. A future iteration of runtime
resource overlay may add support for downloaded overlays, which would
likely require target and overlay signatures match for the overlay to
be trusted.

LOOKUP PRIORITY
---------------
During resource lookup, packages are sequentially queried to provide a
best match, given the constraints of the current configuration. If any
package provide a better match than what has been found so far, it
replaces the previous match. The target package is always queried last.

When loading a package with more than one overlay, the order in which
the overlays are added become significant if several packages overlay
the same resource.

Had downloaded overlays been supported, the install time could have been
used to determine the load order. Regardless, for pre-installed
overlays, the install time is randomly determined by the order in which
the Package Manager locates the packages during initial boot. To support
a well-defined order, pre-installed overlay packages are expected to
define an additional 'priority' attribute in their <overlay> tags:

<overlay targetPackage="com.target.package" priority="1234"/>

Pre-installed overlays are loaded in order of their priority attributes,
sorted in ascending order.

Assigning the same priority to several overlays targeting the same base
package leads to undefined behaviour. It is the responsibility of the
vendor to avoid this.

The following example shows the ResTable and PackageGroups after loading
an application and two overlays. The resource lookup framework will
query the packages in the order C, B, A.

+------+------+- -+------+------+
| 0x01 | | ... | | 0x7f |
+------+------+- -+------+------+
| |
"android" Target package A
|
Pre-installed overlay B (priority 1)
|
Pre-installed overlay C (priority 2)

Change-Id: If49c963149369b1957f7d2303b3dd27f669ed24e
ssetManager.java
edc4664d60af1f124d05f0a2b6ba58b837630f51 01-Feb-2014 Alan Viverette <alanv@google.com> Fix broken build in BridgeResources

Change-Id: Iec58a2acda6b9538bcb5974d3d5c45ea6e53eac5
esources.java
562a6a8d834dbc7490d9580afc591f6cd521f20c 31-Jan-2014 Alan Viverette <alanv@google.com> Improve encapsulation of Resources

Change-Id: Ic408915d2695ac8906231da1d2dc127f94bdd0cc
esources.java
ypedArray.java
90b8eaa68bda6beaf2ff886c3ed642e7050e3ff6 31-Jan-2014 Narayan Kamath <narayan@google.com> am 797b5adc: am 77a1986c: am 49b7ba4d: Merge "AArch64: Make AssetManager and related classes 64-bit compatible"

* commit '797b5adcb4ead3c687db3d9fd831dff93760dd4a':
AArch64: Make AssetManager and related classes 64-bit compatible
896043d67d3ac75760bd99db8a1561e31ebee1e1 17-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make AssetManager and related classes 64-bit compatible

Following changes have been done:

[x] Long is used to store native pointers as pointers can be
64-bit.

[x] AssetManager openAsset native function returned -1 if
file name was empty and java function considered any
non-zero value as success. This has been fixed by native
function throwing Illegal Argument Exception as well.

[x] AssetManager incRefsLocked and decRefsLocked now accept
long as input to support 64-bit native references.

[x] AssetManager incRefsLocked method incorrecly used
'this.hashCode()' instead of the passed parameter id.
This has been fixed.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

Change-Id: I095b9f900d49e51f43ad6afc47cbc23116a6a64a
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
ssetManager.java
esources.java
tringBlock.java
mlBlock.java
01664b3709451d287f30a68fcb8f599e8dc484a5 24-Jan-2014 Narayan Kamath <narayan@google.com> am 5d094b94: am aa43eb51: am 7866f2fc: am 8005b9af: am 3c30eff6: Merge "Remove unused field from AssetManager."

* commit '5d094b947b328d2631a0203c1527b0c7c20ce219':
Remove unused field from AssetManager.
2f756cbb5aeb1f4dcbcb28baa0fbd0a478e7371b 22-Jan-2014 Narayan Kamath <narayan@google.com> Remove unused field from AssetManager.

This field was introduced in commit 4bdd33b81a17 but wasn't
used there (or since).

Change-Id: I0615e98b8990d42da6b85f8094ab19eb0465fd9e
ssetManager.java
2ba4efff8bece69f95401768e48db1b20afd077d 16-Jan-2014 Narayan Kamath <narayan@google.com> Hide AssetInputStream.getAssetInt (Take 2)

This reverts commit b1bd1fe7fd9ed6b6e4518713ef5f5716a84d97e8.
ssetManager.java
6606d16e097480e061546306cc95a729f5dccae8 16-Jan-2014 Narayan Kamath <narayan@google.com> am 6706888e: am 775667c0: am 03e8be75: am 8796ab7f: am bb35356d: Merge changes Id54087dd,I946325e4,I2a2b2e68

* commit '6706888e24aee04c2c914c44e5ef5b1510cf8013':
AArch64: Use long for pointers in BitmapRegionDecoder
AArch64: Use long for pointers in Movie class
AArch64: Add AssetInputStream.getNativeAsset
a0545dd54fdab5b284b509b7121515f15f4d728a 14-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Add AssetInputStream.getNativeAsset

This patch adds AssetInputStream.getNativeAsset. This function
returns asset pointer, which can then be passed to JNI functions.
Note that this function is hidden and not part of Android API.

This function will eventually replace getAssetInt,
once all the classes that use getAssetInt are changed
to use getNativeAsset instead.

Change-Id: I2a2b2e6864f1f57ae2b3a10c45559b3635266ed5
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
ssetManager.java
3a248a14938cc723942e68fc06ed2589efb53a4b 14-Jan-2014 Narayan Kamath <narayan@google.com> am ec70f809: am d34950cf: am 80b0496a: am 2db26788: am e71afc2e: Merge "Revert "Hide AssetInputStream.getAssetInt.""

* commit 'ec70f8091185cd68afd4fcda42b513111eae70e4':
Revert "Hide AssetInputStream.getAssetInt."
b1bd1fe7fd9ed6b6e4518713ef5f5716a84d97e8 14-Jan-2014 Narayan Kamath <narayan@google.com> Revert "Hide AssetInputStream.getAssetInt."

This reverts commit 842d44ec1765e01f4a37af99cc1935b4d0399758.

Change-Id: I188e49d3651fd4941491c239b6a7c9f475995187
ssetManager.java
842d44ec1765e01f4a37af99cc1935b4d0399758 10-Jan-2014 Narayan Kamath <narayan@google.com> Hide AssetInputStream.getAssetInt.

It returns a pointer to a private data structure, so there's
no sensible use for it. Also, the emergence of 64 bit processors
means that the return value isn't wide enough to represent
values in the native heap.

(cherry picked from commit f8f09a15a409f373f22aa475bb0defd264088e4f)

Change-Id: I9c9b5bae6db8638e65dda60f924aa3dddd06813a
ssetManager.java
f8f09a15a409f373f22aa475bb0defd264088e4f 10-Jan-2014 Narayan Kamath <narayan@google.com> Hide AssetInputStream.getAssetInt.

It returns a pointer to a private data structure, so there's
no sensible use for it. Also, the emergence of 64 bit processors
means that the return value isn't wide enough to represent
values in the native heap.

Change-Id: If02d42a528b9d90f11cb25c3342404b7d5f7b625
ssetManager.java
6090995951c6e2e4dcf38102f01793f8a94166e1 19-Nov-2013 John Spurlock <jspurlock@google.com> Remove unused imports from frameworks/base.

Change-Id: Ia1f99bd2c1105b0b0f70aa614f1f4a67b2840906
ssetManager.java
esources.java
ypedArray.java
a211dd28b93473c452d68432c602d5209b01c178 04-Nov-2013 Alan Viverette <alanv@google.com> Add support for using ColorStateList as GradientDrawable's stroke

Refactors isOpaque() so that ColorStateList APIs previously added
on master branch are no longer needed.

Change-Id: I104c9a14ef81db6c4cf141e8fd0ebbd20bd52ee9
olorStateList.java
519494e207322581075c8ea884fde9d33bb9209e 28-Oct-2013 Alan Viverette <alanv@google.com> Add support for using ColorStateList in GradientDrawable

BUG: 11373225
Change-Id: Ie62f1546e8694822aadafe9ef1e57ce458a363d6
olorStateList.java
c1c8f3f97d344a24bfddcb56a8be05e7e2fabe9e 14-Oct-2013 Jeff Sharkey <jsharkey@android.com> Add extras to AFD, send orientation metadata.

AssetFileDescriptor augments a ParcelFileDescriptor with details
about how it should be interpreted, so extend it to support a Bundle
of extras. Then use these extras to share thumbnail orientation
metadata.

The raw image data of EXIF thumbnails matches the orientation of
the enclosing image, but the thumbnail data doesn't repeat the EXIF
flags. This meant that receivers of openDocumentThumbnail() would
get an image that needed to be transformed, but without enough
context to actually transform it.

Instead of transforming and recompressing the image on the fly on
the provider side, send a transformation hint that the receiver
side can interpret.

Bug: 11205688
Change-Id: Ibc5a7ad002377a55e6ffcb5ac5c8829841002e06
ssetFileDescriptor.java
79a8ffe54f9c99ffc34f7b5b73c22eea2673424a 20-Sep-2013 Adam Lesinski <adamlesinski@google.com> Ensures that CompatibilityInfo is always set in Resources

- Adds null checks when setting mCompatibilityInfo and uses default no-op
CompatibilityInfo object instead of null
- Removes null checks when calling methods on mCompatibilityInfo since it is never
null

bug:10204942

Change-Id: I36e88f5cdceb46b8b19fb902270ef74023a81546
esources.java
1d0b177754c81a20e272b91c6f703a634fe5c856 06-Sep-2013 Dianne Hackborn <hackbod@google.com> Fix issue #10560472: ApplicationInfo.manageSpaceActivity not parsed...

...correctly with overloaded resources

Change this attribute and a few other manifest attributes to allow
them to change based on platform SDK version.

Clean up a little more the whole mess with native vs. java config
bit masks.

Change-Id: Ia0baa3f7aed00bcb432701bcf99a9112124d6519
onfiguration.java
ypedArray.java
31678b52e4b65e8e4d22ef5dced713424e5deada 13-Aug-2013 Craig Mautner <cmautner@google.com> Fix Configuration layout direction comparison.

If the Configuration layout direction is not changing don't indicate
that it has changed. When the indication is made incorrectly it
causes the window manager to believe that the configuration has
changed and it will start freezing the screen and setting up
animations. Bad jank is the result.

In Configuration.updateFrom() anytime that the screenLayouts were
different the code was setting ActivityInfo.CONFIG_LAYOUT_DIRECTION
in the return bitmask. Even if the only difference was between
UNDEFINED fields. This fix makes sure that the layout direction
field has actually changed before setting
ActivityInfo.CONFIG_LAYOUT_DIRECTION in the return bitmask.

In Configuration.diff() if the passed Configuration had
SCREENLAYOUT_LAYOUTDIR_UNDEFINED the code was setting
ActivityInfo.CONFIG_LAYOUT_DIRECTION in the return bitmask. This fix
makes sure that if the passed Configuration has fields set to
SCREENLAYOUT_*_UNDEFINED then corresponding bits will no longer be set
in the returned bitmask.

Fixes bug 10291622.
Fixes bug 10247094.

Change-Id: If26de662206fe85dc4671adbae39dfb99dc1038c
onfiguration.java
d8415f4bf061000b049143b4f48b96b2005450bb 08-Aug-2013 Amith Yamasani <yamasani@google.com> Developer option to force RTL layout

Make sure screen layout changes are taken into account in Configuration diffs.
Initialize the SystemProperty from Global settings on startup of
ActivityManagerService.

TextUtils checks the override flag to decide if the default layout direction
should be forced to RTL.

Bug: 10244047
Change-Id: I23a2583d790a355060d0d898ba44e5f7dc896b46
onfiguration.java
7e258b31e70464bb6d80b8b42f0cef8e4417bd6a 01-Aug-2013 Jeff Sharkey <jsharkey@android.com> XML metadata for storage backend; custom icons.

Introduce XML metadata for storage backends, used to indicate if
custom roots should be queried, and provide any custom MIME type
icons inside that backend.

Parse metadata and resolve custom icons in UI.

Change-Id: Iec026c0b10845edff7a345d9389691ddf2c87a0e
mlResourceParser.java
f2c89b9ed65116888f1d4a863b7c10c007a49c5d 30-Jul-2013 Wink Saville <wink@google.com> am 9516ed45: am cfc23ac6: Merge "Add support for MNC=00"

* commit '9516ed4598948eea5623c57e443bce08c1f48ab6':
Add support for MNC=00
1d766b53217f9e45472a01e84d2f1b02af36dec7 07-Oct-2011 Mattias Petersson <mattias.petersson@sonyericsson.com> Add support for MNC=00

This adds support for operators with MNC (Mobile Network Code) zero
to add customized resources. For example, it makes it possible to
add a folder called "/res/values-mnc00/" in an application. This will
cause resources in that folder to be used when MNC is zero.
(There is a total of 14 countries that have an operator with MNC
zero.)

Without this fix, the resource framework gets confused, because MNC 0
is normally used when the MNC is undefined (not set).

Bug: 7170488
Change-Id: Icfd39fd0c739216e89446252ea0e7ceba6f002c6
onfiguration.java
88c0589969b17e66559cd2f132094cdaa0ee351d 28-Jun-2013 Craig Mautner <cmautner@google.com> Refactor ActivityThread cache - Baby step 1.

Introduce ResourcesManager and ResourcesKey as standalone classes.
Move DisplayMetrics and Resources HashMaps from ActivityThread to
ResourcesManager.

Change-Id: I20cc6c0dd1b74667354839e5ac9a660f4ee2d00d
esources.java
esourcesKey.java
48d0d1886731ff19ed3fb47a5997be5df0d1bba8 11-Jun-2013 Craig Mautner <cmautner@google.com> Add activity token to display system.

First step in adding activity specific information to displays.
Replace CompatibilityInfoHolder with DisplayAdjustmentsHolder that
holds an activity token in addition to the CompatibilityInfo.

Change-Id: Ie113cd8dd9c62e0b5311204e039a4829096bea68
ompatibilityInfo.java
esources.java
f8b8521598f8ffb5e899e750b3b137dfc79b8c87 28-May-2013 Dianne Hackborn <hackbod@android.com> am 89eed125: am c7322005: am f9b41efe: Merge "Don\'t include flags in configuration change if their value hasn\'t changed."

* commit '89eed125590c6286fa64e9074e95196c8cc4bd27':
Don't include flags in configuration change if their value hasn't changed.
c73220050efa7420974850ee9a80a965d807c7ce 26-May-2013 Dianne Hackborn <hackbod@android.com> am f9b41efe: Merge "Don\'t include flags in configuration change if their value hasn\'t changed."

* commit 'f9b41efe17718a21df115d95c47a94d97a767076':
Don't include flags in configuration change if their value hasn't changed.
f4bf0ae2a7c2d9d92c5c8abdb82baa53b4c9ccda 21-May-2013 Dianne Hackborn <hackbod@google.com> New ArrayMap class.

This is a new kind of key/value mapping that stores its data
as an array, so it doesn't need to create an extra Entry object
for every mapping placed in to it. It is also optimized to reduce
memory overhead in other ways, by keeping the base object small,
being fairly aggressive about keeping the array data structures
small, etc.

There are some unit and performance tests dropped in to some
random places; they will need to be put somewhere else once I
decided what we are going to do with this for the next release
(for example if we make it public the unit tests should go in
to CTS).

Switch IntentResolver to using ArrayMap instead of HashMap.

Also get rid of a bunch of duplicate implementations of binarySearch,
and add an optimization to the various sparse arrays where you can
supply an explicit 0 capacity to prevent it from doing an initial
array allocation; use this new optimization in a few places where it
makes sense.

Change-Id: I01ef2764680f8ae49938e2a2ed40dc01606a056b
esources.java
e7123a660182c6a5869f46579e596e2b90983a6b 15-May-2013 Danny Baumann <dannybaumann@web.de> Don't include flags in configuration change if their value hasn't changed.

This makes the check in updateFrom() match the logic in diff().

Change-Id: I3ab4e8460f7fbf985ef55b9514a8aa90d401d486
onfiguration.java
3b748a44c6bd2ea05fe16839caf73dbe50bd7ae9 18-Apr-2013 Romain Guy <romainguy@google.com> Pack preloaded framework assets in a texture atlas

When the Android runtime starts, the system preloads a series of assets
in the Zygote process. These assets are shared across all processes.
Unfortunately, each one of these assets is later uploaded in its own
OpenGL texture, once per process. This wastes memory and generates
unnecessary OpenGL state changes.

This CL introduces an asset server that provides an atlas to all processes.

Note: bitmaps used by skia shaders are *not* sampled from the atlas.
It's an uncommon use case and would require extra texture transforms
in the GL shaders.

WHAT IS THE ASSETS ATLAS

The "assets atlas" is a single, shareable graphic buffer that contains
all the system's preloaded bitmap drawables (this includes 9-patches.)
The atlas is made of two distinct objects: the graphic buffer that
contains the actual pixels and the map which indicates where each
preloaded bitmap can be found in the atlas (essentially a pair of
x and y coordinates.)

HOW IS THE ASSETS ATLAS GENERATED

Because we need to support a wide variety of devices and because it
is easy to change the list of preloaded drawables, the atlas is
generated at runtime, during the startup phase of the system process.

There are several steps that lead to the atlas generation:

1. If the device is booting for the first time, or if the device was
updated, we need to find the best atlas configuration. To do so,
the atlas service tries a number of width, height and algorithm
variations that allows us to pack as many assets as possible while
using as little memory as possible. Once a best configuration is found,
it gets written to disk in /data/system/framework_atlas

2. Given a best configuration (algorithm variant, dimensions and
number of bitmaps that can be packed in the atlas), the atlas service
packs all the preloaded bitmaps into a single graphic buffer object.

3. The packing is done using Skia in a temporary native bitmap. The
Skia bitmap is then copied into the graphic buffer using OpenGL ES
to benefit from texture swizzling.

HOW PROCESSES USE THE ATLAS

Whenever a process' hardware renderer initializes its EGL context,
it queries the atlas service for the graphic buffer and the map.

It is important to remember that both the context and the map will
be valid for the lifetime of the hardware renderer (if the system
process goes down, all apps get killed as well.)

Every time the hardware renderer needs to render a bitmap, it first
checks whether the bitmap can be found in the assets atlas. When
the bitmap is part of the atlas, texture coordinates are remapped
appropriately before rendering.

Change-Id: I8eaecf53e7f6a33d90da3d0047c5ceec89ea3af0
esources.java
32559e191fd2580393d77161a32bcaeaa49fbe5d 29-Apr-2013 Jeff Sharkey <jsharkey@android.com> Decorate AssetFileDescriptor with Closeable.

Change-Id: I1f5f462b781a6e8fad77337006febd9c54694c0b
ssetFileDescriptor.java
f1ae269c0665f266b904db7c9ef4511e11459f44 19-Apr-2013 Dianne Hackborn <hackbod@google.com> Follow up on issue #8159072: Spinner widget should be RTL'ized

Only allow through changing direction configs for drawables.

Explicitly map layout direction values to an index in the
preload arrays.

Drawables that don't vary by configuration should go in to both
the rtl and ltr preloads.

Change-Id: Ib92dd11738082a795e02d1d4191adb54702d651c
onfiguration.java
esources.java
b9a13b892ef3da521d428f144e4048aac8a63017 15-Apr-2013 Fabrice Di Meglio <fdimeglio@google.com> Improve fix for bug #8159072 Spinner widget should be RTL'ized

- populate the preloaded drawable cache with only LTR drawables
when the layout direction during preloading is LTR. Populate
the cache with only RTL drawables when the layout direction during
preloading is RTL
- only preload drawables that dont have a dual LTR/RTL version

Change-Id: I7807bdc031b99102609efda75042a9500d96065c
esources.java
0acc1931d364fabb32e2051f58bfbbc5f2505176 13-Apr-2013 Dianne Hackborn <hackbod@google.com> Add a little more resource load tracing.

Change-Id: Id797adb67ab411d5b1a1c223863d3bb4655d10b1
esources.java
f7be4800df28d7cb6a96003046bf90245e7054ab 12-Apr-2013 Dianne Hackborn <hackbod@google.com> Add new resources trace, also trace apk dex loading.

Change-Id: Ia48566efb21ee018659bd976ddb3a0f4997b9a3a
ssetManager.java
dc25d25333d3fac96dccfb9bd31d2474d6bc2d78 10-Apr-2013 Fabrice Di Meglio <fdimeglio@google.com> More fix for bug #8159072 Spinner widget should be RTL'ized

- fix DrawableContainerState.getChangingConfigurations() to take care about its children
- make Resources.verifyPreloadConfig() return false when the changing configuration
contains layout direction bits (this is when a Drawable is having different version
for LTR and RTL layout directions)
- use constant state instead of the resource type value for checking if we can
preload the drawable
- fix typo

Change-Id: Idd64caf0fbe0f5cfd5ffe09343e84bafa9446ea5
esources.java
47b50333c110194565498011379988e5c05f7890 15-Mar-2013 Jeff Sharkey <jsharkey@android.com> Avoid warnings about synthesized IDs.

Bug: 8153518
Change-Id: I5d638e17581f63c6d4a10ff6bc2c1bf9997a78b3
esources.java
5043dc20633a05c429de3ae469dc7d74bfb92451 08-Mar-2013 Elliott Hughes <enh@google.com> am bf8a663c: am 3f7a4990: Merge "Improve the Resource.getQuantityString/getQuantityText documentation."

* commit 'bf8a663c53454f8b8cd7e07344316981022efa10':
Improve the Resource.getQuantityString/getQuantityText documentation.
95d5ab30f2f91b63af2f493548dc67e90c052831 08-Mar-2013 Elliott Hughes <enh@google.com> Improve the Resource.getQuantityString/getQuantityText documentation.

Natural languages differ so much and in such odd ways that you can't
use getQuantityString as an "if" statement. It's really just for grammaticality.
This is explained well in
http://developer.android.com/guide/topics/resources/string-resource.html#Plurals
but we need to make more of an effort to motivate people to read that, and to
at least get the most important point across if they don't read it.

Change-Id: I549b9f3563462c45f2dea34c558185e0714127cd
esources.java
e5b50a65ad26a32f6e58588ffdcbc0389eac9257 12-Feb-2013 Dianne Hackborn <hackbod@google.com> Fix issue #8176917: Stabillity : Native Crash :

/system/lib/libandroidfw.so

Change-Id: I235470fac7ad0f5a5d3432006f4dfa69620e30d8
esources.java
50707cc8206f0d257ba83de2f1f99c3eaa13a4bd 09-Feb-2013 Dianne Hackborn <hackbod@google.com> Fix issue #8133857: Tracking ANR in Gallery

Reworking the locking in resources so that we never hold the
state lock while calling in to potential long running operations.
This means the mTmpValue can no longer be final (since we need
to use it while the lock isn't held), so a new field needs to
be added as the lock and everything that touches mTmpValue must
deal with it being null, restoring the value in there when
possible, etc.

Change-Id: Ie5ffd0f66e5f2d0e869a62d72e7a55b1c74fe872
esources.java
ypedArray.java
330dd534848562515c6c67cb3de13067e86866a1 18-Dec-2012 John Spurlock <jspurlock@google.com> Remove remaining doc references to StyledAttributes.

It appears StyledAttributes was renamed to TypedArray
prior to fw 1.0. Leaving references to the old name
around in the public docs is confusing.

Deliberating leaving...
tests/coretests/src/android/widget/LabelView.java
... as is - it's clearly unused.

Change-Id: I3f66e5f9cbe945d9d86530d37b88369b401f054d
esources.java
a8f6d5f0720f400b6f59b0809aaefea83c5f51d4 27-Nov-2012 Romain Guy <romainguy@google.com> Add support for face attribute to HTML string resources
Bug #7480719

This change also adds the alias "color" for the attribute "fgcolor".
This change also unifies HTML colors parsing between the Html class
and StringBlock for consistency.

Change-Id: I696a6e080387901d88e9baf7cb989b892f14b9db
tringBlock.java
58ed5d748c0b9b64845975ef5844ad313de7c3f6 07-Nov-2012 Kenny Root <kroot@google.com> am 768d9e1a: Merge "Correct executable bit for source files"

* commit '768d9e1a72ceee7d4a5f608776b87b62d6ce4a04':
Correct executable bit for source files
3a084af2e90849aaa8beb3a610189e3399c63ea0 07-Nov-2012 Kenny Root <kroot@google.com> Correct executable bit for source files

Many media files and source code files were marked as executable in Git.
Remove those.

Also a shell script and python script were not marked as executable.

Change-Id: Ieb51bafb46c895a21d2e83696f5a901ba752b2c5
onfiguration.aidl
bbInfo.aidl
esources.java
579e14016c4a972e70cd2bd0c6d89bbd7e9e941c 19-Oct-2012 Dave Burke <daveburke@google.com> Revert "Revert "This restores JB MR0 behavior where the framework throws an exception for improper layouts that are missing layout_width and/or layout_height.""

This reverts commit 57fca90ac65ecfe97acd4c93d442c3db8f815e11

Change-Id: I21b007a7d150a4c23f25a706cdba5cb86198198f
ypedArray.java
57fca90ac65ecfe97acd4c93d442c3db8f815e11 17-Oct-2012 Justin Ho <justinho@google.com> Revert "This restores JB MR0 behavior where the framework throws an exception for improper layouts that are missing layout_width and/or layout_height."

This reverts commit dcf59629beed8182759a1068ab8ee997935bef82

Change-Id: I27426a0ffe993973ffb0b05ce1ed3afe73fcd87d
ypedArray.java
dcf59629beed8182759a1068ab8ee997935bef82 17-Oct-2012 Jim Miller <jaggies@google.com> This restores JB MR0 behavior where the framework throws an exception for improper layouts that are missing layout_width and/or layout_height.

Revert "Revert "Revert "Fix for bug 6050753."""

This reverts commit 6868d6f349610c15256471cc3d5fa708cbfd5f1d

Change-Id: I8843d92dba14c82f06d9ee59517cf11b2abbbf04
ypedArray.java
6868d6f349610c15256471cc3d5fa708cbfd5f1d 16-Oct-2012 Mathias Agopian <mathias@google.com> Revert "Revert "Fix for bug 6050753.""

Emergency revert -- fix reboot loop.

This reverts commit 8e63bcc63fd002231f8391af8982eeb235d096c8.

Change-Id: I4373b867d756de09cdf6aa0aba9e6ff8f47bcdbc
ypedArray.java
8e63bcc63fd002231f8391af8982eeb235d096c8 15-Oct-2012 Romain Guy <romainguy@google.com> Revert "Fix for bug 6050753."

This reverts commit c29f031598811486d83f418fd08fbfe1fc41788a.
ypedArray.java
fe37f8f51d90fc4c6230e54dcd1270df5fcc6be3 30-Sep-2012 Dianne Hackborn <hackbod@google.com> Work on issue #6949468: android.dpi.cts.ConfigurationScreenLayoutTest...

...#testScreenLayout failures on JO

This doesn't actually fix it; I have concluded that the test is broken
(the platform is correctly reporting that this is a NOT LONG device
because in portrait once you account for the status bar and system
bar our size is 880dp high and 600dp wide, which is not enough for us
to be in the LONG config).

However while working on this I noticed that the code for computing
the configuration of the external display was wrong. I have fixed
that by putting this code for computing these parts of the configuration
in a common place that both the window manager and external display
code can use.

Change-Id: Ic6a84b955e9ec345a87f725203a29e4712dac0ad
onfiguration.java
c36c49ee83123d6083c05a3e333ac43a13f664cd 30-Sep-2012 Craig Mautner <cmautner@google.com> Changing debug for b/7094175.

Fixes bug 7094175 (but not really).

Change-Id: Ice2abb93f479ea0bda931e9643710668c25aa285
esources.java
8f301e666873e4a9feaace38a0b184a5f3ce7003 19-Sep-2012 Craig Mautner <cmautner@google.com> Merge "Add debug for b/7094175." into jb-mr1-dev
d3d9f3f1004dfee2649a26cfe8dba948cd364904 18-Sep-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #7173351 API REVIEW: android.util.LocaleUtil

Change-Id: I08fd491eff714059e9ec874fadebe7eb556c34d5
onfiguration.java
0cbfcffe7b99eea85dc17e92ef204035fa6fd4f9 18-Sep-2012 Craig Mautner <cmautner@google.com> Add debug for b/7094175.

Change-Id: Iec83b9350bfeb804dfe3da25986138c2dbaa6d45
esources.java
6543c292b2d1cb3547f4565f89b7cb649ad955d6 07-Sep-2012 Romain Guy <romainguy@google.com> Merge "The drawables cache strikes again Bug #7117785" into jb-mr1-dev
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
esources.java
8a802dbdabdfd27692c2e38b2c3adafe95566106 05-Sep-2012 Fabrice Di Meglio <fdimeglio@google.com> Use "ldrtl" and "ldltr" config qualifiers for RTL / LTR resources

- we cannot use "rtl" / "ltr" qualifiers as they can conflict with ISO-639 Alpha-3
codespace which uses 3 letters for identifying a language code (and could use either
"rtl" or "ltr" strings for defining a language in the future).

- we are using instead "ldrtl" for RTL and "ldltr" for LTR resources. Those qualifiers
are defined by more than 3 chars and outside of what is defined into ISO-639. They
are also more understandable as "ld" prefix is for "layoutdirection"

Change-Id: Id43e948103707e09bef63ebd54ac1779dde58e72
onfiguration.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
onfiguration.java
esources.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
onfiguration.java
esources.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
esources.java
ypedArray.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.
esources.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
ompatibilityInfo.java
onfiguration.java
esources.java
adba6ffbb949e3644f0effdaffee349b0b49688a 22-Jun-2012 Scott Main <smain@google.com> am 101a120c: am 9be0105f: docs: fix several links

* commit '101a120c27f68fb7d44e6221244cb9441dfc4285':
docs: fix several links
9be0105fbc56eb1b1813bb7c5fe258a144867a43 22-Jun-2012 Scott Main <smain@google.com> docs: fix several links

Change-Id: I89d9fd64dc22c90680bb05415cc966c255165af9
ackage.html
0597161ee43cfaa7dbe14691a134fb358a00317a 31-May-2012 Philip Milne <pmilne@google.com> Merge "Fix for bug 6050753."
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
esources.java
0cf2c8a53350a800055e76c1c9bf0a6d44480768 18-May-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6515427: Add android.hardware.television and fix...

...logic for notouch in Configuration

Added new TELEVISION feature.

We now force the configuration to "television" if the TELEVISION
feature is set, and "notouch" if the TOUCHSCREEN feature is not set.

Also cleaned up documentation, deprecated some configurations that
are not used.

Change-Id: If1c7a284b580a8a66bda2a75f0c7fa841b3dc9b7
onfiguration.java
af67fc65bf113b028ff33e71cd6a45810018c273 08-May-2012 Jeff Brown <jeffbrown@google.com> Check for null fd when constructing AssetFileDescriptor.

An AssetFileDescriptor with a null fd is pretty useless and should
never happen during normal operation. It can't even be parcelled
without hitting an NPE. To make it easier to find bugs where a null
fd might have been generated, check at construction time.

Bug: 5655036
Change-Id: I1da6dbee0cab9c11e309f3cebe698bf44dc5e27d
ssetFileDescriptor.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
esources.java
3fb824bae3322252a68c1cf8537280a5d2bd356d 29-Feb-2012 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5217606 LocaleUtils constants TEXT_LAYOUT_DIRECTION_LTR_DO_NOT_USE and TEXT_LAYOUT_DIRECTION_RTL_DO_NOT_USE should be renamed

- replace them by the View constants

Change-Id: I7c2bf0213319247d3db369b6f7c36771fdf3e509
onfiguration.java
c29f031598811486d83f418fd08fbfe1fc41788a 23-Feb-2012 Philip Milne <pmilne@google.com> Fix for bug 6050753.

The method:

TypedArray: getLayoutDimension(int, String)

throws an undocumented exception when either the width and/or height
attributes are undefined.

See the bug report above for reasons why this was deemed unhelpful both
in the tools area and to developers in general.

Fix by:

1. Documenting the conditions under which the method raises an exception.
2. Deprecating the method, advising callers to supply a default instead.

Additionally, redefine the:

ViewGroup: setBaseAttributes(TypedArray, int, int);

methods to provide the appropriate defaults in ViewGroup subclasses as
advised above.

For the platform layouts the default value is WRAP_CONTENT (and is
defined in the ViewGroup.LayoutParams class). The special cases
are accomodated in LayoutParams subclasses in the following cases:

Subclass width height

FrameLayout.LayoutParams: MATCH_PARENT, MATCH_PARENT
TableLayout.LayoutParams: MATCH_PARENT, WRAP_CONTENT
TableRow.LayoutParams: MATCH_PARENT, WRAP_CONTENT

Change-Id: I335a3bd8e2d7f7866692898ed73492635a5b61ea
ypedArray.java
6c997a9e880e08c354ffd809bd62df9e25e9c4d4 31-Jan-2012 Dianne Hackborn <hackbod@google.com> aapt now sorts the strings in the resource string pool.

In our current environment with very many translations, this can
save a lot of RAM -- for example over 200K in Gmail just by sorting
the strings in the Gmail .apk (not the framework).

Also add a new aapt command to print the contents of the resource
table string pool.

Change-Id: I1da037b3e2c377b890833ff57ab158965314ac48
onfiguration.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
esources.java
44fcb83b38b062a650ddf556fe7f5e34905df9ea 15-Dec-2011 Joe Onorato <joeo@google.com> 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
onfiguration.java
8f85e80b64b89fd38cc23b129f61ec36ddde7f15 15-Dec-2011 Romain Guy <romainguy@google.com> Generate even fewer GL commands

Change-Id: I0f4dcacb03ef5ee7f6ebd501df98bfead5f0a7f8
esources.java
60201f2b4ee3fcf222310b5bf91d1d150470cab7 12-Nov-2011 Christopher Tate <ctate@google.com> XML parsing optimizations

Traceview showed approximately 10% of total parse time inside the
synthetic 'trampoline' methods generated to provide inner classes
with access to their outer class's private fields. The bottleneck
in this particular case is in XmlBlock and its inner class Parser.

Making the bottlneck outer-class members and methods package-scope
instead of private removes that 10% overhead being spent within
these access trampolines.

Traceview tends to overemphasize the significance of very small
methods such as these trampolines. That said, the measured speed
gain on the ParseLargeXmlResFg op due to this patch is between
5% and 6%.

Change-Id: Ia0e3ae5408d1f9992b46e6e30dd2407090379b07
mlBlock.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
esources.java
9b44aaefc0c8c4aafd176c2fe5af86e098422b56 03-Sep-2011 Dianne Hackborn <hackbod@google.com> Some more preloaded drawables.

More to come.

Change-Id: I28393c6e52553e960d3a765ba793cfdbf36460ff
esources.java
7810b5f8cffb3c2c98fd0df579f4da5a9ac6cc73 25-Aug-2011 Fabrice Di Meglio <fdimeglio@google.com> Fix bug #5199577 TextView with android:password="true" is showing the "dots" on the left even if the password chars are RTL

- force TextView to LOCALE text heuristic when in "password" mode
- remove TEXT_LAYOUT_DIRECTION_UNKNOWN_DO_NOT_USE
- LocaleUtils.getLayoutDirectionFromLocale() returns "LTR" is locale is NULL or ROOT

Change-Id: I182c46aaf2d73c8b18967fffa230bfabec91ed06
onfiguration.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
esources.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
ssetManager.java
esources.java
ypedArray.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
ompatibilityInfo.java
esources.java
a47f45e4829f812ff47f9e5c9370b02284d92ae8 15-Jun-2011 Fabrice Di Meglio <fdimeglio@google.com> Introduce LocalUtil and getLayoutDirectionFromLocale() now use likelySubtags

- move code from Configuration to LocaleUtil
- move unit tests

Change-Id: Ic14b0131894a0c5618f00d4acb3edb0daadefe01
onfiguration.java
7a736fbf69dd6f03db968d7d8182024eebc0e508 10-Jun-2011 Fabrice Di Meglio <fdimeglio@google.com> Update Configuration for renaming and fixes

- rename layoutDirection to textLayoutDirection
- rename constants for being clear that they cannot be used (work in progress)
- fix a few issues concerning default switch case and relation to Locale

Change-Id: Icfe9a9b5c0d1c0e28e5a893549b437fc4fa5df82
onfiguration.java
f741e679c496f7345304a6543f01d7048e31d1a7 10-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of e2aa0490 to master

Change-Id: Id0448a1598fc93aca0652b29253e02586e35a067
7194efd394ce0b38a74bab87206adfd9ff823742 09-Jun-2011 Fabrice Di Meglio <fdimeglio@google.com> Add Configuration.getLayoutDirectionFromLocale()

- returns LAYOUT_DIRECTION_UNDEFINED / LAYOUT_DIRECTION_LTR / LAYOUT_DIRECTION_RTL depending on the Locale
- add unit tests

Change-Id: I4372734eb011cbf6270f39ba815e696b04f2352f
onfiguration.java
e2aa04908cfdf65ef309f1491f31a0c8846977ff 09-Jun-2011 Dianne Hackborn <hackbod@google.com> am a1396dfe: am 02140891: Merge "Work on issue #4518815: Compatibility mode introduces compatibility regression..." into honeycomb-mr2

* commit 'a1396dfe7ad6ec6953f544be42d69d7804ab0fd4':
Work on issue #4518815: Compatibility mode introduces compatibility regression...
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
ompatibilityInfo.java
onfiguration.java
esources.java
ead40eaedb7993ca8c5153c349dd65f276d6862e 04-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of cc20b4e3 to master

Change-Id: I990368443a16a0577f7a1f5623b348cca3f81ac4
9f2f3752ae26b6812e0ee33a61dd331b0be673c7 03-Jun-2011 Dianne Hackborn <hackbod@google.com> am c11f6c3e: am 7cae137e: am 79841acb: Merge "Compatibility mode never needed for normal size screens." into honeycomb-mr2

* commit 'c11f6c3e33c9f1e3964cb2427f82509fc97e3527':
Compatibility mode never needed for normal size screens.
455591b91311d6959f521fff9acae5a06df442a8 03-Jun-2011 Dianne Hackborn <hackbod@google.com> am c691d7f9: am b8d10931: am fd206560: Merge "Forgot this file." into honeycomb-mr2

* commit 'c691d7f9a3621d5ef9b9d48e95c644a318b36322':
Forgot this file.
50469db07167e3a837e10f215baa4eacb1319604 03-Jun-2011 Dianne Hackborn <hackbod@google.com> am 7322e557: am a4cfcf10: am 75d6b3c2: Merge "Fix issue #4502672: Wrong xml resources used for homescreen widgets." into honeycomb-mr2

* commit '7322e557cfe42da42779625d69ced2db74a9df90':
Fix issue #4502672: Wrong xml resources used for homescreen widgets.
7dad2c24fa7811c115f850fd2a8f2ecc8874061e 03-Jun-2011 Dianne Hackborn <hackbod@google.com> am 9b94aa18: am e5d37701: am 8ea5e1d7: Fix compat mode bugs when updating apps.

* commit '9b94aa18f78e6c6281202e72b5a7451bc479fe82':
Fix compat mode bugs when updating apps.
0e5e16a656b0002f377f1bcda2e43a97206e4046 03-Jun-2011 Dianne Hackborn <hackbod@google.com> am da9837fb: am c058d386: am ff762299: Merge "Small fixes and cleanup of resource config handling." into honeycomb-mr2

* commit 'da9837fb61c8aa53c67921682016d97655332089':
Small fixes and cleanup of resource config handling.
546d64f56d0f930070289e26021f97638601e388 02-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 5c2e4d20 to master

Change-Id: Iadbee872468ceafb54c5877046c91f6052f3c953
ed60f81940c5f2125518c7c31ad4f61b8a9baf3e 02-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 76450622 to master

Change-Id: I26ccd8f264e65f100d894f43cf597a781552db83
cc20b4e31ece564800aa2322efe3ae9da163b570 02-Jun-2011 Dianne Hackborn <hackbod@google.com> am a5f88510: am 2969b511: Merge "Add new supports-screen API to set maximum allowed size." into honeycomb-mr2

* commit 'a5f8851019605be26dd9a628280092e27f8a5f31':
Add new supports-screen API to set maximum allowed size.
2762ff3dc864018352362f6d103de471f9529ba6 02-Jun-2011 Dianne Hackborn <hackbod@google.com> Add new supports-screen API to set maximum allowed size.

Change-Id: I0a7cd4ba73a4c18558e6daee28963d5fd12c7978
ompatibilityInfo.java
c11f6c3e33c9f1e3964cb2427f82509fc97e3527 01-Jun-2011 Dianne Hackborn <hackbod@google.com> am 7cae137e: am 79841acb: Merge "Compatibility mode never needed for normal size screens." into honeycomb-mr2

* commit '7cae137ed155f2d311f020bbb3e75730344fd5fc':
Compatibility mode never needed for normal size screens.
39ec8fb9572b6f7a6c3dbc135f32f2a8cbcd640f 01-Jun-2011 Dianne Hackborn <hackbod@google.com> Compatibility mode never needed for normal size screens.

Change-Id: I3482fa692618b9272e1e19384e766a77f2a53c5d
ompatibilityInfo.java
36f80f3a5a3de42d4e7ca4b53d4aa3e567f4df6f 01-Jun-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 590ec479 to master

Change-Id: I30503da6a73b9cb15eee66a67c75d50ccdc4b9f0
c691d7f9a3621d5ef9b9d48e95c644a318b36322 01-Jun-2011 Dianne Hackborn <hackbod@google.com> am b8d10931: am fd206560: Merge "Forgot this file." into honeycomb-mr2

* commit 'b8d109318f6fc88d1a59ca0e6e362963cd06960c':
Forgot this file.
363456c7249f6545e7bde8134ff2e796c6f4c55f 01-Jun-2011 Dianne Hackborn <hackbod@google.com> Forgot this file.

Change-Id: I8aa457d8d81d283f8cc36f68eca33fcb3a86ccad
ompatibilityInfo.aidl
7322e557cfe42da42779625d69ced2db74a9df90 01-Jun-2011 Dianne Hackborn <hackbod@google.com> am a4cfcf10: am 75d6b3c2: Merge "Fix issue #4502672: Wrong xml resources used for homescreen widgets." into honeycomb-mr2

* commit 'a4cfcf10cc300a1eb5b2a4254fb7d3190c56c4f1':
Fix issue #4502672: Wrong xml resources used for homescreen widgets.
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
ompatibilityInfo.java
onfiguration.java
esources.java
9b94aa18f78e6c6281202e72b5a7451bc479fe82 28-May-2011 Dianne Hackborn <hackbod@google.com> am e5d37701: am 8ea5e1d7: Fix compat mode bugs when updating apps.

* commit 'e5d377014b04022a04fd0b2b24b343d1e0ec8d2a':
Fix compat mode bugs when updating apps.
8ea5e1d79eb1f05ee7628b0d45ea8fc8eea5330d 28-May-2011 Dianne Hackborn <hackbod@google.com> Fix compat mode bugs when updating apps.

No longer accidentally puts an app into compatibility mode.

Also various cleanup, freezing screen while switching between modes.

Change-Id: Ic1b3958be7800189a93f68e9dee3c5adfc45fe57
ompatibilityInfo.java
da9837fb61c8aa53c67921682016d97655332089 27-May-2011 Dianne Hackborn <hackbod@google.com> 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.
3904d03dd01dcd43c446744e44b34615825d9679 27-May-2011 Dianne Hackborn <hackbod@google.com> Small fixes and cleanup of resource config handling.

Change-Id: I402c31b68f2b4825cb4c610a65ee8e1da471c7bb
esources.java
5c2e4d20df934728f39312741ef3390fd87795ce 27-May-2011 Dianne Hackborn <hackbod@google.com> am 8fcbfb52: am 94250ac6: Merge "Add new supports-screens attributes for declaring the compatible screens." into honeycomb-mr2

* commit '8fcbfb52607263754b6d3895a112f792c5c3a12e':
Add new supports-screens attributes for declaring the compatible screens.
df6e980e3f63eb0f6f9eb437fa925d5009cd9c44 26-May-2011 Dianne Hackborn <hackbod@google.com> Add new supports-screens attributes for declaring the compatible screens.

Change-Id: I40d57e4354e48accc1027c9f90916ea73eb5190d
android:requiresSmallestWidthDp provides the smallest supported width.
android:compatibleWidthLimitDp provides the largest compatible width.
ompatibilityInfo.java
76450622f08b1d0d09df7f1ad8e52afe01090770 26-May-2011 Dianne Hackborn <hackbod@google.com> am d5238cc1: am 7a09f72b: Merge "Rework how we decide whether to use system or status bar." into honeycomb-mr2

* commit 'd5238cc1ab8366389b2aada228f2f2e5cbb3244e':
Rework how we decide whether to use system or status bar.
590ec479fd51e13d077212833e2ac4f848a49cc3 26-May-2011 Dianne Hackborn <hackbod@google.com> am 80ef2a97: am 42f8094c: Merge "Spiffy new compatibility mode UI." into honeycomb-mr2

* commit '80ef2a9745e6103efd9698577536bbfed1fd74f6':
Spiffy new compatibility mode UI.
81e56d535c853d73ff537357da5b935f51cb779d 26-May-2011 Dianne Hackborn <hackbod@google.com> Rework how we decide whether to use system or status bar.

The PhoneWindowManager is now responsible for determing this,
since it needs to do this before we can generate the configuration
since we need to take into account the system bar size we will use.

Also the Display should now report the screen height without
including the system bar.

Change-Id: I82dfcc5e327e4d13d82c373c6c870f557a99b757
ompatibilityInfo.java
36cd41f8efa6f6a683d3353d309ff548295af9e9 26-May-2011 Dianne Hackborn <hackbod@google.com> Spiffy new compatibility mode UI.

Change-Id: I1207eaafae59a434fcc979ad60a83e2d685288af
ompatibilityInfo.java
fee1c69a49d03b651e481983432ade94fc07650a 26-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 77dd616e to master

Change-Id: Idb7180177b01e7d822327ccc7c76617220860da2
77dd616e685e2671491d911d0847efa4f832717e 25-May-2011 Dianne Hackborn <hackbod@google.com> am 00b3a5c6: am c404e9b2: Merge "More compatibility mode improvements." into honeycomb-mr2

* commit '00b3a5c65e6ef26056178d1d7473b921671752e9':
More compatibility mode improvements.
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
ompatibilityInfo.java
onfiguration.java
esources.java
e2c7715c772d5121397591b532d04a31b3ffcc99 24-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of bbca8133 to master

Change-Id: I81493674dceab848e41d380a77a37e5a9be06db6
bbca81334e3603c7328dc526bd63032b23d5261d 24-May-2011 Dianne Hackborn <hackbod@google.com> am 4bb78889: am 40277df7: Merge "Add "television" mode." into honeycomb-mr2

* commit '4bb78889d04594c01a6af7f6d38c1764e9f575f9':
Add "television" mode.
e360bb6bd8ea84b8d37604fc11dfc744b18fb0de 21-May-2011 Dianne Hackborn <hackbod@google.com> Add "television" mode.

Change-Id: Ida1fdb61b036a8b489dbeda196fb4bc82e651b2b
onfiguration.java
161e67ff3ba26408eea09221734ad2e29a1eed11 20-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 06a8ceac to master

Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
06a8ceacb0dc2713cb0bb2c93d2a750f2a58db68 20-May-2011 Dianne Hackborn <hackbod@google.com> am c851ea56: am 69cb8757: Add new "-swNNNdp" resource qualifier.

* commit 'c851ea5672f6e042c2e89b2a2ce4a2467e1fcd2a':
Add new "-swNNNdp" resource qualifier.
69cb87576ba163b61bb0e6477a3b7c57a9b11d40 20-May-2011 Dianne Hackborn <hackbod@google.com> Add new "-swNNNdp" resource qualifier.

Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
ssetManager.java
onfiguration.java
esources.java
63446167b9d6d9ed3410320d17e8fe816caf6c42 16-May-2011 Dianne Hackborn <hackbod@google.com> am fddd927f: am 9d0f2c6d: Merge "DO NOT MERGE: From master -- Fix bug in deciding which rotation to use for an orientation." into honeycomb-mr2

* commit 'fddd927fb78bb206287203f4f447a416b525115a':
DO NOT MERGE: From master -- Fix bug in deciding which rotation to use for an orientation.
29735689cea7bf52998c1911542dcfdd1c1d9628 22-Apr-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE: From master -- Fix bug in deciding which rotation to use for an orientation.

Change-Id: Ie271123271a662f3f753f381ce4c43ad7904dc4a
onfiguration.java
fbdf9df053800afb25453630d11bd48cbc068271 16-May-2011 Dianne Hackborn <hackbod@google.com> am 2a20583a: am 700ab1c7: Merge "DO NOT MERGE. Integrate from master: Improve activity manager debug dumps." into honeycomb-mr2

* commit '2a20583a5f436d66ab73cd6c0fdc73e59a3cecad':
DO NOT MERGE. Integrate from master: Improve activity manager debug dumps.
9a84983a9fd9959671e102045eaf185b83291269 08-Apr-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE. Integrate from master: Improve activity manager debug dumps.

Activity manager now does all dump requests into apps
asynchronously, so it can nicely timeout if there is an
app problem. Also lots of general cleanup of the am
dump output.

Change-Id: I99447b87f77a701af52aeca984d93dfe931f065d
onfiguration.java
2e4a3236a7634d17f89288e9739a438ecbea0471 13-May-2011 Dianne Hackborn <hackbod@google.com> 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.
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
ssetManager.java
onfiguration.java
esources.java
3d0724dc220a2e027b9e38f61c39c84c28a505d5 13-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 0e59729b to master

Change-Id: I2d3a6bddf66b1df0c101c45ea2fec1cf65caf01b
0e59729b104e48c7d935026f565c4b45f1f37d12 13-May-2011 Dianne Hackborn <hackbod@google.com> am 97280816: am 0f1de9ad: New compat mode front end: UI and persistence.

* commit '972808164adde6c0784e9c836d06219a9cf7eb7f':
New compat mode front end: UI and persistence.
0f1de9adde0b52d2a385a76232bd7ac30c3eeea2 12-May-2011 Dianne Hackborn <hackbod@google.com> New compat mode front end: UI and persistence.

Adds a really crappy UI for toggling compat mode.

Persists compat mode selection across boots.

Turns on compat mode by default for newly installed apps.

Change-Id: Idc83494397bd17c41450bc9e9a05e4386c509399
ompatibilityInfo.java
aa9d84c37e05f696ec158dac98ce38cf41e18314 10-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 05be6d6f to master

Change-Id: Ic6a6c5bb300f6f1d43f9ed550b284282b4f16212
05be6d6fe09ddfb706d1bef3b20c3d37f45e3c8a 10-May-2011 Dianne Hackborn <hackbod@google.com> am 4907d1d5: am 0c6cbf41: Merge "Better compat mode part one: start scaling windows." into honeycomb-mr2

* commit '4907d1d5e2c7d244b07579b8c52153df69754e85':
Better compat mode part one: start scaling windows.
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
ompatibilityInfo.java
onfiguration.java
esources.java
b7642cbae40aa6b1c54e5b39ed046f7f52e327d9 26-Apr-2011 Jean-Baptiste Queru <jbq@google.com> am 31418a1e: am 45e13ec1: am 5fcfce96: am 4b72eec3: Merge "Re-assingning local variable if mStringBlocks was initialized here. NPE is thrown otherwise."

* commit '31418a1e9b905593587d8bf7a4705429db549d97':
Re-assingning local variable if mStringBlocks was initialized here. NPE is thrown otherwise.
31418a1e9b905593587d8bf7a4705429db549d97 26-Apr-2011 Jean-Baptiste Queru <jbq@google.com> am 45e13ec1: am 5fcfce96: am 4b72eec3: Merge "Re-assingning local variable if mStringBlocks was initialized here. NPE is thrown otherwise."

* commit '45e13ec1c5cd765162b7450b1c3a4632e8979894':
Re-assingning local variable if mStringBlocks was initialized here. NPE is thrown otherwise.
9d13264f6b5818812e61d66baaada599b8ad1faf 22-Apr-2011 Dianne Hackborn <hackbod@google.com> Fix bug in deciding which rotation to use for an orientation.

Change-Id: Icc928c2188a5865035cafcdab2efd5bae3132b1f
onfiguration.java
52c03d2cb9a782366e804d1910a7c8f072b05353 21-Apr-2011 Scott Main <smain@google.com> am a23ae0d7: am 69ccfd7a: am ca7f30eb: am b8a57841: Merge "docs: add a little info to Configuration class description" into honeycomb

* commit 'a23ae0d7be890b7590a87891b894a30f25bbd3ef':
docs: add a little info to Configuration class description
ca7f30ebb20dcf4c056f57a8c4ab3342cafaed83 21-Apr-2011 Scott Main <smain@google.com> am b8a57841: Merge "docs: add a little info to Configuration class description" into honeycomb

* commit 'b8a57841316171d6db4311a65914720213516153':
docs: add a little info to Configuration class description
63848e3df3a87c111617a81ff3e1f2685de7b031 21-Apr-2011 Scott Main <smain@google.com> docs: add a little info to Configuration class description

Change-Id: I3278759bd1c323330c1143ef71d0644872caa085
onfiguration.java
41a5ed7cd9f56d955a797a485c11ae5e7ccfb094 19-Apr-2011 Jozef BABJAK <jozef.babjak@gmail.com> Re-assingning local variable if mStringBlocks was initialized here. NPE is thrown otherwise.

Change-Id: Ic8648aa5ae6a61348803171243c1c217feb058ec
ssetManager.java
43a17654cf4bfe7f1ec22bd8b7b32daccdf27c09 07-Apr-2011 Joe Onorato <joeo@google.com> Remove the deprecated things from Config.java. These haven't been working since before 1.0.

Change-Id: Ic2e8fa68797ea9d486f4117f3d82c98233cdab1e
ssetManager.java
tringBlock.java
e17aeb31030cfeed339a39a107912ad5e9178390 08-Apr-2011 Dianne Hackborn <hackbod@google.com> Improve activity manager debug dumps.

Activity manager now does all dump requests into apps
asynchronously, so it can nicely timeout if there is an
app problem. Also lots of general cleanup of the am
dump output.

Change-Id: Id0dbccffb217315aeb85c964e379833e6aa3f5af
onfiguration.java
3fc982f41fda1f254bfbc35490d81cd82a0ed90a 31-Mar-2011 Dianne Hackborn <hackbod@google.com> Add new resource configurations for screen width/height in "dp".

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: I22f8afa136b4f274423978c570fa7c9855040496
ssetManager.java
onfiguration.java
esources.java
2f98f2670828a42ef93fe782b5be82b1dfeba6ce 29-Mar-2011 Dianne Hackborn <hackbod@google.com> Expand screen documentation with explicit screen size dimensions.

This updates the various documentation on screen sizes to discuss
the exact screen dimensions that are now associated with each size.
In addition, the screen sizes vs. densities table is updated to
include a number of additional representative screens.

Change-Id: Id07491148b1857e0265cef7139e564e190f38e03
onfiguration.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
esources.java
1368454815aaf793fe32ba32473fd11cf7b02e0d 31-Jan-2011 Dianne Hackborn <hackbod@google.com> am e6c6b760: DO NOT MERGE Fix issue #3408542: "resizeable" attribute required to get out of compat mode

* commit 'e6c6b760eb0c1068fdfa656007ec27e482313b58':
DO NOT MERGE Fix issue #3408542: "resizeable" attribute required to get out of compat mode
e6c6b760eb0c1068fdfa656007ec27e482313b58 31-Jan-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE Fix issue #3408542: "resizeable" attribute required to get out of compat mode

The "resizeable" attribute of supports-screens was never well documented,
so many apps don't set it. Assuming that if they are explicitly saying
they support large or xlarge screens then they are also implying that they
are resizeable.

Change-Id: Ibce45539d8910dfddb4f548da5464b31ac4a3a89
ompatibilityInfo.java
2bfa2ea1ecc538bef44ff2a7da1e2db149fd9970 31-Jan-2011 Dianne Hackborn <hackbod@google.com> Fix issue #3408542: "resizeable" attribute required to get out of compat mode

The "resizeable" attribute of supports-screens was never well documented,
so many apps don't set it. Assuming that if they are explicitly saying
they support large or xlarge screens then they are also implying that they
are resizeable.

Change-Id: Iaa1ad431c9868254af7581499477bff98ed109e5
ompatibilityInfo.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
esources.java
ackage.html
5cdf07524132722e0db69db1ca8dcaf3f0073265 17-Jan-2011 Jeff Brown <jeffbrown@google.com> Merge "Support non-rectangular input regions." into honeycomb
fbf097732137a32930d151f7ba6816a5b870c32a 16-Jan-2011 Jeff Brown <jeffbrown@google.com> Support non-rectangular input regions.

This enables the system bar to carve out a region through which
events will be sent to the IME behind it.

Bug: 3238092
Change-Id: I69b855a8d9b5b3ee525266c0861826e53e5b5028
ompatibilityInfo.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
esources.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
esources.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
esources.java
8d71769b9bc3d0e72b26217d9059ce4473a91fe5 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
esources.java
212799338d7be336e73eb65de3dcd0338a705a11 02-Dec-2010 Bjorn Bringert <bringert@android.com> Only decrement mRemaining once in read().

In the old code AssetFileDescriptor.AutoCloseInputStream.read()
called super.read(), which calls read(byte[] buffer, int offset, int count),
which decrements mRemaining. Then read() decremented mRemaining again
after super.read() returned.

I'm extending the CTS tests for AssetFileDescriptor.AutoCloseInputStream
to cover this.

Bug: 3240844
Change-Id: I70b945abc773d3ce5c1317dad23a0d797b31f111
ssetFileDescriptor.java
7d3a5bcf300aea7bffb1d46f28e244ca807f5e82 30-Nov-2010 Dianne Hackborn <hackbod@google.com> Auto-show IME for dialogs on large screens.

On a large screen the IME is not going to as significantly
cover a pan & scan window, so allow it to auto-show if the
app hasn't otherwise specified its visibility.

Also some fixes here and there.

Change-Id: I10227ec59c43454e06e6870633f53426f4d78b83
onfiguration.java
711e62a84fe6e127592fb14642e9d08cf25a5b75 30-Nov-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3225529: AlertDialogs are squishing their content views

ViewRoot is now smarter about measuring WRAP/WRAP windows.

Change-Id: I690fc78ddbe252d7c8070edb8e7352aec6c67ce9
onfiguration.java
33710fc4a95df602cffc338fdfe79e27eaea4f06 19-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> am 096c4c44: am 251384a7: Merge "Improve performance when getting styled string."

* commit '096c4c448d8110c21108f2db4a19a85099e78557':
Improve performance when getting styled string.
096c4c448d8110c21108f2db4a19a85099e78557 19-Nov-2010 Brad Fitzpatrick <bradfitz@android.com> am 251384a7: Merge "Improve performance when getting styled string."

* commit '251384a7595022ddbc53f4ab0fa386f9c040f1f5':
Improve performance when getting styled string.
ac4a181d2e02f2dd375c61ce231d35e50d0d1836 18-Nov-2010 Peter Eliasson <peter.eliasson.x@sonyericsson.com> Improve performance when getting styled string.

The style used in the composing text for input methods
takes a long time to create. This is experienced as a
lag when composing the first word.

The bottleneck lies in the 10 calls to
nativeIndexOfString which does a linear search through
thousands of strings.

Change-Id: I3184b2be3673d384cca19e9a70ad94b4d3085576
tringBlock.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
ssetManager.java
esources.java
ae5ace55d9fc45bc11608c9fb59c9ee884fd9ea6 28-Oct-2010 Jeff Hamilton <jham@android.com> am bd8ff5b5: Merge "DO NOT MERGE. Fix asset file descriptor for pipe based fds." into gingerbread

* commit 'bd8ff5b5d4f4c74889ce20a0c7a2f8e0ab7b6ea9':
DO NOT MERGE. Fix asset file descriptor for pipe based fds.
145fe77dbf930761ccc8617f93014bf88afc7140 28-Oct-2010 Jeff Hamilton <jham@android.com> DO NOT MERGE. Fix asset file descriptor for pipe based fds.

Change-Id: Ic366d01f91017109abfcfa65bd2231dd7416ce71
ssetFileDescriptor.java
9c7489f8bdcd08990c44250cbad64399badc72be 22-Oct-2010 Dianne Hackborn <hackbod@google.com> am 38993d8d: Merge "Fix issue #3122240: Expose xlarge in GB." into gingerbread
5383f502e4479d117c89666fb2ee1ca53f3d27cf 22-Oct-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3122240: Expose xlarge in GB.

Plus some other small API cleanup.

Change-Id: I1a3c60f510f99224cccac9cc3f838f04141064f8
onfiguration.java
fcab0f5502410b975afe045354bbae31ccba68a5 15-Oct-2010 Kenny Root <kroot@google.com> am 8fda1636: am bdf8034c: Merge "OBB: use PBKDF2 for key generation." into gingerbread

Merge commit '8fda1636e3e35f060b9046294efd3c062a1fdb84'

* commit '8fda1636e3e35f060b9046294efd3c062a1fdb84':
OBB: use PBKDF2 for key generation.
8fda1636e3e35f060b9046294efd3c062a1fdb84 14-Oct-2010 Kenny Root <kroot@google.com> am bdf8034c: Merge "OBB: use PBKDF2 for key generation." into gingerbread

Merge commit 'bdf8034c657147226b2390eef113ff841e0d6065' into gingerbread-plus-aosp

* commit 'bdf8034c657147226b2390eef113ff841e0d6065':
OBB: use PBKDF2 for key generation.
3b1abba6bbc895d63da3e82e9b158c01bd12eddd 14-Oct-2010 Kenny Root <kroot@google.com> OBB: use PBKDF2 for key generation.

Switch to using PBKDF2 for the key generation for OBBs. Any previously
generated OBBs will stop being read correctly. A small pbkdf2gen program
is available to allow generation of appropriate keys with the salts.

Bug: 3059950
Change-Id: If4305c989fd692fd1150eb270dbf751e09c37295
bbInfo.java
9e95468bbb4b4cb48d817cee2960681aa876b12a 01-Oct-2010 Kenny Root <kroot@google.com> am 6ce5f60c: am 38cf8867: Remove OBBs from state list when volume unmounted

Merge commit '6ce5f60c791401ed0faf5d36baf4fc6612358676'

* commit '6ce5f60c791401ed0faf5d36baf4fc6612358676':
Remove OBBs from state list when volume unmounted
6ce5f60c791401ed0faf5d36baf4fc6612358676 01-Oct-2010 Kenny Root <kroot@google.com> am 38cf8867: Remove OBBs from state list when volume unmounted

Merge commit '38cf8867a8d3e8d5159abd0bd0e6a3b0b8348b94' into gingerbread-plus-aosp

* commit '38cf8867a8d3e8d5159abd0bd0e6a3b0b8348b94':
Remove OBBs from state list when volume unmounted
38cf8867a8d3e8d5159abd0bd0e6a3b0b8348b94 26-Sep-2010 Kenny Root <kroot@google.com> Remove OBBs from state list when volume unmounted

Don't keep tracking OBBs when the volume they're located on goes away.
Remove them from our state tracking maps and then send a notification to
any listener that is still around.

Add a dump handler to MountService so the state of the mount lists
can be inspected.

Change the API to just make a callback directly to the change listener
when mount is called when it's already mounted or unmount called when
it's already unmounted.

Change-Id: Idb4afbb943ca5ca775825f908bff334e3ce1cfcc
bbInfo.java
bbScanner.java
a53146c5569f8ff5f7eb55e9ad35d23ddacf2add 07-Sep-2010 Christopher Tate <ctate@google.com> Drag/drop APIs and infrastructure

A View initiates a drag-and-drop operation (hereafter just called a "drag")
by calling its startDrag(ClipData) method. Within the processing of that
call, two callbacks are made into the originating View. The first is to
onMeasureDragThumbnail(). Similarly to the core onMeasure() method, this
callback must respond by calling setDragThumbnailDimension(width, height) to
declare the size of the drag thumbnail image that should be used. Following
this, the View's onDrawDragThumbnail(canvas) method will be invoked to
actually produce the bits of the thumbnail image.

If all goes well, startDrag() will return 'true', and the drag is off and
running. (The other arguments to startDrag() provide reconciliation between
the current finger position and where the thumbnail should be placed on
the screen relative to it.)

Potential receipients of the ClipData behind the drag are notified by a
new dispatch mechanism, roughly parallel to motion event dispatch. The core
routine is the View's onDragEvent(event) callback, with the mechanics of
dispatch itself being routed through dispatchDragEvent(event) -- as in
the case of motion events, the dispatch logic is in ViewGroup, with leaf
View objects not needing to consider the dispatch flow.

Several different event 'actions' are delivered through this dispatch
mechanism:

ACTION_DRAG_STARTED: this event is propagated to every View in every window
(including windows created during the course of a drag). It serves as a
global notification that a drag has started with a payload whose matching
ClipDescription is supplied with the event. A View that is prepared to
consume the data described in this event should return 'true' from their
onDragEvent() method, and ideally will also make some visible on-screen
indication that they are a potential target of the drop.

ACTION_DRAG_ENTERED: this event is sent once when the drag point
enters the View's bounds. It is an opportunity for the View to set up
feedback that they are the one who will see the drop if the finger goes
up now.

ACTION_DRAG_LOCATION: when the drag point is over a given View, that
View will receive a stream of DRAG_LOCATION events, providing an
opportunity for the View to show visual feedback tied to the drag point.

ACTION_DRAG_EXITED: like DRAG_ENTERED, but called when the drag point
leaves the View's bounds. The View should undo any visuals meant to
emphasize their being the hovered-over target.

ACTION_DROP: when the drag ends at a given point, the View under that
point is sent this event, with the full ClipData of the payload.

ACTION_DRAG_ENDED: paralleling the DRAG_STARTED action, this is the global
broadcast that the drag has ended and all Views should return to their
normal visual state. This happens after the DROP event.

Change-Id: Ia8d0fb1516bce8c735d87ffd101af0976d7e84b6
ompatibilityInfo.java
ea7ee3f4d31b92828df005d021cf482f6332514a 30-Sep-2010 Kenny Root <kroot@google.com> am 8bd545ab: am 212d81a0: Merge "Move all the permissions check up for unmount" into gingerbread

Merge commit '8bd545ab4f7e75634c970b50ed15c20858d6ac0c'

* commit '8bd545ab4f7e75634c970b50ed15c20858d6ac0c':
Move all the permissions check up for unmount
8bd545ab4f7e75634c970b50ed15c20858d6ac0c 29-Sep-2010 Kenny Root <kroot@google.com> am 212d81a0: Merge "Move all the permissions check up for unmount" into gingerbread

Merge commit '212d81a004f50e51ed8f6d803b79f4b71546b351' into gingerbread-plus-aosp

* commit '212d81a004f50e51ed8f6d803b79f4b71546b351':
Move all the permissions check up for unmount
f1121dc1d35c7e8c317c278aad0dd4ad1358d870 29-Sep-2010 Kenny Root <kroot@google.com> Move all the permissions check up for unmount

We have already scanned the state of the OBB in mountObb, so check the
caller against the stored state in the unmountObb call. This allows us
to ensure the calling binder is the same one that mounted it since we
tie the lifecycle of the OBB to the lifecycle of the binder.

Change-Id: I45d9cfbab5d3f5b37a6a9b594b10bd8b91cccc45
bbScanner.java
bff405f91001237ec94ec64f86fa2370c4509559 29-Sep-2010 Kenny Root <kroot@google.com> resolved conflicts for merge of d8e8186c to master

Change-Id: Ica3f6cd958717ea7033cab8b4bf9cd3425c1e1c5
d8e8186c887fe47977721315f439465771a96374 29-Sep-2010 Kenny Root <kroot@google.com> am 05105f7a: Update OBB API to include callbacks

Merge commit '05105f7abe02b2dff91d6260b3628c8b97816bab' into gingerbread-plus-aosp

* commit '05105f7abe02b2dff91d6260b3628c8b97816bab':
Update OBB API to include callbacks
05105f7abe02b2dff91d6260b3628c8b97816bab 23-Sep-2010 Kenny Root <kroot@google.com> Update OBB API to include callbacks

Add a callback for users of the StorageManager API to be able to receive
notifications when the requested operation completes for mountObb and
unmountObb.

Add NDK API to get to ObbInfo like the Java API has.

Also update the docs for the API and remove the "STOPSHIP" comments.

Change-Id: I23a4409c7f8b74d3169614beba920b4d667990a4
bbInfo.java
bbScanner.java
acc4e041d27c24b45fb190c493717fda987b52c2 04-Sep-2010 Dianne Hackborn <hackbod@google.com> am 69717ccd: DO NOT MERGE. Some stuff that is Not Ready.

Merge commit '69717ccd13bb5568b912701ab39d603cfa7091cc' into gingerbread-plus-aosp

* commit '69717ccd13bb5568b912701ab39d603cfa7091cc':
DO NOT MERGE. Some stuff that is Not Ready.
69717ccd13bb5568b912701ab39d603cfa7091cc 03-Sep-2010 Dianne Hackborn <hackbod@google.com> DO NOT MERGE. Some stuff that is Not Ready.

Change-Id: I8fdba32722d86b92c791dbf7c6c0166bcdb02852
onfiguration.java
0c0250c8515f8b2502db6472c16f99980b7a4101 21-Aug-2010 Gilles Debunne <debunne@google.com> am bbe5fb2b: am 189de282: Merge "Fix for a Resource system bug that displayed the wrong name for missing asset." into gingerbread

Merge commit 'bbe5fb2b73172a6b42b3406354a3556bd53916e1'

* commit 'bbe5fb2b73172a6b42b3406354a3556bd53916e1':
Fix for a Resource system bug that displayed the wrong name for missing asset.
e49564e0f710ba4a1405cfdfde068cb776ee474e 21-Aug-2010 Kenny Root <kroot@google.com> am 821afa9a: am 54d41379: Merge "Add OBB flags to support overlays" into gingerbread

Merge commit '821afa9aec8d3a4ffd2e72ce797d8097eaf13973'

* commit '821afa9aec8d3a4ffd2e72ce797d8097eaf13973':
Add OBB flags to support overlays
bbe5fb2b73172a6b42b3406354a3556bd53916e1 20-Aug-2010 Gilles Debunne <debunne@google.com> am 189de282: Merge "Fix for a Resource system bug that displayed the wrong name for missing asset." into gingerbread

Merge commit '189de2820932fd5dc98b9639fdc420a57cfa2316' into gingerbread-plus-aosp

* commit '189de2820932fd5dc98b9639fdc420a57cfa2316':
Fix for a Resource system bug that displayed the wrong name for missing asset.
189de2820932fd5dc98b9639fdc420a57cfa2316 20-Aug-2010 Gilles Debunne <debunne@google.com> Merge "Fix for a Resource system bug that displayed the wrong name for missing asset." into gingerbread
75399683a418fff55539e6028341caa2e7572362 19-Aug-2010 Gilles Debunne <debunne@google.com> Fix for a Resource system bug that displayed the wrong name for missing asset.

I didn't reproduce the bug and cannot ensure that this will fix it. The monkey
with identical parameters stops with an ANR.

Bug http://b/issue?id=2931528

Change-Id: I45f156c6a694f2d67fe514e0f0bb367aa017f08e
ypedArray.java
821afa9aec8d3a4ffd2e72ce797d8097eaf13973 19-Aug-2010 Kenny Root <kroot@google.com> am 54d41379: Merge "Add OBB flags to support overlays" into gingerbread

Merge commit '54d41379357d1d800d0a7bd7c5dc56111710482a' into gingerbread-plus-aosp

* commit '54d41379357d1d800d0a7bd7c5dc56111710482a':
Add OBB flags to support overlays
02ca31fbae9f35dd30f79de6927fae11b549391a 12-Aug-2010 Kenny Root <kroot@google.com> Add OBB flags to support overlays

* Add flags field in OBB footer to support overlays.

* Remove unused 'crypto' and 'filesystem' fields in obbtool (could
later be supported in the "flags" field of the OBB footer).

* Add notes to document OBB classes before shipping.

Change-Id: I386b43c32c5edef55210acb5d3322639c08010ba
bbInfo.java
a006b47298539d89dc7a06b54c070cb3e986352a 14-Apr-2010 Bjorn Bringert <bringert@android.com> New API and implementation of DB and memory-backed FDs

This depends on a kernel patch that implements read(2)
in the ashmem driver.

Bug http://b/issue?id=2595601

Change-Id: Ie3b10aa471aada21812b35e63954c1b2f0a7b042
ssetFileDescriptor.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
esources.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
esources.java
23fdaf6fb62a9b5154b2508916a21c678462c5d0 06-Aug-2010 Dianne Hackborn <hackbod@google.com> Add new ContentProvider for doing conversions to data streams.

This introduces basic infrastructure that should allow content
providers holding complex data to perform on-demand conversion
of their data to streams of various types. It is achieved through
two new content provider APIs, one to interrogate the possible
stream MIME types the provider can return, and the other to
request a stream of data in a particular MIME type.

Because implementations of this will often need to do on-demand
data conversion, there is also a utility intoduced in ContentProvider
for subclasses to easily run a function to write data into a
pipe that is read by the client.

This feature is mostly intended for cut and paste and drag and
drop, as the complex data interchange allowing the source and
destination to negotiate data types and copy (possible large)
data between them. However because it is fundamental facility
of ContentProvider, it can be used in other places, such as for
more advanced GET_CONTENT data exchanges.

An example implementation of this would be in ContactsProvider,
which can now provider a data stream when a client opens certain
pieces of it data, to return data as flat text, a vcard, or other
format.

Change-Id: I58627ea4ed359aa7cf2c66274adb18306c209cb2
ssetFileDescriptor.java
ab847c44d0549a47717f16ead806b03eecc957db 05-Aug-2010 Scott Main <smain@google.com> am c9de8c34: am 97c2d840: am 8dd87ad9: fix some doc errors in the resources; add link to resource docs for ColorStateList class

Merge commit 'c9de8c34a32af1b305b49096ee96da4c35acd2e8'

* commit 'c9de8c34a32af1b305b49096ee96da4c35acd2e8':
fix some doc errors in the resources;
c9de8c34a32af1b305b49096ee96da4c35acd2e8 05-Aug-2010 Scott Main <smain@google.com> am 97c2d840: am 8dd87ad9: fix some doc errors in the resources; add link to resource docs for ColorStateList class

Merge commit '97c2d840a10813164d82571775a3566637d6c5de' into gingerbread-plus-aosp

* commit '97c2d840a10813164d82571775a3566637d6c5de':
fix some doc errors in the resources;
97c2d840a10813164d82571775a3566637d6c5de 05-Aug-2010 Scott Main <smain@google.com> am 8dd87ad9: fix some doc errors in the resources; add link to resource docs for ColorStateList class

Merge commit '8dd87ad9440bc63bc312b06f292adcd2642b1c41' into gingerbread

* commit '8dd87ad9440bc63bc312b06f292adcd2642b1c41':
fix some doc errors in the resources;
8dd87ad9440bc63bc312b06f292adcd2642b1c41 05-Aug-2010 Scott Main <smain@google.com> fix some doc errors in the resources;
add link to resource docs for ColorStateList class

Change-Id: I7f59bfd136d5bd3c2ea066b6123ee13ccd57f502
olorStateList.java
7d6bddc9a22b1eccc360417a1ca4d1f63a3df4f1 22-Jul-2010 Daniel Sandler <dsandler@google.com> More readable Configuration#toString() output.

Change-Id: I761cba019d7c09c79db59b705dbd3390c62c94e2
onfiguration.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
42ef77f3603ae54990d6718db79afae61e91dc61 21-Jul-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Ide1539b6777faf232d5360d6dc89a5d255982747
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
esources.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.
5adfe6c56369b48e10493c0bb9e9b64ac553a19f 16-Jul-2010 The Android Open Source Project <initial-contribution@android.com> merge from open-source master

Change-Id: Iacd42b06fa01fa6dfd18b81f07ce4b6da922dfff
fb4e1e24a93c7e6bc0fcdb3f5cfadfbc19503cd8 16-Jul-2010 Kenny Root <kroot@google.com> resolved conflicts for merge of 181bb0ab to master

Change-Id: I2284e7c671d127da0d124fbabae8d887727fd5bf
6ba776ad34a8029e4d0c784ce0092f1fcbc91bef 16-Jul-2010 Christopher Tate <ctate@google.com> am 078ccbdb: am 2c40582a: Merge "Add native C APIs for working with the Asset Manager" into gingerbread

Merge commit '078ccbdbb98c118aa87cab2fef61ff90dd128358'

* commit '078ccbdbb98c118aa87cab2fef61ff90dd128358':
Add native C APIs for working with the Asset Manager
02c8730c1bf19daf48bec8c6995df676a00a73b1 01-Jul-2010 Kenny Root <kroot@google.com> Add API to call to vold for mounting OBBs

* Unhide StorageService class; hide all the USB-related items

* Add application-visible API to StorageManager for OBB files

* Add class for parceling OBB info across binders (ObbInfo)

* Add a JNI glue class to libutils/ObbFile (ObbScanner)

* Add API to MountService to deal with calling into vold and checking
permissions

Change-Id: I33ecf9606b8ff535f3a2ada83931da6bbef41cfd
bbInfo.aidl
bbInfo.java
bbScanner.java
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.
esources.java
6cce32b6adbb3a9725fc730ba0e0068a74657e60 13-Jul-2010 Christopher Tate <ctate@google.com> Add native C APIs for working with the Asset Manager

Change-Id: I493b142c4b35e5cc1a1e85283bb5dfb306a6d261
ssetManager.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
luralRules.java
esources.java
14cee9f688c32d63d8521188e7422811629bb7c2 24-Apr-2010 Dianne Hackborn <hackbod@google.com> 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
ompatibilityInfo.java
onfiguration.java
694f79b5d1196640d1beb680b7d1fc68e6e77cbd 18-Mar-2010 Dianne Hackborn <hackbod@google.com> Fix issue #2519590: Lock screen stuck in landscape mode

Well, mostly. There is still a problem here where the first time
you show the lock screen it just doesn't draw itself. I assume
this is something breaking in the view hierarchy as it floounders
around removing and adding new views as it is first being shown...
but no idea at this point what is the actual case.

Change-Id: Iba99ae3242931c8673b17b106c86fc99e2c52abe
onfiguration.java
a839703e0dec352bba9c7e4165e91b9083f58185 12-Mar-2010 Dianne Hackborn <hackbod@google.com> Fix issue #2483335: android.content.res.cts.ConfigurationTest test's are failing

Change-Id: Ic2d10809c88f24d84e58d9f2edfd95912af29038
onfiguration.java
15a4d2ffd04dc6c70f2cd17dae12ac6bc14c69ab 12-Mar-2010 Kenny Root <kroot@google.com> Add correct copyright headers to multiple files

Format for the list of changes shows the origin commit reference followed
by the file name.

33931-p9 awt/org/apache/harmony/awt/gl/font/AndroidGlyphVector.java
33931-p9 awt/org/apache/harmony/awt/gl/image/PngDecoderJava.java
133776-p9 core/java/android/app/IntentService.java
127013-p9 core/java/android/appwidget/AppWidgetHost.java
27863-p9 core/java/android/bluetooth/BluetoothAudioGateway.java
60765-p9 core/java/android/content/SyncResult.java
43920-p9 core/java/android/content/pm/ActivityInfo.java
43920-p9 core/java/android/content/pm/ApplicationInfo.java
43920-p9 core/java/android/content/pm/InstrumentationInfo.java
43920-p9 core/java/android/content/pm/PackageInfo.java
44103-p9 core/java/android/content/pm/PackageItemInfo.java
68960-p9 core/java/android/content/pm/PackageStats.java
43920-p9 core/java/android/content/pm/ResolveInfo.java
43920-p9 core/java/android/content/pm/ServiceInfo.java
60641-p9 core/java/android/content/res/Configuration.java
60734-p9 core/java/android/content/res/TypedArray.java
137672-p9 core/java/android/inputmethodservice/ExtractButton.java
123112-p9 core/java/android/inputmethodservice/ExtractEditText.java
119291-p9 core/java/android/inputmethodservice/IInputMethodSessionWrapper.java
112946-p9 core/java/android/inputmethodservice/IInputMethodWrapper.java
115078-p9 core/java/android/os/BatteryStats.java
124790-p9 core/java/android/text/style/UpdateAppearance.java
45083-p9 core/java/android/view/RawInputEvent.java
101491-p9 core/java/android/view/inputmethod/EditorInfo.java
114701-p9 core/java/android/view/inputmethod/ExtractedText.java
123112-p9 core/java/android/view/inputmethod/ExtractedTextRequest.java
119291-p9 core/java/com/android/internal/os/HandlerCaller.java
129279-p9 core/java/com/android/internal/os/PkgUsageStats.java
114701-p9 core/java/com/android/internal/view/IInputConnectionWrapper.java
114701-p9 core/java/com/android/internal/view/InputConnectionWrapper.java
84364-p9 opengl/java/android/opengl/EGLLogWrapper.java
11355-p9 opengl/tools/glgen/src/CFunc.java
11355-p9 opengl/tools/glgen/src/CType.java
11355-p9 opengl/tools/glgen/src/CodeEmitter.java
11355-p9 opengl/tools/glgen/src/GenerateGL.java
11355-p9 opengl/tools/glgen/src/JFunc.java
11355-p9 opengl/tools/glgen/src/JType.java
11355-p9 opengl/tools/glgen/src/JniCodeEmitter.java
11355-p9 opengl/tools/glgen/src/ParameterChecker.java
57236-p9 services/java/com/android/server/status/AnimatedImageView.java
66754-p9 services/java/com/android/server/status/CloseDragHandle.java
57188-p9 services/java/com/android/server/status/DateView.java
46928-p9 services/java/com/android/server/status/ExpandedView.java
70590-p9 services/java/com/android/server/status/FixedSizeDrawable.java
45968-p9 services/java/com/android/server/status/IconData.java
57470-p9 services/java/com/android/server/status/IconMerger.java
82719-p9 services/java/com/android/server/status/LatestItemView.java
45968-p9 services/java/com/android/server/status/NotificationData.java
66754-p9 services/java/com/android/server/status/NotificationLinearLayout.java
57458-p9 services/java/com/android/server/status/NotificationViewList.java
45968-p9 services/java/com/android/server/status/StatusBarException.java
45968-p9 services/java/com/android/server/status/StatusBarIcon.java
46130-p9 services/java/com/android/server/status/StatusBarNotification.java
45968-p9 services/java/com/android/server/status/StatusBarView.java
46199-p9 services/java/com/android/server/status/Ticker.java
62286-p9 services/java/com/android/server/status/TickerView.java
57188-p9 services/java/com/android/server/status/TrackingView.java
86041-p9 telephony/java/android/telephony/PhoneStateListener.java
87020-p9 telephony/java/com/android/internal/telephony/TelephonyIntents.java
136269-p9 telephony/java/com/android/internal/telephony/gsm/SpnOverride.java
34409-p9 tests/FrameworkTest/src/com/android/frameworktest/FrameworkTestApplication.java
55717-p9 tests/FrameworkTest/src/com/android/frameworktest/performance/InvalidateCycle.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityLandscape.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/AutoCompleteTextViewActivityPortrait.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollablePanScan.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityNonScrollableResize.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollablePanScan.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/BigEditTextActivityScrollableResize.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityPanScan.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/BottomEditTextActivityResize.java
127341-p9 tests/ImfTest/src/com/android/imftest/samples/ButtonActivity.java
129347-p9 tests/ImfTest/src/com/android/imftest/samples/DialogActivity.java
129372-p9 tests/ImfTest/src/com/android/imftest/samples/EditTextActivityDialog.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityNoScrollPanScan.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollPanScan.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/ManyEditTextActivityScrollResize.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivityNotSelected.java
128994-p9 tests/ImfTest/src/com/android/imftest/samples/OneEditTextActivitySelected.java
25959-p9 tests/framework-tests/src/android/test/FrameworkTests.java
46162-p9 tests/framework-tests/src/com/android/internal/http/multipart/MultipartTest.java
77101-p9 tools/layoutlib/bridge/tests/com/android/layoutlib/bridge/NinePatchTest.java
9788976b1465ce982b5ae7c741345edd0ecd9322 core/java/android/accounts/AuthenticatorDescription.java
53332883543868fb83e111a07306368b7772b340 core/java/android/app/UiModeManager.java
93e7e22ec91dbc641d10ca6d70423e1357a95bba core/java/android/app/FullBackupAgent.java
328c0e7986aa6bb7752ec6de3da9c999920bb55f core/java/android/content/CursorEntityIterator.java
307da1a46b4c9b711bafe8fbaaa6b98e8868c18e core/java/android/content/SyncQueue.java
307da1a46b4c9b711bafe8fbaaa6b98e8868c18e core/java/android/content/SyncOperation.java
eb034652c2037a47ebfd99779e8383bb8bb528af core/java/android/content/pm/LabeledIntent.java
49237345d83e62fdb9eb8d50b13ad086636a04fa core/java/android/content/pm/FeatureInfo.java
a2b6c3775ed6b8924232d6a01bae4a19740a15f8 core/java/android/content/pm/PackageInfoLite.java
3ecd5f437580e49d80beecd29489d5fb1f7a7db0 core/java/android/content/pm/RegisteredServicesCacheListener.java
5ebbb4a6b3e16f711735ae0615b9a9ea64faad38 core/java/android/content/pm/XmlSerializerAndParser.java
c4516a7b62de525e3d6d5e76851bdfaf12c11f05 core/java/android/database/sqlite/SQLiteTransactionListener.java
9bbc21a773cbdfbef2876a75c32bda5839647751 core/java/com/android/internal/backup/LocalTransport.java
21f1bd17b2dfe361acbb28453b3f3b1a110932fa core/java/com/android/internal/content/PackageMonitor.java
4c62fc0e1e5ea9c69a12a7d1cf8b3ec8b2d114a3 core/java/com/android/internal/view/BaseSurfaceHolder.java
4c62fc0e1e5ea9c69a12a7d1cf8b3ec8b2d114a3 core/java/com/android/internal/view/BaseIWindow.java
e540833fdff4d58e37c9ba859388e24e2945ed45 core/java/com/android/internal/os/SamplingProfilerIntegration.java
192ab903887bbb8e7c7b6da5c581573850e30f46 core/tests/coretests/src/android/widget/expandablelistview/PositionTesterContextMenuListener.java
1619367ab823150fa8856d419abe02ceb75886f1 media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/MediaProfileReader.java
27f8002e591b5c579f75b2580183b5d1c4219cd4 opengl/tools/glgen/stubs/gles11/glGetString.java
560814f6b11abe83ff0c4ed18cac015c276b3181 opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.java
560814f6b11abe83ff0c4ed18cac015c276b3181 opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.java
560814f6b11abe83ff0c4ed18cac015c276b3181 opengl/tools/glgen/stubs/gles11/glShaderSource.java
1c4907ee77392afb768c2f088e0dedbe4239f6fb opengl/tools/glgen/src/GenerateGLES.java
1c4907ee77392afb768c2f088e0dedbe4239f6fb opengl/tools/glgen/src/Jsr239CodeEmitter.java
1c4907ee77392afb768c2f088e0dedbe4239f6fb opengl/tools/glgen/src/GLESCodeEmitter.java
69e21f5f6e0d04539cd92848ea009dd615d88c2c opengl/tests/gldual/src/com/android/gldual/TriangleRenderer.java
c028be4f3b8c7476b46859f66c3f33d528adf181 packages/DefaultContainerService/src/com/android/defcontainer/DefaultContainerService.java
7c6efa13f129dbae5319f0981a430d4662f43354 tests/BrowserPowerTest/src/com/android/browserpowertest/PowerMeasurement.java
7c6efa13f129dbae5319f0981a430d4662f43354 tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestActivity.java
7c6efa13f129dbae5319f0981a430d4662f43354 tests/BrowserPowerTest/src/com/android/browserpowertest/PowerTestRunner.java
df8a3f31d871db25e952972c2eb346a71186e9e3 tests/BrowserTestPlugin/src/com/android/testplugin/TestPlugin.java
cfaef699e1dfb3a75d5b51f3b15816f13670fd51 tests/permission/src/com/android/framework/permission/tests/ActivityManagerPermissionTests.java
cfaef699e1dfb3a75d5b51f3b15816f13670fd51 tests/permission/src/com/android/framework/permission/tests/ServiceManagerPermissionTests.java
cfaef699e1dfb3a75d5b51f3b15816f13670fd51 tests/permission/src/com/android/framework/permission/tests/WindowManagerPermissionTests.java

Copyright header moved to top in following file:

core/tests/coretests/src/android/widget/ListViewTest.java

Change-Id: I3c3198be5a0ba36e18679ed834170432bf0b8418
onfiguration.java
ypedArray.java
cf244ada58539ce857ec041d7288d0271204fbb6 10-Mar-2010 Dianne Hackborn <hackbod@google.com> 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
ypedArray.java
7299c41630935a2b106e73e5603579a7747f7535 05-Mar-2010 Dianne Hackborn <hackbod@google.com> 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. :(
onfiguration.java
ef05e076ced1a32c5c0aaee28403779834adb2ba 02-Mar-2010 Dianne Hackborn <hackbod@google.com> 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.
onfiguration.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.
esources.java
tringBlock.java
ypedArray.java
mlBlock.java
c3b91fd26a940f8cee54888f91b490cb1768b03c 24-Feb-2010 Dianne Hackborn <hackbod@google.com> Fix crash in PendingIntentRecord debug output.

Add null checks to a few places to avoid crashes when dumping
debug data.

Also add some sanity checks for accessing content providers in
the activity manager.
ssetManager.java
mlBlock.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.
onfiguration.java
esources.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.
ssetManager.java
onfiguration.java
esources.java
3a19833750de7f8872ad44892054e409b2d77614 22-Jan-2010 Kenny Root <kroot@google.com> Multiple asset adding in one shot for AssetManager

Add a hidden convenience method to allow adding multiple assets
to an AssetManager at once.

Change-Id: I56753a85904a2c8e9a405cba2ea3cb85ec40e1cc
ssetManager.java
79dc8ccddd846816d4e0e55405ad0dbefa5b0ff6 04-Jan-2010 Romain Guy <romainguy@android.com> Fix typo in ColorStateList documentation.
olorStateList.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.
esources.java
tringBlock.java
ypedArray.java
mlBlock.java
60d7db4c3e3d60060e7ac021445ea1f510b7a1fb 17-Nov-2009 Dianne Hackborn <hackbod@google.com> Fix #2262593: 42 ANR reports from android.process.acore

There was a lock in AssetManager that purported to be per-instance (mSync)
but was actually static. A lot of code used it like it was per-instance,
but this would actually block all instances. This is now changed to fix
the name and make everything except the actual static data lock on the
specific AssetManager instance.

Change-Id: Ie8e9ad60f962184e76b2301f7a2790d0c2487063
ssetManager.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
esources.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
esources.java
b5c17a64edbdac47d8aa48951b50ea0a8e982655 22-Sep-2009 Mike Reed <reed@google.com> experimental fix for compatibility mode. When we scale up by 1.5 (240 dpi), we put stretched ninepatches on
exact pixel boundaries when we walk the inverse matrix (e.g. 2/3, 1+1/3, 2, 2+2/3, 3+1/3, 4, ...).

These are not stable, since any variance in the inverse matrix (even in the lowest bit) can cause some other
part of the ninepatch to start a hair to the left, resulting in misaligning every 3 pixels.

The fix changes the matrix' phase enough to keep all of the stretched ninepatches in phase.
ompatibilityInfo.java
93e462b79d6896da10e15e74c5aec6beb098dddf 16-Sep-2009 Dianne Hackborn <hackbod@google.com> 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
onfiguration.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
esources.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
esources.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
ssetManager.java
esources.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.
esources.java
a9f1dd021f8f6ee777bc4d27913bd40c42e753af 13-Aug-2009 Eric Fischer <enf@google.com> Make <font size> and <font height> in string resources respect density.

This unfortunately requires API changes because the existing text markup
classes had no access to the screen density.

TextPaint gains a "density" field so that TextView can pass the density
along. AbsoluteSizeSpan gains a new flag to indicate that its argument
is in dip instead of in physical pixels. LineHeightSpan gains an inner
interface whose chooseHeight() method includes a TextPaint argument so
it can get at the density. And when StringBlock creates the markup
objects, it now uses the density-aware versions.

Bug 1976971, Bug 2031746
tringBlock.java
90f77218a24ac66bea52faef79c30d45420ce135 12-Aug-2009 Dianne Hackborn <hackbod@google.com> am b8546001: Merge change 20878 into donut

Merge commit 'b8546001701405a76dad7e6235046e592296fac2'

* commit 'b8546001701405a76dad7e6235046e592296fac2':
Fix issue #2048263: More debugging information
82e1ee93eece8fb0aec6acc3ef4ee7b1c86feec7 12-Aug-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2048263: More debugging information

We now hopefully do better about generating the anr reports, and include
information about the malloc loaded assets in meminfo.
ssetManager.java
afcf686cb070313ae5ce6c54ac381a3a86a60ed2 31-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 25dff70f: Merge change 9039 into donut

Merge commit '25dff70f153529b87f5ad4a92f4de21e8950b1de'

* commit '25dff70f153529b87f5ad4a92f4de21e8950b1de':
Fix #2018814: System cannot correctly render assets with "wrap_content" attribute in QVGA
0d221012ff5fd314711c00ed30e9b807b9c454c1 30-Jul-2009 Dianne Hackborn <hackbod@google.com> 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.
ssetManager.java
ypedArray.java
30b06eb8b98b6e6dc685cf65ad4faa25a85008c5 24-Jul-2009 Mitsuru Oshima <oshima@google.com> am 589cebe2: * Use the scaled size for surface view instead of native. The surface will be always scaled by surface flinger in compatiblity mode. The original approach confused the app because the surface size and the view size were different. * a few clean up. remo

Merge commit '589cebe2d58591403de4a77077941c0454bc91bc'

* commit '589cebe2d58591403de4a77077941c0454bc91bc':
* Use the scaled size for surface view instead of native. The surface will be always scaled
589cebe2d58591403de4a77077941c0454bc91bc 23-Jul-2009 Mitsuru Oshima <oshima@google.com> * Use the scaled size for surface view instead of native. The surface will be always scaled
by surface flinger in compatiblity mode. The original approach confused the app because
the surface size and the view size were different.
* a few clean up. removed unsed arguments, obsolete conditions from getTranslator()
(expandable check was a bug)
ompatibilityInfo.java
c00c04d7d8758a5ade185d465624e47dcf1bd7c0 22-Jul-2009 Dianne Hackborn <hackbod@google.com> am 11b822d2: Simplify density compatibility to a boolean.

Merge commit '11b822d2a91ea17c34c0cb1c11e80a9a30d72864'

* commit '11b822d2a91ea17c34c0cb1c11e80a9a30d72864':
Simplify density compatibility to a boolean.
11b822d2a91ea17c34c0cb1c11e80a9a30d72864 22-Jul-2009 Dianne Hackborn <hackbod@google.com> Simplify density compatibility to a boolean.

Instead of a list, we now just have a single boolean indicating whether an
application is density aware, and this set set to true by default as of
Donut.
ompatibilityInfo.java
a8339dfec9d1b2c6d6fd2f8268f8075d184f64c0 22-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 9fc20b0e: Merge change 8126 into donut

Merge commit '9fc20b0e381b5fe00b7049ef357c839cd05a33bf'

* commit '9fc20b0e381b5fe00b7049ef357c839cd05a33bf':
First pass at reworking screen density/size APIs.
c4db95c077f826585d20be2f3db4043c53d30cf5 22-Jul-2009 Dianne Hackborn <hackbod@google.com> 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.
ompatibilityInfo.java
onfiguration.java
fead9b8ad0c6e64066fb73f4285b088ab68f452b 22-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am fe6f45c8: Merge change 8098 into donut

Merge commit 'fe6f45c81463d2d28e11ac6083f2653e1286c5ef'

* commit 'fe6f45c81463d2d28e11ac6083f2653e1286c5ef':
cast is floor. Use round instead.
61324e58c549670c015010d0be14c6af76e3e9f7 22-Jul-2009 Mitsuru Oshima <oshima@google.com> cast is floor. Use round instead.
This fixes a few layout issues (that was due to smaller widnow size)
ompatibilityInfo.java
a065b01904d5017232c9b51ccb174412ff57e138 20-Jul-2009 Mitsuru Oshima <oshima@google.com> am 841f13c8: * Reverted the change in PackageParser that I checked by accident * More surface view fix. - correct event translation on surface view. - use compatible window * removed FLAG_NO_COMPATIBILITY_SCALE. It was my misunderstanding of how SurfaceView works,

Merge commit '841f13c8e9ff3f7695b6c18a8abcec3c947983ff'

* commit '841f13c8e9ff3f7695b6c18a8abcec3c947983ff':
* Reverted the change in PackageParser that I checked by accident
bec99bffeecacb1af603966391014895f9a16025 20-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 5c536e91: Merge change 7840 into donut

Merge commit '5c536e9162721c460699a041959a0d67de1d20db'

* commit '5c536e9162721c460699a041959a0d67de1d20db':
Fix issue where scaled bitmap sizes could be wrong.
469b4c67adc77a87eb2c9ed9217edf1778002828 20-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am aad0fcc9: Merge change 7783 into donut

Merge commit 'aad0fcc9619eb72c18a6afff48ebc9d4011f0f54'

* commit 'aad0fcc9619eb72c18a6afff48ebc9d4011f0f54':
Add "nodpi" density, and expose a bunch of density-related APIs.
841f13c8e9ff3f7695b6c18a8abcec3c947983ff 18-Jul-2009 Mitsuru Oshima <oshima@google.com> * Reverted the change in PackageParser that I checked by accident
* More surface view fix.
- correct event translation on surface view.
- use compatible window
* removed FLAG_NO_COMPATIBILITY_SCALE. It was my misunderstanding of how SurfaceView works, and this was not necessary.
* Added compatibility related info to package dumpsys
ompatibilityInfo.java
2784ff0af88128f66ae690b73d48fb7e4a211e68 19-Jul-2009 Dianne Hackborn <hackbod@google.com> Fix issue where scaled bitmap sizes could be wrong.

The Bitmap functions to get the scaled width/height couldn't actually
do the right thing because they didn't know the destination they would
be drawing to. Now there are two forms of them, taking an explicit
parameter specifying the destination.
ompatibilityInfo.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.
ompatibilityInfo.java
esources.java
0fde7de9d660e4acdb8404f954f75d8c331b5d45 17-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 54f09101: Merge change 7613 into donut

Merge commit '54f09101381fa63dca35ae4ea0ba3802ee863236'

* commit '54f09101381fa63dca35ae4ea0ba3802ee863236':
* Use Fede In/Out animation if one of opening/closing apps is in compatibility mode.
5a2b91dc14e4c92e91c6abcc795f54ac98ee5866 17-Jul-2009 Mitsuru Oshima <oshima@google.com> * Use Fede In/Out animation if one of opening/closing apps is in compatibility mode.
* preserve compatibility window flag when the app updates window's layout params.
* Added assertion in DEFAULT_COMPATIBILITY_INFO object to prevent unintentional modification.
* A few minor updates
* log/dump message improvement
* Removed unnecessary method in FadeInOutAnimator
* Fixed 100 char issue in WindwoManagerServer.java
ompatibilityInfo.java
6630e4a1dc40850eb7a4ddc8aaa06479469e8c4d 15-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am b5c735d3: Merge change 7106 into donut

Merge commit 'b5c735d35c8c1d2fb4e4654fbffcdb62d5acab4d'

* commit 'b5c735d35c8c1d2fb4e4654fbffcdb62d5acab4d':
Return adjusted display for WindowManager.getDefaultDisplay()
ddd12535f095d8d056716c3290faf50ec52a538a 14-Jul-2009 Mitsuru Oshima <oshima@google.com> Return adjusted display for WindowManager.getDefaultDisplay()
esources.java
a62e3e4d0f4d18f4b8d31876e035d3ae57f88f40 13-Jul-2009 Mitsuru Oshima <oshima@google.com> am ba3ba579: * Use cached resources for widgets

Merge commit 'ba3ba57921dedaaef669719c0359c0caf60e008b'

* commit 'ba3ba57921dedaaef669719c0359c0caf60e008b':
* Use cached resources for widgets
ba3ba57921dedaaef669719c0359c0caf60e008b 09-Jul-2009 Mitsuru Oshima <oshima@google.com> * Use cached resources for widgets
esources.java
c3f60ddaeadb69c1e85198e609e575f55ecc28ac 09-Jul-2009 Mitsuru Oshima <oshima@google.com> am 1ecf5d28: Re-implementation of large screen support using window manager. * added background filler surface to fill the outer rim. Using the same layer as dim surface because they never co-exists (in the same window) * clean up the obsolete code in Compatibilt

Merge commit '1ecf5d28817f0a051e77488380dcd5bc622ea169'

* commit '1ecf5d28817f0a051e77488380dcd5bc622ea169':
Re-implementation of large screen support using window manager.
1ecf5d28817f0a051e77488380dcd5bc622ea169 07-Jul-2009 Mitsuru Oshima <oshima@google.com> Re-implementation of large screen support using window manager.
* added background filler surface to fill the outer rim. Using the same layer as dim surface because
they never co-exists (in the same window)
* clean up the obsolete code in CompatibiltyMode/ViewRoot for support large screen support.
ompatibilityInfo.java
507f8ed2e05f97b20307b900fbc7308e0f8fdb83 09-Jun-2009 Kenny Root <kenny@the-b.org> Fix Configuration documentation for new constants

* Added KEYBOARD_NOKEYS link to Javadoc for keyboard.
* Added NAVIGATION_NONAV link to Javadoc for navigation.
onfiguration.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.
ompatibilityInfo.java
esources.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.
ssetManager.java
ompatibilityInfo.java
onfiguration.java
esources.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.
ompatibilityInfo.java
esources.java
63e7155c7d1d0c3f0027400aa09e9a45f648a80d 19-Jun-2009 Android (Google) Code Review <android-gerrit@google.com> Merge change 4696 into donut

* changes:
Fix targetSdkVersion, make resize mode a flag, delayed dexopt, easy ApplicationInfo.
5c1e00b14d2ef10ec76abf3e951fa8003a67f558 19-Jun-2009 Dianne Hackborn <hackbod@google.com> Fix targetSdkVersion, make resize mode a flag, delayed dexopt, easy ApplicationInfo.

- Fix a bug where targetSdkVersion could not be set if minSdkVersion. Stupid, stupid.
Also make sure to fail if minSdkVersion is for a code name. Really stupid.

- Change the API for resize compatibility mode to be a bit in the flags field, instead
of a separate boolean.

- Implement delayed dexopting, to avoid the looong full dexopt during boot. This is
only enabled for "eng" builds. When in this mode, the activity manager will make
sure that a dexopt has been done before loading an .apk into a process, and will
try to avoid displaying ANRs if they are due to the dexopt causing some operation
to take longer than it normally would (though I make no guarantees about this
totally working).

- Add API to Context to get the ApplicationInfo for its package, for easy access to
things like targetSdkVersion.
ompatibilityInfo.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.
esources.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.
ompatibilityInfo.java
esources.java
2f5e6b2d31f445a4e9faf3a7ace94f9ef6948336 05-Jun-2009 Mitsuru Oshima <oshima@google.com> A workaround to fix rotation issue. I'm remote now and hard to do troubleshooting (i cannot rotate emulator in nx..)
ompatibilityInfo.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.
ompatibilityInfo.java
esources.java
963cd006c45716b034f656bf7e7179e6476f7e4d 29-May-2009 Bjorn Bringert <bringert@android.com> Allow creating AssetFileDescriptors for MemoryFiles.

This allows content providers to use in-memory data to implement
ContentProvider.openAssetFile(), instead of just normal files
and sockets as before.

To test cross-process use of AssetFileDescriptors for MemoryFiles,
a test content provider and a client for it are added to
AndroidTests.

Fixes http://b/issue?id=1871731
ssetFileDescriptor.java
13735a255dedd2c2e3b0cff66f0be2e17671f553 29-Apr-2009 Mitsuru Oshima <> Merge branch 'readonly-p4-donut' into donut
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
esources.java
1d442e0d990b581357f33f5463c7c5cb49b551e8 21-Apr-2009 Dianne Hackborn <hackbod@google.com> More optimization of dumpsys output.

There are three major classes of changes here:

- Avoid writing lines where their values are often empty, false, or some other typical thing.
- Use partial writes to the PrintWriter to avoid creating temporary strings.
- Use StringBuilder where we need to generate real String objects (and where possible cache the result).
onfiguration.java
f8a7ceaef2e7d5cd530c9426bde91b6fa9a40b75 11-Apr-2009 Andy Stadler <> AI 145778: Manual merge changes 145382-145384 from cupcake.

Automated import of CL 145778
onfiguration.java
esources.java
c39a6e0c51e182338deb8b63d07933b585134929 11-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@137873
olorStateList.java
b2a3dd88a53cc8c6d19f6dc8ec4f3d6c4abd9b54 09-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@137197
ssetManager.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
ssetFileDescriptor.java
ssetManager.java
olorStateList.java
onfiguration.aidl
onfiguration.java
luralRules.java
esources.java
tringBlock.java
ypedArray.java
mlBlock.java
mlResourceParser.java
ackage.html
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
ssetFileDescriptor.java
ssetManager.java
olorStateList.java
onfiguration.aidl
onfiguration.java
luralRules.java
esources.java
tringBlock.java
ypedArray.java
mlBlock.java
mlResourceParser.java
ackage.html
076357b8567458d4b6dfdcf839ef751634cd2bfb 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@132589
ssetFileDescriptor.java
olorStateList.java
esources.java
tringBlock.java
ypedArray.java
3dec7d563a2f3e1eb967ce2054a00b6620e3558c 03-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@137055
ssetFileDescriptor.java
olorStateList.java
esources.java
tringBlock.java
ypedArray.java
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
olorStateList.java
esources.java
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
olorStateList.java
onfiguration.java
luralRules.java
esources.java
tringBlock.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
ssetFileDescriptor.java
ssetManager.java
olorStateList.java
onfiguration.aidl
onfiguration.java
luralRules.java
esources.java
tringBlock.java
ypedArray.java
mlBlock.java
mlResourceParser.java
ackage.html