OSDN Git Service

fix subsystem sleep state to use correct puller
authorChenjie Yu <cjyu@google.com>
Thu, 8 Feb 2018 22:33:37 +0000 (14:33 -0800)
committerChenjie Yu <cjyu@google.com>
Thu, 8 Feb 2018 22:36:49 +0000 (14:36 -0800)
Test: cts test
Change-Id: Iacac0c0fa69de6da818d3788b7499e09e46c8393
Fix: 73128324

cmds/statsd/src/external/StatsPullerManagerImpl.cpp

index 0b772b3..754f813 100644 (file)
@@ -48,116 +48,73 @@ namespace os {
 namespace statsd {
 
 const std::map<int, PullAtomInfo> StatsPullerManagerImpl::kAllPullAtomInfo = {
-    // wifi_bytes_transfer
-    {android::util::WIFI_BYTES_TRANSFER,
-     {{2, 3, 4, 5},
-      {},
-      1,
-      new StatsCompanionServicePuller(android::util::WIFI_BYTES_TRANSFER)}},
-    // wifi_bytes_transfer_by_fg_bg
-    {android::util::WIFI_BYTES_TRANSFER_BY_FG_BG,
-     {{3, 4, 5, 6},
-      {2},
-      1,
-      new StatsCompanionServicePuller(
-          android::util::WIFI_BYTES_TRANSFER_BY_FG_BG)}},
-    // mobile_bytes_transfer
-    {android::util::MOBILE_BYTES_TRANSFER,
-     {{2, 3, 4, 5},
-      {},
-      1,
-      new StatsCompanionServicePuller(android::util::MOBILE_BYTES_TRANSFER)}},
-    // mobile_bytes_transfer_by_fg_bg
-    {android::util::MOBILE_BYTES_TRANSFER_BY_FG_BG,
-     {{3, 4, 5, 6},
-      {2},
-      1,
-      new StatsCompanionServicePuller(
-          android::util::MOBILE_BYTES_TRANSFER_BY_FG_BG)}},
-    // bluetooth_bytes_transfer
-    {android::util::BLUETOOTH_BYTES_TRANSFER,
-     {{2, 3},
-      {},
-      1,
-      new StatsCompanionServicePuller(
-          android::util::BLUETOOTH_BYTES_TRANSFER)}},
-    // kernel_wakelock
-    {android::util::KERNEL_WAKELOCK,
-     {{},
-      {},
-      1,
-      new StatsCompanionServicePuller(android::util::KERNEL_WAKELOCK)}},
-    // subsystem_sleep_state
-    {android::util::SUBSYSTEM_SLEEP_STATE,
-     {{},
-      {},
-      1,
-      new StatsCompanionServicePuller(android::util::SUBSYSTEM_SLEEP_STATE)}},
-    // cpu_time_per_freq
-    {android::util::CPU_TIME_PER_FREQ,
-     {{3},
-      {2},
-      1,
-      new StatsCompanionServicePuller(android::util::CPU_TIME_PER_FREQ)}},
-    // cpu_time_per_uid
-    {android::util::CPU_TIME_PER_UID,
-     {{2, 3}, {}, 1, new CpuTimePerUidPuller()}},
-    // cpu_time_per_uid_freq
-    {android::util::CPU_TIME_PER_UID_FREQ,
-     {{3}, {2}, 1, new CpuTimePerUidFreqPuller()}},
-    // wifi_activity_energy_info
-    {android::util::WIFI_ACTIVITY_ENERGY_INFO,
-     {{},
-      {},
-      1,
-      new StatsCompanionServicePuller(
-          android::util::WIFI_ACTIVITY_ENERGY_INFO)}},
-    // modem_activity_info
-    {android::util::MODEM_ACTIVITY_INFO,
-     {{},
-      {},
-      1,
-      new StatsCompanionServicePuller(android::util::MODEM_ACTIVITY_INFO)}},
-    // bluetooth_activity_info
-    {android::util::BLUETOOTH_ACTIVITY_INFO,
-     {{},
-      {},
-      1,
-      new StatsCompanionServicePuller(android::util::BLUETOOTH_ACTIVITY_INFO)}},
-    // system_elapsed_realtime
-    {android::util::SYSTEM_ELAPSED_REALTIME,
-     {{},
-      {},
-      1,
-      new StatsCompanionServicePuller(android::util::SYSTEM_ELAPSED_REALTIME)}},
-    // system_uptime
-    {android::util::SYSTEM_UPTIME,
-     {{},
-      {},
-      1,
-      new StatsCompanionServicePuller(android::util::SYSTEM_UPTIME)}},
-    // cpu_active_time
-    {android::util::CPU_ACTIVE_TIME,
-     {{3}, {2}, 1, new KernelUidCpuActiveTimeReader()}},
-    // cpu_cluster_time
-    {android::util::CPU_CLUSTER_TIME,
-     {{3}, {2}, 1, new KernelUidCpuClusterTimeReader()}},
-    // disk_space
-    {android::util::DISK_SPACE,
-     {{}, {}, 1, new StatsCompanionServicePuller(android::util::DISK_SPACE)}},
-    // remaining_battery_capacity
-    {android::util::REMAINING_BATTERY_CAPACITY,
-     {{},
-      {},
-      1,
-      new ResourceHealthManagerPuller(
-          android::util::REMAINING_BATTERY_CAPACITY)}},
-    // full_battery_capacity
-    {android::util::FULL_BATTERY_CAPACITY,
-     {{},
-      {},
-      1,
-      new ResourceHealthManagerPuller(android::util::FULL_BATTERY_CAPACITY)}}};
+        // wifi_bytes_transfer
+        {android::util::WIFI_BYTES_TRANSFER,
+         {{2, 3, 4, 5},
+          {},
+          1,
+          new StatsCompanionServicePuller(android::util::WIFI_BYTES_TRANSFER)}},
+        // wifi_bytes_transfer_by_fg_bg
+        {android::util::WIFI_BYTES_TRANSFER_BY_FG_BG,
+         {{3, 4, 5, 6},
+          {2},
+          1,
+          new StatsCompanionServicePuller(android::util::WIFI_BYTES_TRANSFER_BY_FG_BG)}},
+        // mobile_bytes_transfer
+        {android::util::MOBILE_BYTES_TRANSFER,
+         {{2, 3, 4, 5},
+          {},
+          1,
+          new StatsCompanionServicePuller(android::util::MOBILE_BYTES_TRANSFER)}},
+        // mobile_bytes_transfer_by_fg_bg
+        {android::util::MOBILE_BYTES_TRANSFER_BY_FG_BG,
+         {{3, 4, 5, 6},
+          {2},
+          1,
+          new StatsCompanionServicePuller(android::util::MOBILE_BYTES_TRANSFER_BY_FG_BG)}},
+        // bluetooth_bytes_transfer
+        {android::util::BLUETOOTH_BYTES_TRANSFER,
+         {{2, 3}, {}, 1, new StatsCompanionServicePuller(android::util::BLUETOOTH_BYTES_TRANSFER)}},
+        // kernel_wakelock
+        {android::util::KERNEL_WAKELOCK,
+         {{}, {}, 1, new StatsCompanionServicePuller(android::util::KERNEL_WAKELOCK)}},
+        // subsystem_sleep_state
+        {android::util::SUBSYSTEM_SLEEP_STATE, {{}, {}, 1, new SubsystemSleepStatePuller()}},
+        // cpu_time_per_freq
+        {android::util::CPU_TIME_PER_FREQ,
+         {{3}, {2}, 1, new StatsCompanionServicePuller(android::util::CPU_TIME_PER_FREQ)}},
+        // cpu_time_per_uid
+        {android::util::CPU_TIME_PER_UID, {{2, 3}, {}, 1, new CpuTimePerUidPuller()}},
+        // cpu_time_per_uid_freq
+        {android::util::CPU_TIME_PER_UID_FREQ, {{3}, {2}, 1, new CpuTimePerUidFreqPuller()}},
+        // wifi_activity_energy_info
+        {android::util::WIFI_ACTIVITY_ENERGY_INFO,
+         {{}, {}, 1, new StatsCompanionServicePuller(android::util::WIFI_ACTIVITY_ENERGY_INFO)}},
+        // modem_activity_info
+        {android::util::MODEM_ACTIVITY_INFO,
+         {{}, {}, 1, new StatsCompanionServicePuller(android::util::MODEM_ACTIVITY_INFO)}},
+        // bluetooth_activity_info
+        {android::util::BLUETOOTH_ACTIVITY_INFO,
+         {{}, {}, 1, new StatsCompanionServicePuller(android::util::BLUETOOTH_ACTIVITY_INFO)}},
+        // system_elapsed_realtime
+        {android::util::SYSTEM_ELAPSED_REALTIME,
+         {{}, {}, 1, new StatsCompanionServicePuller(android::util::SYSTEM_ELAPSED_REALTIME)}},
+        // system_uptime
+        {android::util::SYSTEM_UPTIME,
+         {{}, {}, 1, new StatsCompanionServicePuller(android::util::SYSTEM_UPTIME)}},
+        // cpu_active_time
+        {android::util::CPU_ACTIVE_TIME, {{3}, {2}, 1, new KernelUidCpuActiveTimeReader()}},
+        // cpu_cluster_time
+        {android::util::CPU_CLUSTER_TIME, {{3}, {2}, 1, new KernelUidCpuClusterTimeReader()}},
+        // disk_space
+        {android::util::DISK_SPACE,
+         {{}, {}, 1, new StatsCompanionServicePuller(android::util::DISK_SPACE)}},
+        // remaining_battery_capacity
+        {android::util::REMAINING_BATTERY_CAPACITY,
+         {{}, {}, 1, new ResourceHealthManagerPuller(android::util::REMAINING_BATTERY_CAPACITY)}},
+        // full_battery_capacity
+        {android::util::FULL_BATTERY_CAPACITY,
+         {{}, {}, 1, new ResourceHealthManagerPuller(android::util::FULL_BATTERY_CAPACITY)}}};
 
 StatsPullerManagerImpl::StatsPullerManagerImpl()
     : mCurrentPullingInterval(LONG_MAX) {
@@ -183,7 +140,7 @@ StatsPullerManagerImpl& StatsPullerManagerImpl::GetInstance() {
 }
 
 bool StatsPullerManagerImpl::PullerForMatcherExists(int tagId) const {
-  return kAllPullAtomInfo.find(tagId) != kAllPullAtomInfo.end();
+    return kAllPullAtomInfo.find(tagId) != kAllPullAtomInfo.end();
 }
 
 void StatsPullerManagerImpl::RegisterReceiver(int tagId, wp<PullDataReceiver> receiver,