Refresh state after loading conditions from xml.

Fixes: 30330909

When start Settings, conditions is loaded from a xml with potentially
stale state. ConditionLoader needs to refresh states after reading xml
to make sure they are up to date.

Change-Id: Ice1b8bacb0486c5dd230b83670c1494710d1c061
This commit is contained in:
Fan Zhang
2016-07-25 12:55:36 -07:00
parent d5b3043bba
commit a0ebd1a9f0

View File

@@ -20,6 +20,7 @@ import android.os.AsyncTask;
import android.os.PersistableBundle; import android.os.PersistableBundle;
import android.util.Log; import android.util.Log;
import android.util.Xml; import android.util.Xml;
import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserException;
import org.xmlpull.v1.XmlSerializer; import org.xmlpull.v1.XmlSerializer;
@@ -241,10 +242,7 @@ public class ConditionManager {
protected void onPostExecute(ArrayList<Condition> conditions) { protected void onPostExecute(ArrayList<Condition> conditions) {
mConditions.clear(); mConditions.clear();
mConditions.addAll(conditions); mConditions.addAll(conditions);
final int N = mListeners.size(); refreshAll();
for (int i = 0; i < N; i++) {
mListeners.get(i).onConditionsChanged();
}
} }
} }