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

Commit 602d292c authored by Yao Chen's avatar Yao Chen
Browse files

Add an API to release stats logger resources.

Test: tested with ag/5112579
Change-Id: I271b7574beab1baa9886d31bc1cf25c40c2fae23
Merged-In: I271b7574beab1baa9886d31bc1cf25c40c2fae23
(cherry picked from commit 5b63e270)
parent 6301054b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ extern "C" {
void reset_log_context(android_log_context ctx);
int write_to_logger(android_log_context context, log_id_t id);
void note_log_drop();
void stats_log_close();

#ifdef __cplusplus
}
+8 −0
Original line number Diff line number Diff line
@@ -123,6 +123,14 @@ void note_log_drop() {
    statsdLoggerWrite.noteDrop();
}

void stats_log_close() {
    statsd_writer_init_lock();
    if (statsdLoggerWrite.close) {
        (*statsdLoggerWrite.close)();
    }
    statsd_writer_init_unlock();
}

/* log_init_lock assumed */
static int __write_to_statsd_initialize_locked() {
    if (!statsdLoggerWrite.open || ((*statsdLoggerWrite.open)() < 0)) {