Merge "Fix CPU attribution when power stats collection is disabled" into main
diff --git a/services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java b/services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java
index 303c245..391dd77 100644
--- a/services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java
+++ b/services/core/java/com/android/server/power/stats/BatteryUsageStatsProvider.java
@@ -71,7 +71,7 @@
 
                 // Power calculators are applied in the order of registration
                 mPowerCalculators.add(new BatteryChargeCalculator());
-                if (mPowerStatsExporterEnabled) {
+                if (!mPowerStatsExporterEnabled) {
                     mPowerCalculators.add(
                             new CpuPowerCalculator(mCpuScalingPolicies, mPowerProfile));
                 }
@@ -385,7 +385,6 @@
     }
 
     public void setPowerStatsExporterEnabled(boolean enabled) {
-
         mPowerStatsExporterEnabled = enabled;
     }
 }