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

Commit 9adf84a4 authored by The Android Open Source Project's avatar The Android Open Source Project
Browse files

auto import from //depot/cupcake/@136594

parent edbf3b6a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ namespace android {

class ICameraService : public IInterface
{
protected:
public:
    enum {
        CONNECT = IBinder::FIRST_CALL_TRANSACTION,
    };
+0 −35
Original line number Diff line number Diff line
@@ -248,41 +248,6 @@ private:
};


/*
 * Read/write lock.  The resource can have multiple readers or one writer,
 * but can't be read and written at the same time.
 *
 * The same thread should not call a lock function while it already has
 * a lock.  (Should be okay for multiple readers.)
 */
class ReadWriteLock {
public:
    ReadWriteLock()
        : mNumReaders(0), mNumWriters(0)
        {}
    ~ReadWriteLock() {}

    void lockForRead();
    bool tryLockForRead();
    void unlockForRead();

    void lockForWrite();
    bool tryLockForWrite();
    void unlockForWrite();

private:
    int         mNumReaders;
    int         mNumWriters;

    Mutex       mLock;
    Condition   mReadWaiter;
    Condition   mWriteWaiter;
#if defined(PRINT_RENDER_TIMES)
    DurationTimer mDebugTimer;
#endif
};


/*
 * This is our spiffy thread object!
 */
+19 −6
Original line number Diff line number Diff line
@@ -120,13 +120,18 @@ class MapInfo {
        char name[];
    };

    const char *map_to_name(uint64_t pc, const char* def) {
    const char *map_to_name(uint64_t pc, const char* def, uint64_t* start) {
        mapinfo* mi = getMapInfoList();
        while(mi) {
            if ((pc >= mi->start) && (pc < mi->end))
            if ((pc >= mi->start) && (pc < mi->end)) {
                if (start) 
                    *start = mi->start;
                return mi->name;
            }
            mi = mi->next;
        }
        if (start) 
            *start = 0;
        return def;
    }

@@ -183,8 +188,15 @@ public:
        }
    }
    
    static const char *mapAddressToName(const void* pc, const char* def) {
        return sMapInfo.map_to_name((uint64_t)pc, def);
    static const char *mapAddressToName(const void* pc, const char* def,
            void const** start) 
    {
        uint64_t s;
        char const* name = sMapInfo.map_to_name(uint64_t(uintptr_t(pc)), def, &s);
        if (start) {
            *start = (void*)s;
        }
        return name;
    }

};
@@ -297,8 +309,9 @@ String8 CallStack::toStringSingleLevel(const char* prefix, int32_t level) const
        res.append(name);
        res.append(tmp2);
    } else { 
        name = MapInfo::mapAddressToName(ip, "<unknown>");
        snprintf(tmp, 256, "pc %p  %s", ip, name);
        void const* start = 0;
        name = MapInfo::mapAddressToName(ip, "<unknown>", &start);
        snprintf(tmp, 256, "pc %08lx  %s", uintptr_t(ip)-uintptr_t(start), name);
        res.append(tmp);
    }
    res.append("\n");
+8 −6
Original line number Diff line number Diff line
@@ -176,7 +176,9 @@ size_t Res_png_9patch::serializedSize()

void* Res_png_9patch::serialize()
{
    void* newData = malloc(serializedSize());
    // Use calloc since we're going to leave a few holes in the data
    // and want this to run cleanly under valgrind
    void* newData = calloc(1, serializedSize());
    serialize(newData);
    return newData;
}
@@ -3150,7 +3152,7 @@ bool ResTable::stringToValue(Res_value* outValue, String16* outString,
            const char16_t* pos = s;
            while (pos < end && !failed) {
                const char16_t* start = pos;
                end++;
                pos++;
                while (pos < end && *pos != '|') {
                    pos++;
                }
+1 −1
Original line number Diff line number Diff line
@@ -388,7 +388,7 @@ status_t String16::setTo(const char16_t* other, size_t len)
        ->editResize((len+1)*sizeof(char16_t));
    if (buf) {
        char16_t* str = (char16_t*)buf->data();
        memcpy(str, other, len*sizeof(char16_t));
        memmove(str, other, len*sizeof(char16_t));
        str[len] = 0;
        mString = str;
        return NO_ERROR;
Loading