OSDN Git Service

Fix script-related parts of locale resource matching
authorRoozbeh Pournader <roozbeh@google.com>
Thu, 3 Mar 2016 23:06:46 +0000 (15:06 -0800)
committerRoozbeh Pournader <roozbeh@google.com>
Thu, 3 Mar 2016 23:19:37 +0000 (15:19 -0800)
commit7960898f6f886aadda1dd3d7a89106dde9f44217
treea69917218d192b8050ffeb70b39e0cfaee75c32e
parentba5c35b79731e91edc4d452d5e6b49a8b5434a55
Fix script-related parts of locale resource matching

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
include/androidfw/ResourceTypes.h
libs/androidfw/ResourceTypes.cpp
libs/androidfw/tests/ConfigLocale_test.cpp
tools/aapt/AaptAssets.cpp
tools/aapt2/Locale.cpp