Bug 968170 - Remove unused DELETED state from PanelConfig (r=margaret)

This commit is contained in:
Lucas Rocha 2014-02-13 11:46:25 +00:00
parent 111df1d823
commit 8588506603

View File

@ -106,8 +106,7 @@ public final class HomeConfig {
public enum Flags {
DEFAULT_PANEL,
DISABLED_PANEL,
DELETED_PANEL
DISABLED_PANEL
}
public PanelConfig(JSONObject json) throws JSONException, IllegalArgumentException {
@ -286,18 +285,6 @@ public final class HomeConfig {
}
}
public boolean isDeleted() {
return mFlags.contains(Flags.DELETED_PANEL);
}
public void setIsDeleted(boolean isDeleted) {
if (isDeleted) {
mFlags.add(Flags.DELETED_PANEL);
} else {
mFlags.remove(Flags.DELETED_PANEL);
}
}
public JSONObject toJSON() throws JSONException {
final JSONObject json = new JSONObject();
@ -596,12 +583,6 @@ public final class HomeConfig {
}
public void save(List<PanelConfig> panelConfigs) {
for (PanelConfig panelConfig : panelConfigs) {
if (panelConfig.isDeleted()) {
throw new IllegalArgumentException("Should never save a deleted PanelConfig: " + panelConfig.getId());
}
}
mBackend.save(panelConfigs);
}