Merge "Improve safety of bit-field assignments in battery history"