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

Commit a2f7a598 authored by Jason Monk's avatar Jason Monk Committed by android-build-merger
Browse files

Merge "Fix only one battery stat showing sometimes." into nyc-dev

am: 7bcc48f7

* commit '7bcc48f7':
  Fix only one battery stat showing sometimes.

Change-Id: I70aac29590b8b65bd904a07f441f467cb7041930
parents 17282929 7bcc48f7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -399,6 +399,10 @@ public abstract class SettingsPreferenceFragment extends InstrumentedPreferenceF
        }
    }

    protected int getCachedCount() {
        return mPreferenceCache.size();
    }

    private void highlightPreference(String key) {
        final int position = canUseListViewForHighLighting(key);
        if (position >= 0) {
+6 −3
Original line number Diff line number Diff line
@@ -368,7 +368,8 @@ public class PowerUsageSummary extends PowerUsageBase {
                }
                addedSome = true;
                mAppListGroup.addPreference(pref);
                if (mAppListGroup.getPreferenceCount() > (MAX_ITEMS_TO_LIST + 1)) {
                if (mAppListGroup.getPreferenceCount() - getCachedCount()
                        > (MAX_ITEMS_TO_LIST + 1)) {
                    break;
                }
            }
@@ -391,8 +392,10 @@ public class PowerUsageSummary extends PowerUsageBase {
            stats.add(new BatterySipper(type, null, use));
            use += 5;
        }
        for (int i = 0; i < 100; i++) {
            stats.add(new BatterySipper(DrainType.APP,
                new FakeUid(Process.FIRST_APPLICATION_UID), use));
                    new FakeUid(Process.FIRST_APPLICATION_UID + i), use));
        }
        stats.add(new BatterySipper(DrainType.APP,
                new FakeUid(0), use));