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

Commit f149b40b authored by Peng Xu's avatar Peng Xu
Browse files

Fix bug in isEquivalent()

Fix a bug in SensorService::SensorDirectConnection::isEquivalent()
that causes the check to unfairly judge two shared memory buffers.

Test: compiles
Change-Id: I8274b01f331dc958c8b0183aab32119f21a8c4ff
parent ecfa2566
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -189,13 +189,16 @@ bool SensorService::SensorDirectConnection::isEquivalent(const sensors_direct_me
                if (fstat(fd1, &s1) < 0 || fstat(fd2, &s2) < 0 || s1.st_ino == s2.st_ino) {
                    ret = true;
                }
                break;
            }
            case SENSOR_DIRECT_MEM_TYPE_GRALLOC:
                LOG_FATAL("%s: Implement GRALLOC or remove", __FUNCTION__);
                ret = true;
                break;
            default:
                ALOGE("Unexpected mem type %d", mMem.type);
                ret = true;
                break;
        }
    }
    return ret;