Add an API to release stats logger resources.
Test: tested with ag/5112579
Change-Id: I271b7574beab1baa9886d31bc1cf25c40c2fae23
Merged-In: I271b7574beab1baa9886d31bc1cf25c40c2fae23
(cherry picked from commit 5b63e2704a3d0dd23ff3ef9900639d5bb51aca61)
diff --git a/libstats/stats_event_list.c b/libstats/stats_event_list.c
index 51408e0..735088a 100644
--- a/libstats/stats_event_list.c
+++ b/libstats/stats_event_list.c
@@ -123,6 +123,14 @@
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)) {