summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Elliott Hughes <enh@google.com> 2019-05-08 12:12:39 -0700
committer Elliott Hughes <enh@google.com> 2019-05-08 12:29:25 -0700
commit7a6cc0c006d76953760353c00048c8134c9ba294 (patch)
tree24b9044daa8f3a175cb975e4def9d7e04c13050e
parent5c47b52b93bc84521b8caa9e115ab415ed9f86ac (diff)
Track libziparchive API change.
Bug: http://b/129068177 Test: treehugger Change-Id: Id4b202502b07e08102deda49f7d28ba10a63bb0a
-rw-r--r--core/jni/android_util_jar_StrictJarFile.cpp12
-rw-r--r--libs/androidfw/ApkAssets.cpp3
-rw-r--r--libs/androidfw/ZipFileRO.cpp5
3 files changed, 4 insertions, 16 deletions
diff --git a/core/jni/android_util_jar_StrictJarFile.cpp b/core/jni/android_util_jar_StrictJarFile.cpp
index a26707eedb28..e33da9167e05 100644
--- a/core/jni/android_util_jar_StrictJarFile.cpp
+++ b/core/jni/android_util_jar_StrictJarFile.cpp
@@ -100,16 +100,8 @@ jlong StrictJarFile_nativeStartIteration(JNIEnv* env, jobject, jlong nativeHandl
}
IterationHandle* handle = new IterationHandle();
- int32_t error = 0;
- if (prefixChars.size() == 0) {
- error = StartIteration(reinterpret_cast<ZipArchiveHandle>(nativeHandle),
- handle->CookieAddress(), NULL, NULL);
- } else {
- ZipString entry_name(prefixChars.c_str());
- error = StartIteration(reinterpret_cast<ZipArchiveHandle>(nativeHandle),
- handle->CookieAddress(), &entry_name, NULL);
- }
-
+ int32_t error = StartIteration(reinterpret_cast<ZipArchiveHandle>(nativeHandle),
+ handle->CookieAddress(), prefixChars.c_str(), "");
if (error) {
throwIoException(env, error);
return static_cast<jlong>(-1);
diff --git a/libs/androidfw/ApkAssets.cpp b/libs/androidfw/ApkAssets.cpp
index 47b7d646d79f..7ba7828d71c4 100644
--- a/libs/androidfw/ApkAssets.cpp
+++ b/libs/androidfw/ApkAssets.cpp
@@ -206,9 +206,8 @@ bool ApkAssets::ForEachFile(const std::string& root_path,
root_path_full += '/';
}
- ::ZipString prefix(root_path_full.c_str());
void* cookie;
- if (::StartIteration(zip_handle_.get(), &cookie, &prefix, nullptr) != 0) {
+ if (::StartIteration(zip_handle_.get(), &cookie, root_path_full, "") != 0) {
return false;
}
diff --git a/libs/androidfw/ZipFileRO.cpp b/libs/androidfw/ZipFileRO.cpp
index 44614c11fb14..ee5f7783635d 100644
--- a/libs/androidfw/ZipFileRO.cpp
+++ b/libs/androidfw/ZipFileRO.cpp
@@ -149,11 +149,8 @@ bool ZipFileRO::startIteration(void** cookie) {
bool ZipFileRO::startIteration(void** cookie, const char* prefix, const char* suffix)
{
_ZipEntryRO* ze = new _ZipEntryRO;
- ZipString pe(prefix ? prefix : "");
- ZipString se(suffix ? suffix : "");
int32_t error = StartIteration(mHandle, &(ze->cookie),
- prefix ? &pe : NULL,
- suffix ? &se : NULL);
+ prefix ? prefix : "", suffix ? suffix : "");
if (error) {
ALOGW("Could not start iteration over %s: %s", mFileName != NULL ? mFileName : "<null>",
ErrorCodeString(error));