Fix only one battery stat showing sometimes.

Take into account the prefs we are currently caching within the
group when counting how many prefs have been added.

Change-Id: I962acd41592c1a9366882711d3f4944bffb54d22
Fixes: 27931457
diff --git a/src/com/android/settings/SettingsPreferenceFragment.java b/src/com/android/settings/SettingsPreferenceFragment.java
index 1a3c850..a992897 100644
--- a/src/com/android/settings/SettingsPreferenceFragment.java
+++ b/src/com/android/settings/SettingsPreferenceFragment.java
@@ -399,6 +399,10 @@
         }
     }
 
+    protected int getCachedCount() {
+        return mPreferenceCache.size();
+    }
+
     private void highlightPreference(String key) {
         final int position = canUseListViewForHighLighting(key);
         if (position >= 0) {