Merge "Fix NPE when serializing roles.xml and add nullability annotations."