Adding ability to add configs via adb command-line. The input
must be in serialized binary format. Also fixes small issue
in build rule related to proto lib.
Test: Manually tested that ADB command works without crashing.
Change-Id: Iba2e677561ff500adb601a598f73e8a7b32540e5
diff --git a/cmds/statsd/src/StatsService.h b/cmds/statsd/src/StatsService.h
index 556b07b..ef52b562 100644
--- a/cmds/statsd/src/StatsService.h
+++ b/cmds/statsd/src/StatsService.h
@@ -17,9 +17,12 @@
#ifndef STATS_SERVICE_H
#define STATS_SERVICE_H
+#include "StatsLogProcessor.h"
+
#include <android/os/BnStatsManager.h>
#include <binder/IResultReceiver.h>
#include <binder/IShellCallback.h>
+#include <frameworks/base/cmds/statsd/src/statsd_config.pb.h>
#include <utils/Looper.h>
#include <deque>
@@ -30,7 +33,7 @@
using namespace android::binder;
using namespace android::os;
using namespace std;
-
+using android::os::statsd::StatsdConfig;
// ================================================================================
class StatsService : public BnStatsManager {
@@ -46,9 +49,13 @@
virtual Status systemRunning();
+ virtual status_t setProcessor(const sp<StatsLogProcessor>& main_processor);
+
private:
+ sp<StatsLogProcessor> m_processor; // Reference to the processor for updating configs.
status_t doPrintStatsLog(FILE* out, const Vector<String8>& args);
void printCmdHelp(FILE* out);
+ status_t doLoadConfig(FILE* in);
};
#endif // STATS_SERVICE_H