Removed most usages of hidden APIs
Merge from upstream to make pull requests easier