Update Java serialization code to allow interacting with native
serialization code. One notable change is due to the fact that
properties of non-primitive types can not be read back by native code,
the properties are serialized in two versions: one only contains
properties having primitive types, and another contains all
the properties. The latter is ignored by native code.
Bug: 25945784
Test: using a PoC app
Change-Id: I047a5bdec3006bcbce34c1c63aa7746e01f7a71e