Make Android part work for M40 rebase

All instrumentation tests passed.
Merge pull request #2731 from wang16/next

[Next] Make Android part work for M40 rebase