summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Elliott Hughes <enh@google.com> 2019-08-08 09:36:14 -0700
committer Elliott Hughes <enh@google.com> 2019-08-08 09:36:14 -0700
commit1f7b854d7038daa16a1bd4c59b9bc80b1ea1dee3 (patch)
treeafa5fd3d26c64b9730661ce5b9ce32c8f14ca25e
parent8052fac1b134008efb33569d4523b8e06984a8fa (diff)
Use String8 for UTF16 to UTF8 conversion.
This is the only actual user of libcutils' jstring.h. Test: treehugger Change-Id: I0444d42e5a3ca57de3bffca48aa265f267c3d4dc
-rw-r--r--cmds/idmap/scan.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/cmds/idmap/scan.cpp b/cmds/idmap/scan.cpp
index d69dd79555a1..847dda3df91f 100644
--- a/cmds/idmap/scan.cpp
+++ b/cmds/idmap/scan.cpp
@@ -9,7 +9,6 @@
#include <androidfw/ResourceTypes.h>
#include <androidfw/StreamingZipInflater.h>
#include <androidfw/ZipFileRO.h>
-#include <cutils/jstring.h>
#include <cutils/properties.h>
#include <private/android_filesystem_config.h> // for AID_SYSTEM
#include <utils/SortedVector.h>
@@ -84,15 +83,9 @@ namespace {
}
bool check_property(String16 property, String16 value) {
- const char *prop;
- const char *val;
-
- prop = strndup16to8(property.string(), property.size());
char propBuf[PROPERTY_VALUE_MAX];
- property_get(prop, propBuf, NULL);
- val = strndup16to8(value.string(), value.size());
-
- return (strcmp(propBuf, val) == 0);
+ property_get(String8(property).c_str(), propBuf, NULL);
+ return String8(value) == propBuf;
}
int parse_overlay_tag(const ResXMLTree& parser, const char *target_package_name,