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

Commit 4dc844c5 authored by Kenny Root's avatar Kenny Root Committed by Android (Google) Code Review
Browse files

Merge "Use correct API version for UTF-8 checking"

parents 610f3890 c9f30880
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -162,10 +162,11 @@ public:
    void setPackageCount(int val) { mPackageCount = val; }
#endif

    /* UTF-8 is only available on APIs 7 or above or
     * SDK levels that have code names.
    /* Certain features may only be available on a specific SDK level or
     * above. SDK levels that have a non-numeric identifier are assumed
     * to be newer than any SDK level that has a number designated.
     */
    bool isUTF8Available() {
    bool isMinSdkAtLeast(int desired) {
        /* If the application specifies a minSdkVersion in the manifest
         * then use that. Otherwise, check what the user specified on
         * the command line. If neither, it's not available since
@@ -183,7 +184,7 @@ public:
        char *end;
        int minSdkNum = (int)strtol(minVer, &end, 0);
        if (*end == '\0') {
            if (minSdkNum < 7) {
            if (minSdkNum < desired) {
                return false;
            }
        }
+1 −1
Original line number Diff line number Diff line
@@ -775,7 +775,7 @@ status_t buildResources(Bundle* bundle, const sp<AaptAssets>& assets)
     * allow UTF-8 to be used.
     */
    if (!bundle->getWantUTF16()
            && bundle->isUTF8Available()) {
            && bundle->isMinSdkAtLeast(SDK_FROYO)) {
        xmlFlags |= XML_COMPILE_UTF8;
    }

+1 −1
Original line number Diff line number Diff line
@@ -2527,7 +2527,7 @@ status_t ResourceTable::flatten(Bundle* bundle, const sp<AaptFile>& dest)
    const size_t N = mOrderedPackages.size();
    size_t pi;

    bool useUTF8 = !bundle->getWantUTF16() && bundle->isUTF8Available();
    bool useUTF8 = !bundle->getWantUTF16() && bundle->isMinSdkAtLeast(SDK_FROYO);

    // Iterate through all data, collecting all values (strings,
    // references, etc).