This is achieved by iterating through the pool of StorageItemPreferences up
to the index of the last shown one, instead of iterating through the
preferences of the screen which may miss preferences inside other top-level
preference groups.
Bug:
22353561
Change-Id: I2293a7949a5becfb506d6b7965f8db2f11845756
};
private void updateDetails(MeasurementDetails details) {
- PreferenceScreen screen = getPreferenceScreen();
- final int preferenceCount = screen.getPreferenceCount();
- for (int i = 0; i < preferenceCount; ++i) {
- final Preference pref = screen.getPreference(i);
- if (!(pref instanceof StorageItemPreference)) {
- continue;
- }
- StorageItemPreference item = (StorageItemPreference)pref;
+ for (int i = 0; i < mItemPoolIndex; ++i) {
+ StorageItemPreference item = mItemPreferencePool.get(i);
final int userId = item.userHandle;
final int itemTitleId = item.getTitleRes();
switch (itemTitleId) {