Changes to deal with restrictions API change
Bug: 8633967 Change-Id: I5d8e843c850ad3eff900409a9006666ddf91b061
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user