resolve merge conflicts of 758b2d4ae6 to master

Test: I solemnly swear I tested this conflict resolution.
Change-Id: Ic82e244ad1485bdd1f73cff628e0e343bfdb1c53
This commit is contained in:
jackqdyulei
2017-06-26 18:29:31 -07:00
2 changed files with 32 additions and 25 deletions

View File

@@ -576,31 +576,8 @@ public class PowerUsageSummary extends PowerUsageBase implements
if (((int) (percentOfTotal + .5)) < 1) {
continue;
}
if (sipper.drainType == BatterySipper.DrainType.OVERCOUNTED) {
// Don't show over-counted unless it is at least 2/3 the size of
// the largest real entry, and its percent of total is more significant
if (sipper.totalPowerMah < ((mStatsHelper.getMaxRealPower() * 2) / 3)) {
continue;
}
if (percentOfTotal < 10) {
continue;
}
if ("user".equals(Build.TYPE)) {
continue;
}
}
if (sipper.drainType == BatterySipper.DrainType.UNACCOUNTED) {
// Don't show over-counted unless it is at least 1/2 the size of
// the largest real entry, and its percent of total is more significant
if (sipper.totalPowerMah < (mStatsHelper.getMaxRealPower() / 2)) {
continue;
}
if (percentOfTotal < 5) {
continue;
}
if ("user".equals(Build.TYPE)) {
continue;
}
if (shouldHideSipper(sipper)) {
continue;
}
final UserHandle userHandle = new UserHandle(UserHandle.getUserId(sipper.getUid()));
final BatteryEntry entry = new BatteryEntry(getActivity(), mHandler, mUm, sipper);
@@ -650,6 +627,13 @@ public class PowerUsageSummary extends PowerUsageBase implements
BatteryEntry.startRequestQueue();
}
@VisibleForTesting
boolean shouldHideSipper(BatterySipper sipper) {
// Don't show over-counted and unaccounted in any condition
return sipper.drainType == BatterySipper.DrainType.OVERCOUNTED
|| sipper.drainType == BatterySipper.DrainType.UNACCOUNTED;
}
@VisibleForTesting
void refreshAnomalyIcon() {
for (int i = 0, size = mAnomalySparseArray.size(); i < size; i++) {