Loading cmds/statsd/src/StatsService.cpp +12 −3 Original line number Diff line number Diff line Loading @@ -266,7 +266,9 @@ status_t StatsService::onTransact(uint32_t code, const Parcel& data, Parcel* rep IResultReceiver::asInterface(data.readStrongBinder()); err = command(in, out, err, args, resultReceiver); if (resultReceiver != nullptr) { resultReceiver->send(err); } return NO_ERROR; } default: { return BnStatsManager::onTransact(code, data, reply, flags); } Loading Loading @@ -411,13 +413,20 @@ status_t StatsService::command(int in, int out, int err, Vector<String8>& args, return cmd_trigger_active_config_broadcast(out, args); } if (!args[0].compare(String8("data-subscribe"))) { { std::lock_guard<std::mutex> lock(mShellSubscriberMutex); if (mShellSubscriber == nullptr) { mShellSubscriber = new ShellSubscriber(mUidMap, mPullerManager); } } int timeoutSec = -1; if (argCount >= 2) { timeoutSec = atoi(args[1].c_str()); } if (resultReceiver == nullptr) { ALOGI("Null resultReceiver given, no subscription will be started"); return UNEXPECTED_NULL; } mShellSubscriber->startNewSubscription(in, out, resultReceiver, timeoutSec); return NO_ERROR; } Loading cmds/statsd/src/StatsService.h +4 −0 Original line number Diff line number Diff line Loading @@ -432,6 +432,10 @@ private: sp<ShellSubscriber> mShellSubscriber; /** * Mutex for setting the shell subscriber */ mutable mutex mShellSubscriberMutex; std::shared_ptr<LogEventQueue> mEventQueue; FRIEND_TEST(StatsLogProcessorTest, TestActivationsPersistAcrossSystemServerRestart); Loading Loading
cmds/statsd/src/StatsService.cpp +12 −3 Original line number Diff line number Diff line Loading @@ -266,7 +266,9 @@ status_t StatsService::onTransact(uint32_t code, const Parcel& data, Parcel* rep IResultReceiver::asInterface(data.readStrongBinder()); err = command(in, out, err, args, resultReceiver); if (resultReceiver != nullptr) { resultReceiver->send(err); } return NO_ERROR; } default: { return BnStatsManager::onTransact(code, data, reply, flags); } Loading Loading @@ -411,13 +413,20 @@ status_t StatsService::command(int in, int out, int err, Vector<String8>& args, return cmd_trigger_active_config_broadcast(out, args); } if (!args[0].compare(String8("data-subscribe"))) { { std::lock_guard<std::mutex> lock(mShellSubscriberMutex); if (mShellSubscriber == nullptr) { mShellSubscriber = new ShellSubscriber(mUidMap, mPullerManager); } } int timeoutSec = -1; if (argCount >= 2) { timeoutSec = atoi(args[1].c_str()); } if (resultReceiver == nullptr) { ALOGI("Null resultReceiver given, no subscription will be started"); return UNEXPECTED_NULL; } mShellSubscriber->startNewSubscription(in, out, resultReceiver, timeoutSec); return NO_ERROR; } Loading
cmds/statsd/src/StatsService.h +4 −0 Original line number Diff line number Diff line Loading @@ -432,6 +432,10 @@ private: sp<ShellSubscriber> mShellSubscriber; /** * Mutex for setting the shell subscriber */ mutable mutex mShellSubscriberMutex; std::shared_ptr<LogEventQueue> mEventQueue; FRIEND_TEST(StatsLogProcessorTest, TestActivationsPersistAcrossSystemServerRestart); Loading