Loading src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java +10 −3 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.text.TextUtils; import android.text.format.DateUtils; import android.util.ArrayMap; import android.util.SparseArray; import android.util.Log; import androidx.annotation.VisibleForTesting; import androidx.preference.Preference; Loading Loading @@ -64,6 +65,7 @@ import java.util.List; */ public class BatteryAppListPreferenceController extends AbstractPreferenceController implements PreferenceControllerMixin, LifecycleObserver, OnPause, OnDestroy { private static final String TAG = "BatteryAppListPreferenceController"; @VisibleForTesting static final boolean USE_FAKE_DATA = false; private static final int MAX_ITEMS_TO_LIST = USE_FAKE_DATA ? 30 : 20; Loading Loading @@ -103,9 +105,14 @@ public class BatteryAppListPreferenceController extends AbstractPreferenceContro PowerProfile powerProfile = new PowerProfile(context); // Cheap hack to try to figure out if the power_profile.xml was populated. return powerProfile.getAveragePowerForOrdinal( PowerProfile.POWER_GROUP_DISPLAY_SCREEN_FULL, 0) >= MIN_AVERAGE_POWER_THRESHOLD_MILLI_AMP; final double averagePowerForOrdinal = powerProfile.getAveragePowerForOrdinal( PowerProfile.POWER_GROUP_DISPLAY_SCREEN_FULL, 0); final boolean shouldShowBatteryAttributionList = averagePowerForOrdinal >= MIN_AVERAGE_POWER_THRESHOLD_MILLI_AMP; if (!shouldShowBatteryAttributionList) { Log.w(TAG, "shouldShowBatteryAttributionList(): " + averagePowerForOrdinal); } return shouldShowBatteryAttributionList; } }; Loading Loading
src/com/android/settings/fuelgauge/BatteryAppListPreferenceController.java +10 −3 Original line number Diff line number Diff line Loading @@ -36,6 +36,7 @@ import android.text.TextUtils; import android.text.format.DateUtils; import android.util.ArrayMap; import android.util.SparseArray; import android.util.Log; import androidx.annotation.VisibleForTesting; import androidx.preference.Preference; Loading Loading @@ -64,6 +65,7 @@ import java.util.List; */ public class BatteryAppListPreferenceController extends AbstractPreferenceController implements PreferenceControllerMixin, LifecycleObserver, OnPause, OnDestroy { private static final String TAG = "BatteryAppListPreferenceController"; @VisibleForTesting static final boolean USE_FAKE_DATA = false; private static final int MAX_ITEMS_TO_LIST = USE_FAKE_DATA ? 30 : 20; Loading Loading @@ -103,9 +105,14 @@ public class BatteryAppListPreferenceController extends AbstractPreferenceContro PowerProfile powerProfile = new PowerProfile(context); // Cheap hack to try to figure out if the power_profile.xml was populated. return powerProfile.getAveragePowerForOrdinal( PowerProfile.POWER_GROUP_DISPLAY_SCREEN_FULL, 0) >= MIN_AVERAGE_POWER_THRESHOLD_MILLI_AMP; final double averagePowerForOrdinal = powerProfile.getAveragePowerForOrdinal( PowerProfile.POWER_GROUP_DISPLAY_SCREEN_FULL, 0); final boolean shouldShowBatteryAttributionList = averagePowerForOrdinal >= MIN_AVERAGE_POWER_THRESHOLD_MILLI_AMP; if (!shouldShowBatteryAttributionList) { Log.w(TAG, "shouldShowBatteryAttributionList(): " + averagePowerForOrdinal); } return shouldShowBatteryAttributionList; } }; Loading