BUG: 30839080 BUG: 31007021 (cherry picked from commit fc7d7a35) (cherry picked from commit 2026ca14) Change-Id: I45efc93b40e526467c97d0735289db1404ccd22d