Loading opengl/libs/EGL/egl_angle_platform.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -129,8 +129,8 @@ bool initializeAnglePlatform(EGLDisplay dpy) { return false; return false; } } angleResetDisplayPlatform = reinterpret_cast<ResetDisplayPlatformFunc>( angleResetDisplayPlatform = eglGetProcAddress("ANGLEResetDisplayPlatform")); reinterpret_cast<ResetDisplayPlatformFunc>(dlsym(so, "ANGLEResetDisplayPlatform")); PlatformMethods* platformMethods = nullptr; PlatformMethods* platformMethods = nullptr; if (!((angleGetDisplayPlatform)(dpy, g_PlatformMethodNames, g_NumPlatformMethods, nullptr, if (!((angleGetDisplayPlatform)(dpy, g_PlatformMethodNames, g_NumPlatformMethods, nullptr, Loading services/inputflinger/dispatcher/InputDispatcher.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1439,7 +1439,7 @@ void InputDispatcher::dispatchSensorLocked(nsecs_t currentTime, std::shared_ptr< ALOGD("notifySensorEvent eventTime=%" PRId64 ", hwTimestamp=%" PRId64 ", deviceId=%d, " ALOGD("notifySensorEvent eventTime=%" PRId64 ", hwTimestamp=%" PRId64 ", deviceId=%d, " "source=0x%x, sensorType=%s", "source=0x%x, sensorType=%s", entry->eventTime, entry->hwTimestamp, entry->deviceId, entry->source, entry->eventTime, entry->hwTimestamp, entry->deviceId, entry->source, NamedEnum::string(sensorType).c_str()); NamedEnum::string(entry->sensorType).c_str()); #endif #endif std::unique_ptr<CommandEntry> commandEntry = std::unique_ptr<CommandEntry> commandEntry = std::make_unique<CommandEntry>(&InputDispatcher::doNotifySensorLockedInterruptible); std::make_unique<CommandEntry>(&InputDispatcher::doNotifySensorLockedInterruptible); Loading services/inputflinger/reader/EventHub.cpp +17 −8 Original line number Original line Diff line number Diff line Loading @@ -1771,7 +1771,17 @@ void EventHub::unregisterVideoDeviceFromEpollLocked(const TouchVideoDevice& vide } } } } status_t EventHub::openDeviceLocked(const std::string& devicePath) { void EventHub::openDeviceLocked(const std::string& devicePath) { // If an input device happens to register around the time when EventHub's constructor runs, it // is possible that the same input event node (for example, /dev/input/event3) will be noticed // in both 'inotify' callback and also in the 'scanDirLocked' pass. To prevent duplicate devices // from getting registered, ensure that this path is not already covered by an existing device. for (const auto& [deviceId, device] : mDevices) { if (device->path == devicePath) { return; // device was already registered } } char buffer[80]; char buffer[80]; ALOGV("Opening device: %s", devicePath.c_str()); ALOGV("Opening device: %s", devicePath.c_str()); Loading @@ -1779,7 +1789,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { int fd = open(devicePath.c_str(), O_RDWR | O_CLOEXEC | O_NONBLOCK); int fd = open(devicePath.c_str(), O_RDWR | O_CLOEXEC | O_NONBLOCK); if (fd < 0) { if (fd < 0) { ALOGE("could not open %s, %s\n", devicePath.c_str(), strerror(errno)); ALOGE("could not open %s, %s\n", devicePath.c_str(), strerror(errno)); return -1; return; } } InputDeviceIdentifier identifier; InputDeviceIdentifier identifier; Loading @@ -1798,7 +1808,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { if (identifier.name == item) { if (identifier.name == item) { ALOGI("ignoring event id %s driver %s\n", devicePath.c_str(), item.c_str()); ALOGI("ignoring event id %s driver %s\n", devicePath.c_str(), item.c_str()); close(fd); close(fd); return -1; return; } } } } Loading @@ -1807,7 +1817,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { if (ioctl(fd, EVIOCGVERSION, &driverVersion)) { if (ioctl(fd, EVIOCGVERSION, &driverVersion)) { ALOGE("could not get driver version for %s, %s\n", devicePath.c_str(), strerror(errno)); ALOGE("could not get driver version for %s, %s\n", devicePath.c_str(), strerror(errno)); close(fd); close(fd); return -1; return; } } // Get device identifier. // Get device identifier. Loading @@ -1815,7 +1825,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { if (ioctl(fd, EVIOCGID, &inputId)) { if (ioctl(fd, EVIOCGID, &inputId)) { ALOGE("could not get device input id for %s, %s\n", devicePath.c_str(), strerror(errno)); ALOGE("could not get device input id for %s, %s\n", devicePath.c_str(), strerror(errno)); close(fd); close(fd); return -1; return; } } identifier.bus = inputId.bustype; identifier.bus = inputId.bustype; identifier.product = inputId.product; identifier.product = inputId.product; Loading Loading @@ -2013,7 +2023,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { if (device->classes == Flags<InputDeviceClass>(0)) { if (device->classes == Flags<InputDeviceClass>(0)) { ALOGV("Dropping device: id=%d, path='%s', name='%s'", deviceId, devicePath.c_str(), ALOGV("Dropping device: id=%d, path='%s', name='%s'", deviceId, devicePath.c_str(), device->identifier.name.c_str()); device->identifier.name.c_str()); return -1; return; } } // Classify InputDeviceClass::BATTERY. // Classify InputDeviceClass::BATTERY. Loading Loading @@ -2043,7 +2053,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { } } if (registerDeviceForEpollLocked(*device) != OK) { if (registerDeviceForEpollLocked(*device) != OK) { return -1; return; } } device->configureFd(); device->configureFd(); Loading @@ -2056,7 +2066,6 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { toString(mBuiltInKeyboardId == deviceId)); toString(mBuiltInKeyboardId == deviceId)); addDeviceLocked(std::move(device)); addDeviceLocked(std::move(device)); return OK; } } void EventHub::openVideoDeviceLocked(const std::string& devicePath) { void EventHub::openVideoDeviceLocked(const std::string& devicePath) { Loading services/inputflinger/reader/include/EventHub.h +4 −1 Original line number Original line Diff line number Diff line Loading @@ -567,7 +567,10 @@ private: bool configureLightsLocked(); bool configureLightsLocked(); }; }; status_t openDeviceLocked(const std::string& devicePath); /** * Create a new device for the provided path. */ void openDeviceLocked(const std::string& devicePath); void openVideoDeviceLocked(const std::string& devicePath); void openVideoDeviceLocked(const std::string& devicePath); /** /** * Try to associate a video device with an input device. If the association succeeds, * Try to associate a video device with an input device. If the association succeeds, Loading services/surfaceflinger/BufferLayer.cpp +0 −6 Original line number Original line Diff line number Diff line Loading @@ -414,12 +414,6 @@ bool BufferLayer::shouldPresentNow(nsecs_t expectedPresentTime) const { return true; return true; } } // If the next planned present time is not current, return and try again later if (frameIsEarly(expectedPresentTime)) { ATRACE_NAME("frameIsEarly()"); return false; } // If this layer doesn't have a frame is shouldn't be presented // If this layer doesn't have a frame is shouldn't be presented if (!hasFrameUpdate()) { if (!hasFrameUpdate()) { return false; return false; Loading Loading
opengl/libs/EGL/egl_angle_platform.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -129,8 +129,8 @@ bool initializeAnglePlatform(EGLDisplay dpy) { return false; return false; } } angleResetDisplayPlatform = reinterpret_cast<ResetDisplayPlatformFunc>( angleResetDisplayPlatform = eglGetProcAddress("ANGLEResetDisplayPlatform")); reinterpret_cast<ResetDisplayPlatformFunc>(dlsym(so, "ANGLEResetDisplayPlatform")); PlatformMethods* platformMethods = nullptr; PlatformMethods* platformMethods = nullptr; if (!((angleGetDisplayPlatform)(dpy, g_PlatformMethodNames, g_NumPlatformMethods, nullptr, if (!((angleGetDisplayPlatform)(dpy, g_PlatformMethodNames, g_NumPlatformMethods, nullptr, Loading
services/inputflinger/dispatcher/InputDispatcher.cpp +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1439,7 +1439,7 @@ void InputDispatcher::dispatchSensorLocked(nsecs_t currentTime, std::shared_ptr< ALOGD("notifySensorEvent eventTime=%" PRId64 ", hwTimestamp=%" PRId64 ", deviceId=%d, " ALOGD("notifySensorEvent eventTime=%" PRId64 ", hwTimestamp=%" PRId64 ", deviceId=%d, " "source=0x%x, sensorType=%s", "source=0x%x, sensorType=%s", entry->eventTime, entry->hwTimestamp, entry->deviceId, entry->source, entry->eventTime, entry->hwTimestamp, entry->deviceId, entry->source, NamedEnum::string(sensorType).c_str()); NamedEnum::string(entry->sensorType).c_str()); #endif #endif std::unique_ptr<CommandEntry> commandEntry = std::unique_ptr<CommandEntry> commandEntry = std::make_unique<CommandEntry>(&InputDispatcher::doNotifySensorLockedInterruptible); std::make_unique<CommandEntry>(&InputDispatcher::doNotifySensorLockedInterruptible); Loading
services/inputflinger/reader/EventHub.cpp +17 −8 Original line number Original line Diff line number Diff line Loading @@ -1771,7 +1771,17 @@ void EventHub::unregisterVideoDeviceFromEpollLocked(const TouchVideoDevice& vide } } } } status_t EventHub::openDeviceLocked(const std::string& devicePath) { void EventHub::openDeviceLocked(const std::string& devicePath) { // If an input device happens to register around the time when EventHub's constructor runs, it // is possible that the same input event node (for example, /dev/input/event3) will be noticed // in both 'inotify' callback and also in the 'scanDirLocked' pass. To prevent duplicate devices // from getting registered, ensure that this path is not already covered by an existing device. for (const auto& [deviceId, device] : mDevices) { if (device->path == devicePath) { return; // device was already registered } } char buffer[80]; char buffer[80]; ALOGV("Opening device: %s", devicePath.c_str()); ALOGV("Opening device: %s", devicePath.c_str()); Loading @@ -1779,7 +1789,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { int fd = open(devicePath.c_str(), O_RDWR | O_CLOEXEC | O_NONBLOCK); int fd = open(devicePath.c_str(), O_RDWR | O_CLOEXEC | O_NONBLOCK); if (fd < 0) { if (fd < 0) { ALOGE("could not open %s, %s\n", devicePath.c_str(), strerror(errno)); ALOGE("could not open %s, %s\n", devicePath.c_str(), strerror(errno)); return -1; return; } } InputDeviceIdentifier identifier; InputDeviceIdentifier identifier; Loading @@ -1798,7 +1808,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { if (identifier.name == item) { if (identifier.name == item) { ALOGI("ignoring event id %s driver %s\n", devicePath.c_str(), item.c_str()); ALOGI("ignoring event id %s driver %s\n", devicePath.c_str(), item.c_str()); close(fd); close(fd); return -1; return; } } } } Loading @@ -1807,7 +1817,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { if (ioctl(fd, EVIOCGVERSION, &driverVersion)) { if (ioctl(fd, EVIOCGVERSION, &driverVersion)) { ALOGE("could not get driver version for %s, %s\n", devicePath.c_str(), strerror(errno)); ALOGE("could not get driver version for %s, %s\n", devicePath.c_str(), strerror(errno)); close(fd); close(fd); return -1; return; } } // Get device identifier. // Get device identifier. Loading @@ -1815,7 +1825,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { if (ioctl(fd, EVIOCGID, &inputId)) { if (ioctl(fd, EVIOCGID, &inputId)) { ALOGE("could not get device input id for %s, %s\n", devicePath.c_str(), strerror(errno)); ALOGE("could not get device input id for %s, %s\n", devicePath.c_str(), strerror(errno)); close(fd); close(fd); return -1; return; } } identifier.bus = inputId.bustype; identifier.bus = inputId.bustype; identifier.product = inputId.product; identifier.product = inputId.product; Loading Loading @@ -2013,7 +2023,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { if (device->classes == Flags<InputDeviceClass>(0)) { if (device->classes == Flags<InputDeviceClass>(0)) { ALOGV("Dropping device: id=%d, path='%s', name='%s'", deviceId, devicePath.c_str(), ALOGV("Dropping device: id=%d, path='%s', name='%s'", deviceId, devicePath.c_str(), device->identifier.name.c_str()); device->identifier.name.c_str()); return -1; return; } } // Classify InputDeviceClass::BATTERY. // Classify InputDeviceClass::BATTERY. Loading Loading @@ -2043,7 +2053,7 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { } } if (registerDeviceForEpollLocked(*device) != OK) { if (registerDeviceForEpollLocked(*device) != OK) { return -1; return; } } device->configureFd(); device->configureFd(); Loading @@ -2056,7 +2066,6 @@ status_t EventHub::openDeviceLocked(const std::string& devicePath) { toString(mBuiltInKeyboardId == deviceId)); toString(mBuiltInKeyboardId == deviceId)); addDeviceLocked(std::move(device)); addDeviceLocked(std::move(device)); return OK; } } void EventHub::openVideoDeviceLocked(const std::string& devicePath) { void EventHub::openVideoDeviceLocked(const std::string& devicePath) { Loading
services/inputflinger/reader/include/EventHub.h +4 −1 Original line number Original line Diff line number Diff line Loading @@ -567,7 +567,10 @@ private: bool configureLightsLocked(); bool configureLightsLocked(); }; }; status_t openDeviceLocked(const std::string& devicePath); /** * Create a new device for the provided path. */ void openDeviceLocked(const std::string& devicePath); void openVideoDeviceLocked(const std::string& devicePath); void openVideoDeviceLocked(const std::string& devicePath); /** /** * Try to associate a video device with an input device. If the association succeeds, * Try to associate a video device with an input device. If the association succeeds, Loading
services/surfaceflinger/BufferLayer.cpp +0 −6 Original line number Original line Diff line number Diff line Loading @@ -414,12 +414,6 @@ bool BufferLayer::shouldPresentNow(nsecs_t expectedPresentTime) const { return true; return true; } } // If the next planned present time is not current, return and try again later if (frameIsEarly(expectedPresentTime)) { ATRACE_NAME("frameIsEarly()"); return false; } // If this layer doesn't have a frame is shouldn't be presented // If this layer doesn't have a frame is shouldn't be presented if (!hasFrameUpdate()) { if (!hasFrameUpdate()) { return false; return false; Loading