Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dc2cfc8a authored by Pawan Wagh's avatar Pawan Wagh Committed by Gerrit Code Review
Browse files

Merge changes from topic "unify_getentryinfo" into main

* changes:
  Fix usage of ZipFileRO::getEntryInfo
  Fix usage of ZipFileRO::getEntryInfo
  Combine ZipFileRO::getEntryInfo
parents 5d9d2631 429a1d59
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1335,7 +1335,8 @@ bool BootAnimation::preloadZip(Animation& animation) {
                if (path.string() == animation.parts[j].path.c_str()) {
                    uint16_t method;
                    // supports only stored png files
                    if (zip->getEntryInfo(entry, &method, nullptr, nullptr, nullptr, nullptr, nullptr)) {
                    if (zip->getEntryInfo(entry, &method, nullptr, nullptr, nullptr, nullptr,
                            nullptr, nullptr)) {
                        if (method == ZipFileRO::kCompressStored) {
                            FileMap* map = zip->createEntryFileMap(entry);
                            if (map) {
+2 −1
Original line number Diff line number Diff line
@@ -115,7 +115,8 @@ sumFiles(JNIEnv*, void* arg, ZipFileRO* zipFile, ZipEntryRO zipEntry, const char
    size_t* total = (size_t*) arg;
    uint32_t uncompLen;

    if (!zipFile->getEntryInfo(zipEntry, nullptr, &uncompLen, nullptr, nullptr, nullptr, nullptr)) {
    if (!zipFile->getEntryInfo(zipEntry, nullptr, &uncompLen, nullptr, nullptr, nullptr, nullptr,
                               nullptr)) {
        return INSTALL_FAILED_INVALID_APK;
    }

+2 −2
Original line number Diff line number Diff line
@@ -926,8 +926,8 @@ Asset* AssetManager::openAssetFromZipLocked(const ZipFileRO* pZipFile,

    //printf("USING Zip '%s'\n", pEntry->getFileName());

    if (!pZipFile->getEntryInfo(entry, &method, &uncompressedLen, NULL, NULL,
            NULL, NULL))
    if (!pZipFile->getEntryInfo(entry, &method, &uncompressedLen, nullptr, nullptr,
            nullptr, nullptr, nullptr))
    {
        ALOGW("getEntryInfo failed\n");
        return NULL;
+0 −8
Original line number Diff line number Diff line
@@ -118,14 +118,6 @@ ZipEntryRO ZipFileRO::findEntryByName(const char* entryName) const
 * Returns "false" if the offsets to the fields or the contents of the fields
 * appear to be bogus.
 */
bool ZipFileRO::getEntryInfo(ZipEntryRO entry, uint16_t* pMethod,
 uint32_t* pUncompLen, uint32_t* pCompLen, off64_t* pOffset,
 uint32_t* pModWhen, uint32_t* pCrc32) const
{
     return getEntryInfo(entry, pMethod, pUncompLen, pCompLen, pOffset, pModWhen,
      pCrc32, nullptr);
}

bool ZipFileRO::getEntryInfo(ZipEntryRO entry, uint16_t* pMethod,
    uint32_t* pUncompLen, uint32_t* pCompLen, off64_t* pOffset,
    uint32_t* pModWhen, uint32_t* pCrc32, uint16_t* pExtraFieldSize) const
+0 −4
Original line number Diff line number Diff line
@@ -147,10 +147,6 @@ public:
     * Returns "false" if "entry" is bogus or if the data in the Zip file
     * appears to be bad.
     */
    bool getEntryInfo(ZipEntryRO entry, uint16_t* pMethod, uint32_t* pUncompLen,
        uint32_t* pCompLen, off64_t* pOffset, uint32_t* pModWhen,
        uint32_t* pCrc32) const;

    bool getEntryInfo(ZipEntryRO entry, uint16_t* pMethod,
        uint32_t* pUncompLen, uint32_t* pCompLen, off64_t* pOffset,
        uint32_t* pModWhen, uint32_t* pCrc32, uint16_t* pExtraFieldSize) const;