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

Commit c43a590a authored by Steven Moreland's avatar Steven Moreland
Browse files

IMemory: add unsecurePointer

pointer -> unsecurePointer has happened in internal master. In order for
AOSP clients to be able to use the new API, adding it here.

Test: code builds
Change-Id: Ie280f48b9c338bf667c5d83867b78fb4fef49264
Merged-In: If8474d0c6a2f0a23cb0514eac1a86c71e334fcc9
parent ed8f1294
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -149,6 +149,10 @@ void* IMemory::fastPointer(const sp<IBinder>& binder, ssize_t offset) const
    return static_cast<char*>(base) + offset;
}

void* IMemory::unsecurePointer() const {
    return pointer();
}

void* IMemory::pointer() const {
    ssize_t offset;
    sp<IMemoryHeap> heap = getMemory(&offset);
+2 −0
Original line number Diff line number Diff line
@@ -76,6 +76,8 @@ public:
    // NOLINTNEXTLINE(google-default-arguments)
    virtual sp<IMemoryHeap> getMemory(ssize_t* offset=nullptr, size_t* size=nullptr) const = 0;

    void* unsecurePointer() const;

    // helpers
    void* fastPointer(const sp<IBinder>& heap, ssize_t offset) const;
    void* pointer() const;