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

Commit 50cf7b37 authored by Anton Utkin's avatar Anton Utkin
Browse files

UEventObserver: Fix logging for uevent messages



Every uevent message in buffer contains '\0' characters
and only part of the message is displayed right now.
So, all '\0' characters should be replaced for correct
logging.

Test: checked uvent message in logcat

Change-Id: I5bcdf117208feae542f0d4619cb03eddbcfce32c
Signed-off-by: default avatarAnton Utkin <avutkin@sberdevices.ru>
parent 7e5966f0
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -71,7 +71,11 @@ static jstring nativeWaitForNextEvent(JNIEnv *env, jclass clazz) {
        }
        buffer[length] = '\0';

        ALOGV("Received uevent message: %s", buffer);
        IF_ALOGV() {
            std::string message(buffer, length);
            std::replace(message.begin(), message.end(), '\0', ' ');
            ALOGV("Received uevent message: %s", message.c_str());
        }

        if (isMatch(buffer, length)) {
            // Assume the message is ASCII.