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

Commit 74309160 authored by Spencer Low's avatar Spencer Low
Browse files

adb: call android::base::InitLogging even when adb tracing is disabled

This is a follow-up to https://android-review.googlesource.com/153623


which prevented android::base::InitLogging() from being called when
tracing was disabled.

It is ok to call InitLogging() on a device or host because calling it
does not imply that a logging file is used, which was the reason for
not calling it on a device.

So this change should preserve the device behavior of not using a
logging file when tracing is disabled, plus it will call InitLogging()
all the time in case logging APIs are called.

Change-Id: I3fd6ba2c567f67a2f111a85f174893fbf866ec57
Signed-off-by: default avatarSpencer Low <CompareAndSwap@gmail.com>
parent 7989a7c8
Loading
Loading
Loading
Loading
+5 −8
Original line number Diff line number Diff line
@@ -192,17 +192,14 @@ static void setup_trace_mask() {
}

void adb_trace_init(char** argv) {
#if !ADB_HOST
    // Don't open log file if no tracing, since this will block
    // the crypto unmount of /data
    const std::string trace_setting = get_trace_setting();
    if (trace_setting.empty()) {
        return;
    }

#if !ADB_HOST
    if (!get_trace_setting().empty()) {
        if (isatty(STDOUT_FILENO) == 0) {
            start_device_log();
        }
    }
#endif

    setup_trace_mask();