Merge "Trim the invalid uids and tags when reading uids/tags from chain." into pi-dev am: 9054656c20
am: 0b90c524cb

Change-Id: Iaf27e817a7b9fd024f643e6874da76e4bd5e194d