Merge cherrypicks of [19693694, 20035260] into security-aosp-tm-release.

Change-Id: I8f98203a9d8c288fa8540562c06259b14a7ae2a3