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

Commit bfd9c008 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[SfStats] Temporarily enable timestats by default."

parents 7547b412 b3885adb
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -34,6 +34,14 @@ namespace android {

namespace impl {

TimeStats::TimeStats() {
    // Temporarily enable TimeStats by default. Telemetry is disabled while
    // we move onto statsd, so TimeStats is currently not exercised at all
    // during testing.
    // TODO: remove this.
    enable();
}

void TimeStats::parseArgs(bool asProto, const Vector<String16>& args, std::string& result) {
    ATRACE_CALL();

+1 −1
Original line number Diff line number Diff line
@@ -106,7 +106,7 @@ class TimeStats : public android::TimeStats {
    };

public:
    TimeStats() = default;
    TimeStats();

    void parseArgs(bool asProto, const Vector<String16>& args, std::string& result) override;
    bool isEnabled() override;
+4 −0
Original line number Diff line number Diff line
@@ -209,6 +209,10 @@ int32_t TimeStatsTest::genRandomInt32(int32_t begin, int32_t end) {
    return distr(mRandomEngine);
}

TEST_F(TimeStatsTest, enabledByDefault) {
    ASSERT_TRUE(mTimeStats->isEnabled());
}

TEST_F(TimeStatsTest, canEnableAndDisableTimeStats) {
    EXPECT_TRUE(inputCommand(InputCommand::ENABLE, FMT_STRING).empty());
    ASSERT_TRUE(mTimeStats->isEnabled());