History log of /frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a41e66af586a2fe60d450f4a9f4b8e8f06c5f6c4 16-May-2018 Ryan Mitchell <rtmitchell@google.com> ResXMLTree: Clone DynamicRefTable on creation

XmlBlocks are cached in ResourcesImpl::loadXmlResourceParser(...) and
when asset manager invalidates itself, the references to the dynamic
reference tables point to garbage. Now, the reference table is cloned
when the XmlBlock is created so invalidation will not affect the
XmlTree.

Bug: 74240254
Test: Tested GoogleMaps on 9.75.7 and saw crashes stop
Change-Id: I932db7a85fddc640c4d6ec327f534b5a1ad6d0b1
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
325129964e5b0a9794cf5bb63a2d2d8774ea6a1b 26-Apr-2018 Todd Kennedy <toddke@google.com> Allow using reserved package IDs

Pre-O, the platform treats negative resource IDs [those with
a package ID of 0x80 or higher] as invalid. In order to work
around this limitation, we allow the use of traditionally
reserved resource IDs [those between 0x02 and 0x7E].

Bug: 78041707
Test: ./out/host/linux-x86/nativetest64/aapt2_tests/aapt2_tests
Test: ./out/host/linux-x86/nativetest/libandroidfw_tests/libandroidfw_tests
Test: Manual. Create a feature split with a package ID of 0x7E and see it runs and can reference base resources.

Change-Id: I3d9782cc05d3a55e1a2467bf39566788847e1160
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
2ad530d76c55c86d28c893b904b4f12aca65443f 30-Mar-2018 Ryan Mitchell <rtmitchell@google.com> Added decoding of truncated AAPT string lengths.

AAPT incorrectly writes a truncated string length when the string size
exceeded the maximum possible encode length value (0x7FFF). To decode a
truncated length, this change iterates through length values that end
in the encode length bits. Strings that exceed the maximum encode length
are not placed into StringPools in AAPT2.

Test: Successfully ran broken apps from the duplicates of the bugs
provided and created tests
Bug: 69320870

Change-Id: I99dd9b63e91ac250f81d5dfc26b7c0e6276ae162
(cherry picked from commit ea9e8b447a5d24d1b199507dac203c69d81736e2)
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
7ec28a888c7e59af02aeb0e0a9b078037d317e2e 10-Nov-2017 Igor Viarheichyk <viarheichyk@google.com> Use numbering system for configuration selection.

Take into account numbering system when selecting a matching
resource configuration. Add numbering system specifier into the
generated BCP 47 language tag.

Test: build and run libandroidfw_tests
Bug: 71873777

Change-Id: I3afda181f36de4b29a7be270b6f7593c2261fd71
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
71be70507de9cb619b644e55eda1cc181e3f7e90 13-Dec-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Propagate SPEC_OVERLAYABLE flag to final APK

Resources can be marked as overlayable, which means they can
be overlaid by runtime resource overlays.

This change propagates this state to the final resource table that
is installed on device.

Future work:
- Have the idmap tool respect the overlayable state and ignore
entries that overlay anything else.

Bug: 64980941
Test: make aapt2_tests
Change-Id: Id45b1e141a281be2ee32a4ac3096fcf1114d523b
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
bb9965612c0f5f5739645e209f3294ac6ee19168 31-Oct-2017 Roozbeh Pournader <roozbeh@google.com> Merge "Parse BCP 47 locale names with Unicode extensions"
e7bc60a954cfed8b4377a9f9b8601208781d5393 21-Oct-2017 Igor Viarheichyk <viarheichyk@google.com> Parse BCP 47 locale names with Unicode extensions

Locale parser is modified to handle BCP 47 locale extensions and
recognize numbering system specifications. This fixes incorrect
interpretation of an extension key as a region code.

Numbering system specification is stored in the configuration data,
however it's not used for best configuration selection yet.

Bug: 67508876
Test: build and run libandroidfw_tests

Change-Id: If4072b9f39e80f60d4567841afe9ce7a92979574
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
1a1e9c272459f05c846a03fc15989ff7e492517e 14-Oct-2017 Adam Lesinski <adamlesinski@google.com> AssetManager2: Run ApkAssets that have failed verification

