This allows WebView to add itself to the ResourcesManager and
remain their even after configuration changes and multi-window
changes.
Bug:29112218
Change-Id: I2cb131ae2c61fb58c48babafdd46c1882be96aa9
Change the implementation of getLocales() to iterate the set of
configurations using a templated method, instead of using the result
of getConfigurations().
Also remove the check for AndroidManifest.xml when adding an asset path.
This is unneccessary.
Bug:28625993
Change-Id: I16de5da598d0c371421d1dc8eee054dce9baf53a
Theme values that would reference other theme values would not work
if they were declared in a shared library.
We now introduce a parallel resource type to TYPE_DYNAMIC_REFERENCE,
TYPE_DYNAMIC_ATTRIBUTE, which allows us to lookup and resolve
theme value references from shared libraries.
Bug:28687378
Change-Id: I4f2364e3e8b567679f90784fcaaea12b6b05e926
"tm_mon" format should align with "ZipEntry::setModWhen" in aapt.
"tm_isdst" should be initialized, or it will because random value
and cause error in function mktime().
BUG:28021145
(cherry picked from commit bb0eb3f4cb33c077b296a18555a9a1a966ff696b)
Change-Id: Ia39cf63fcd4bb39c24af080562960279106f526c
Due to ! taking precedence over bitwise &, the condition for
checking non-null terminated string blocks is incorrect.
Adds parentheses for the correct behavior.
Bug:28288210
Change-Id: Ie31fa239e5f869e6bb28deb6ae190f41f1aa4d92
Certain error cases are expected (like not finding a package) when
using libandroidfw on the host side for AAPT2. Suppress those warnings
and let AAPT2 handle error cases.
Change-Id: I3de97128686c03c89c5b99559bf46d4f2f1dfe4d
When we set the parameters for a ResTable, we can pre-filter which
resources match and only look at that smaller list when getting entries.
This helps A LOT with types that have many configurations, like strings
and all their various locales.
We must store the cached entries in a parallel data structure because parts
of the main Type object are shared with other ResTables, causing data races.
Bug:25499111
Change-Id: I63e37dcbd683fc9f1e7d0f3a6ed4c1c01e0fc575
There is a race due to the modification of shared data structures in the framework ResTable.
See b/27499488
This reverts commit d4b169173ad7805369204277580d3942cb08174a.
Change-Id: I3f400a2ad3b5ffc652b84dd5fe777f7cf34b5548
Previously, a bit was kept to find if the script of a locale was
explicitly "provided" in a resource. This was not backward
compatible, and failed in some edge cases when the package was
created with older versions of AAPT that did not set the bit.
The cases would happen when the old resource had an explicit script
specified in its locale, but since the "provided" bit was not set in
the package, we would assume that the script was computed by us.
This CL replaces the "provided" bit with a "computed" bit, so the
default value of the bit (set to "false" for old packages) would be
correct.
Bug: 27156990
Change-Id: I99e7f1ad8f70c90e25ab3640ed34cc1a6f8d1d64
When we set the parameters for a ResTable, we can pre-filter which
resources match and only look at that smaller list when getting entries.
This helps A LOT with types that have many configurations, like strings
and all their various locales.
Bug:25499111
Change-Id: Ie6894c44bc67e16a10dbe028c8f3e119e5c29ac7
We get ResTables two different ways: one is from AAPT, another from
settings-based requests from the Java side. In the settings-based
requests, localeScript will be autocomputed, but for AAPT-filled
tables (especially if they come from older versions of AAPT), we need
to compute the script.
Previously, locales that came from packages were incorrectly assumed
to have "undeterminable" scripts, rather than "undetermined" scripts.
This led to us mistakenly falling back to the old logic of requiring
the locales' countries to match, rather than just looking at computed
scripts.
Bug: 27157452
Change-Id: Id7e346d3ecfb17273ffb63de5bcb4849a6eafbbd
When locale fallback landed, resources which specified an 'English'
locale started to be considered a better match for en-US, even though
traditionally, apps tend to ship US English resources under their
default locale.
This fixes that, and makes en-US requests match default locales.
Bug: 26756573
Bug: 26789680
Bug: 26803868
Change-Id: I460c276bfc6ddba0439dcdf87497a0aece0fa05d
* Add support for determining script from language and region.
* Add support for determining special parents of locales.
* Add support for smart comparison of locales with only a difference
in region, using the locale parentage tree.
* Fix LocaleData.matchScore() to not fallback to old locale matching
behavior if we can't determine a script.
* Allow four-character variant codes. (Previously, only five- to
eight-character variant codes were allowed.)
Bug: 7296673
Bug: 26589793
Change-Id: Ibde0a48c0564ff383b41068095a5cbacfe7b94bc
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
- 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
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
Now that ZipFileRO::startIteration supports prefix/suffix matching,
we can pass dirName to the function for simpler code and slightly
better performance.
(cherry-pick of c796ad0a8be6df4a3b354690dfe5ce1df8136c09)
Change-Id: I0e2ac58de28020c2af8d8e569a97592b09596185
for better performance. Without the optimization, these two functions
may check more than 100k file names in the pre-installed APK files,
which can take a few seconds to finish even on a recent device.
(cherry-pick of 34fe3df8519523dbb4bc27010fa57f259d5e868d)
Bug: 21957428
Change-Id: I5ebe0438019958d883a7fda6bd92ea4484211d23