diff options
author | 2023-03-31 22:37:42 +0000 | |
---|---|---|
committer | 2023-05-04 17:43:00 +0000 | |
commit | c674d38c8cea475cd29f7b0835e9864a2424b646 (patch) | |
tree | de281494f9e9bcbebc736eee1c0e6eba1cb8b9a4 /tools/aapt2/ResourceValues.h | |
parent | e1e4129f4fd3fc78a4bd2f6fe1018b436022376d (diff) |
Add additional check on float precision after parsing, only compile the
value to a float when the difference between float and double parsed
from same raw string is smaller than 1.
Bug: b/69347762
Test: Verified affected atests pass and added new atest
Change-Id: I25da0baccba580484db39aa2d0a1bb765706635d
Diffstat (limited to 'tools/aapt2/ResourceValues.h')
-rw-r--r-- | tools/aapt2/ResourceValues.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/aapt2/ResourceValues.h b/tools/aapt2/ResourceValues.h index 6f9dccbd3bcc..5192c2be1f98 100644 --- a/tools/aapt2/ResourceValues.h +++ b/tools/aapt2/ResourceValues.h @@ -284,6 +284,7 @@ struct BinaryPrimitive : public TransformableItem<BinaryPrimitive, BaseItem<Bina bool Equals(const Value* value) const override; bool Flatten(android::Res_value* out_value) const override; void Print(std::ostream* out) const override; + static const char* DecideFormat(float f); void PrettyPrint(text::Printer* printer) const override; }; |