cmhw: Add UniqueDeviceId implementation

CMHW SerialNumber and an "ro.serialno" property already exists, but
are not guaranteed to be unique. Different OEM may use overlapping
numbering schemes, and sometimes placeholder like "012345ABCDE" are

Attempt to work around these shortcomings by defining a new
UniqueDeviceId class that provides a globally unique device ID that
is both deterministic for a given device and designed not to overlap
with IDs of any other devices.

The 40 character ID contains two fields: a three character type,
and a 37 character value which is populated according to the type.

Only one type is currently supported (mmcblk0's cid), but others can
be added later for devices without MMC storage. Devices with only
UFS storage have their own serial numbers which could be used, for

While new types can be added, it's important that the order of
preference for the types never changes so that a device's ID
does not change as a result of software updates.

Change-Id: I96e415b3bd30e3f3e43e3dcc8637f5f4e663c1a1
1 file changed
tree: f92c33055e5c0fd03900f64fdf20e9783caa23d2
  1. cmhw/
  2. lights/