Fix reflection of setters for unsigned primitive types.

BUG=6764163

We now generate set_*() functions for unsigned types by creating a single
element FieldPacker and stuffing it with the larger Dalvik type. Reusing
FieldPacker in this way allows us to validate that the input is non-negative
and within the appropriate range (i.e. not really using more bits than the
unsigned C type should).

This change also fixes a subtle race where the Dalvik and script side can
disagree about a variable's value. All set_*() methods need to be synchronized,
and we must do the Dalvik update after validating the input data.

Change-Id: I7b2371206848ebbf0b0752779cb6c98cec1ab5f6
6 files changed