Merge cherrypicks of [16622627, 16790556] into security-aosp-sc-release.

Change-Id: Ie74da1e3c3790be628746e7ab29ff1370f7ec801