ApkAssets who have failed verification should still run for
compatibility. Not all resources are accessed, and therefore
errors in the APK are not necessarily fatal. However, this means
we must do bounds checks when retrieving resources, which is
slower.

Test: make libandroidfw_tests && $ANDROID_BUILD_TOP/out/host/<host>/nativetest64/libandroidfw_tests/libandroidfw_tests
Test: make libandroidfw_benchmarks && adb sync system && adb sync data && /data/benchmarktest64/libandroidfw_benchmarks/libandroidfw_benchmarks
Change-Id: I4cc926c064bca0491785d82cdac0419d74d7d9b0
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
970bd8d2835b05237c4561bd6c12329e26f136b3 25-Sep-2017 Adam Lesinski <adamlesinski@google.com> AssetManager2: Implement IDMAP support

This enables RRO (runtime resource overlays) with AssetManager2

Test: make libandroidfw_tests
Test: out/host/<platform>/nativetest64/libandroidfw_tests/libandroidfw_tests --testdata=frameworks/base/libs/androidfw/tests/data
Change-Id: Id8079104faefbfaa3f4017d8f7ee1a8968f151a2
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
42ebcb80b50834a1ce4755cd4ca86918c96ca3c6 28-Mar-2017 MÃ¥rten Kongstad <marten.kongstad@sony.com> idmap: include idmap version in check for stale file

Teach is_idmap_stale_fd to include the idmap version in the list of
criteria used to determine if an idmap file is already up to date.

Change-Id: I3e4e2aa502fe76a034c3977bdb055a1df7e665be
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
4ca56978a9aea3f021a54ed9265de10811984d94 27-Apr-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Add workaround for non-standard package IDs

The dynamic ref table used to map build-time IDs to runtime IDs
is mainly used for shared resource libraries and has a few built-in
mappings (app 0x7f and framework 0x01).

Using a non-standard package ID like 0x80 causes a failure in package ID
lookup. The solution is to ship the dynamic_ref_table with an identity mapping
with any resource table that uses a non-standard package ID.

Adds some tests to ensure this works correctly.

Bug: 37498913
Test: make libandroidfw_tests
Test: make aapt2_tests
Change-Id: Ic3f67942384d34e7fdcbc94ded360e940e3ebc8a
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
136fd0764faf7a588b4a1b479d7a8cc6fe18fcc6 03-Mar-2017 Adam Lesinski <adamlesinski@google.com> AAPT2: Fix parsing ResTable_type

ResTable_type's size changes due to it containing
ResTable_config. Make sure we check for the minimum size
required to read it.

