Changes to deal with restrictions API change

Bug: 8633967
Change-Id: I5d8e843c850ad3eff900409a9006666ddf91b061
This commit is contained in:
Amith Yamasani
2013-04-17 10:47:34 -07:00
parent e11a346f1f
commit 5ee1750519
3 changed files with 26 additions and 13 deletions

View File

@@ -90,4 +90,18 @@ public class RestrictionUtils {
}
um.setUserRestrictions(userRestrictions, user);
}
public static Bundle restrictionsToBundle(ArrayList<RestrictionEntry> entries) {
final Bundle bundle = new Bundle();
for (RestrictionEntry entry : entries) {
if (entry.getType() == RestrictionEntry.TYPE_BOOLEAN) {
bundle.putBoolean(entry.getKey(), entry.getSelectedState());
} else if (entry.getType() == RestrictionEntry.TYPE_MULTI_SELECT) {
bundle.putStringArray(entry.getKey(), entry.getAllSelectedStrings());
} else {
bundle.putString(entry.getKey(), entry.getSelectedString());
}
}
return bundle;
}
}