resolve merge conflicts of ec7e2a164c37 to master

Test: compile
Bug: 26552300
Bug: 31289077
Change-Id: I49c6e41b79061e2b3c0352e3ac8fa5ebb152b6f5