Bug: 35861796
Test: Manual (don't have an integration test harness setup yet)
Change-Id: Ifb0cd1d732625f59835c8ed0449adb78129636de
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
edb88a2b94093ddaeb11c3ea4b8e989c6822bff1 18-Feb-2017 Adam Lesinski <adamlesinski@google.com> Merge "Add ResTable_sparseTypeEntry support"
c8f71aa67ea599cb80205496cb67e9e7a121299c 08-Feb-2017 Adam Lesinski <adamlesinski@google.com> Add ResTable_sparseTypeEntry support

Benchmarks on bullhead-userdebug show that there is a negligent
performance impact when using sparse entries on a 30% loaded
sparse type of 1000 resources.

Benchmark Time CPU Iterations
-----------------------------------------------------------------------------------
BM_SparseEntryGetResourceSparseLarge 255 ns 254 ns 2751408
BM_SparseEntryGetResourceNotSparseLarge 254 ns 254 ns 2756534

Bug: 27381711
Test: make libandroidfw_tests aapt2_tests
Change-Id: I051ea22f2f6b2bc3696e446adc9e2a34be18009f
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
d1ecd7af687bcad0f87c37fe33515ff6c5ea0f1d 23-Jan-2017 Adam Lesinski <adamlesinski@google.com> AssetManager2: Various fixes

- Use FileMaps to open Assets (prevents closing of ApkAssets underlying
zip)
- Implement OpenDir and List methods
- Fix issue where DynamicRefTable wasn't properly constructed

Test: make libandroidfw_tests
Change-Id: Ib21a84e1114d028120744aa3bc1c6eb9d9399fa8
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
0c40524953f3d36a880f91183302a2ea5c722930 14-Jan-2017 Adam Lesinski <adamlesinski@google.com> AssetManager2: Add other support methods

- Add GetResourceConfigurations()
- Add GetResourceLocales()
- Add ResolveReference()
- Add stub for GetResourceId()
- Change LoadedArsc and ApkAssets factory method to return const

Test: make libandroidfw_tests
Change-Id: Ia797dc9381a523b1a3e7029048a413e544730379
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
90572a4ab8ac393c57e896be3c608e634866ed38 27-Jan-2017 Adam Lesinski <adamlesinski@google.com> Merge "libandroidfw: Add new support for shared libraries"
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
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
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
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
fdaa9c58c9c1961862561b260164d380e3b17363 18-Jan-2017 Adam Lesinski <adamlesinski@google.com> Merge "New implementation of AssetManager/ResTable"
da431a22da38f9c4085b5d71ed9a9c6122c6a5a6 29-Dec-2016 Adam Lesinski <adamlesinski@google.com> libandroidfw: Add new support for shared libraries

This adds support for shared resource libraries in the new
ResTable/AssetManager implementation.

The dynamic package map encoded in resources.arsc is parsed
and stored with LoadedArsc, and combined to form a resolved table
in AssetManager2.

Benchmarks show that this implementation is an order of magnitude
faster on angler-userdebug (make libandroidfw_benchmarks).

Test: libandroidfw_tests
Change-Id: I57c80248728b63b162bf8269ac9495b53c3e7fa0
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
7ad1110ecd6a840fcd2895c62668828a1ca029c6 29-Oct-2016 Adam Lesinski <adamlesinski@google.com> New implementation of AssetManager/ResTable

The multiwindow model and Resources-per-activity
model that came in N puts greater demands on AssetManagers.
They are created whenever window dimensions change, which
can be frequently. There is a need to be able to cheaply
create a new AssetManager for each Activity, which shares
a lot of underlying state.

In order to make the creation of AssetManagers cheap,
we need a new implementation of the native AssetManager
and ResTable to support immutable representations of
APKs. This new data structure/class is ApkAssets.

ApkAssets have the same functionality of an AssetManager, except
that they operate on a single APK, and they do not do any caching.
Once loaded, they are immutable.

ApkAssets will be exposed as a Java object, with its implementation in
native code. The existing Java StringBlock will be owned by ApkAssets,
which means that Strings can be shared across AssetManagers.

ApkAssets can be cached by the ResourcesManager. Creating an AssetManager
requires only a list of ApkAssets and a configuration.

AssetManager2 (named with the suffix '2' for now while transitioning
to the new implementation) caches bags that are accessed.

Since ApkAssets are expected to be kept around longer, they do more validation
of the resource table, which cause slower load times. Measured on an angler-userdebug,
loading the framework assets takes 11ms with ApkAssets, and 2ms with the old
AssetManager implementation.

The tradeoff is that there does not need to be any security checks once an ApkAssets
is loaded, and regular resource retrieval is faster. Measured on an angler-userdebug,
accessing resource (android:string/ok) with many locales takes 18us with AssetManager2,
and 19us with AssetManager (this is per resource, so these add up).

Test: make libandroidfw_tests
Change-Id: Id0e57ee828f17008891fe3741935a9be8830b01d
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
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
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h
f6113af2d6f6eebee68d3ac510fe96d38a7a39e9 04-Nov-2016 John Reck <jreck@google.com> Re-unite sources with their headers

Move all the includes for androidfw under
a common base path for that library instead
of frameworks/base/includes.

Also fixes -Werror issues that resulted in
no longer being -isystem.

Test: builds
Change-Id: Ic4312eb61b197af114dded5691d5ae1ec82923f7
/frameworks/base/libs/androidfw/include/androidfw/ResourceTypes.h