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

Commit 1ae07ba1 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Prevent cm from incrementing 0." am: abd9d6a2 am: b8bbe8e2 am:...

Merge "Prevent cm from incrementing 0." am: abd9d6a2 am: b8bbe8e2 am: 694d5143 am: 6c37fc6d am: d3d2e09e

Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2101750



Change-Id: Iea4021c8694d5b402f6921054f8074b593c0279c
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents ca3515f6 d3d2e09e
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -298,12 +298,17 @@ ProcessState::handle_entry* ProcessState::lookupHandleLocked(int32_t handle)
    return &mHandleToObject.editItemAt(handle);
}

// see b/166779391: cannot change the VNDK interface, so access like this
extern sp<BBinder> the_context_object;

sp<IBinder> ProcessState::getStrongProxyForHandle(int32_t handle)
{
    sp<IBinder> result;

    AutoMutex _l(mLock);

    if (handle == 0 && the_context_object != nullptr) return the_context_object;

    handle_entry* e = lookupHandleLocked(handle);

    if (e != nullptr) {
+6 −0
Original line number Diff line number Diff line
@@ -447,6 +447,12 @@ TEST_F(BinderLibTest, CannotUseBinderAfterFork) {
    EXPECT_DEATH({ ProcessState::self(); }, "libbinder ProcessState can not be used after fork");
}

TEST_F(BinderLibTest, AddManagerToManager) {
    sp<IServiceManager> sm = defaultServiceManager();
    sp<IBinder> binder = IInterface::asBinder(sm);
    EXPECT_EQ(NO_ERROR, sm->addService(String16("binderLibTest-manager"), binder));
}

TEST_F(BinderLibTest, WasParceled) {
    auto binder = sp<BBinder>::make();
    EXPECT_FALSE(binder->wasParceled());