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

Commit 60dcc008 authored by The Android Open Source Project's avatar The Android Open Source Project Committed by Alex Ray
Browse files

auto import from //branches/cupcake/...@130745

parent 13e4bed7
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -1131,10 +1131,8 @@ struct ResTable_config
                && orientation != settings.orientation) {
                return false;
            }
            if (settings.density != 0 && density != 0
                && density != settings.density) {
                return false;
            }
            // Density not taken into account, always match, no matter what
            // density is specified for the resource
            if (settings.touchscreen != 0 && touchscreen != 0
                && touchscreen != settings.touchscreen) {
                return false;
@@ -1464,11 +1462,11 @@ public:
     * @return ssize_t Either a >= 0 table index or a negative error code.
     */
    ssize_t getResource(uint32_t resID, Res_value* outValue, bool mayBeBag=false,
            uint32_t* outSpecFlags=NULL) const;
            uint32_t* outSpecFlags=NULL, ResTable_config* outConfig=NULL) const;

    inline ssize_t getResource(const ResTable_ref& res, Res_value* outValue,
            uint32_t* outSpecFlags=NULL) const {
        return getResource(res.ident, outValue, outSpecFlags);
        return getResource(res.ident, outValue, false, outSpecFlags, NULL);
    }

    ssize_t resolveReference(Res_value* inOutValue,
+10 −5
Original line number Diff line number Diff line
@@ -665,6 +665,11 @@ status_t Parcel::writeNativeHandle(const native_handle& handle)
    for (int i=0 ; err==NO_ERROR && i<handle.numFds ; i++)
        err = writeDupFileDescriptor(handle.data[i]);

    if (err != NO_ERROR) {
        LOGD("write native handle, write dup fd failed");
        return err;
    }

    err = write(handle.data + handle.numFds, sizeof(int)*handle.numInts);

    return err;
@@ -947,7 +952,7 @@ native_handle* Parcel::readNativeHandle(native_handle* (*alloc)(void*, int, int)
    }
    
    for (int i=0 ; err==NO_ERROR && i<numFds ; i++) {
        h->data[i] = readFileDescriptor();
        h->data[i] = dup(readFileDescriptor());
        if (h->data[i] < 0) err = BAD_VALUE;
    }
    
+6 −3
Original line number Diff line number Diff line
@@ -1736,7 +1736,7 @@ bool ResTable::getResourceName(uint32_t resID, resource_name* outName) const
}

ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag,
        uint32_t* outSpecFlags) const
        uint32_t* outSpecFlags, ResTable_config* outConfig) const
{
    if (mError != NO_ERROR) {
        return mError;
@@ -1834,6 +1834,9 @@ ssize_t ResTable::getResource(uint32_t resID, Res_value* outValue, bool mayBeBag
        outValue->res0 = bestValue->res0;
        outValue->dataType = bestValue->dataType;
        outValue->data = dtohl(bestValue->data);
        if (outConfig != NULL) {
            *outConfig = bestItem;
        }
        TABLE_NOISY(size_t len;
              printf("Found value: pkg=%d, type=%d, str=%s, int=%d\n",
                     bestPackage->header->index,
+3 −1
Original line number Diff line number Diff line
@@ -317,8 +317,10 @@ status_t String8::real_append(const char* other, size_t otherLen)
        ->editResize(myLen+otherLen+1);
    if (buf) {
        char* str = (char*)buf->data();
        memcpy(str+myLen, other, otherLen+1);
        mString = str;
        str += myLen;
        memcpy(str, other, otherLen);
        str[otherLen] = '\0';
        return NO_ERROR;
    }
    return NO_MEMORY;