[automerger skipped] [nearby] Update encoding and decoding according to the spec am: bcf305cbef -s ours

am skip reason: Merged-In Ie50d3fae62af6f637583216e3dae5841c1214aa3 with SHA-1 17a0803df0 is already in history

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Connectivity/+/2866062

Change-Id: Icc30f84cd1002723cb2ea480d06d6bdefb830e69
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>