This is to backport a security fix reported by b/27308057 and b/27335139. Also, add Analytics for these errors. Bug: b/27335139 Change-Id: Iaacb34e4983cdf9a85487222ae930cb64d80a193