summaryrefslogtreecommitdiff
path: root/libs/androidfw/tests/AttributeResolution_test.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2016-11-23 10:39:40 -0800
committerJohn Reck <jreck@google.com>2016-12-02 12:49:20 -0800
commitf32adf447511d54c2aa0948d3c1ef44d461538ac (patch)
tree20cff4b57e17bea6cf131cb3fa630e7320b300a0 /libs/androidfw/tests/AttributeResolution_test.cpp
parent0730df7369147a5f21ef95eef347361d9ad308b3 (diff)
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
Diffstat (limited to 'libs/androidfw/tests/AttributeResolution_test.cpp')
-rw-r--r--libs/androidfw/tests/AttributeResolution_test.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/androidfw/tests/AttributeResolution_test.cpp b/libs/androidfw/tests/AttributeResolution_test.cpp
index d6d7890882a8..3aac17838e2a 100644
--- a/libs/androidfw/tests/AttributeResolution_test.cpp
+++ b/libs/androidfw/tests/AttributeResolution_test.cpp
@@ -161,9 +161,9 @@ TEST_F(AttributeResolutionXmlTest, ThemeAndXmlParser) {
std::vector<uint32_t> values;
values.resize(arraysize(attrs) * 6);
- ASSERT_TRUE(ApplyStyle(&theme, &xml_parser_, 0 /*def_style_attr*/,
- 0 /*def_style_res*/, attrs, arraysize(attrs),
- values.data(), nullptr /*out_indices*/));
+ ApplyStyle(&theme, &xml_parser_, 0 /*def_style_attr*/,
+ 0 /*def_style_res*/, attrs, arraysize(attrs),
+ values.data(), nullptr /*out_indices*/);
const uint32_t public_flag = ResTable_typeSpec::SPEC_PUBLIC;