fix #3707: missing method in Android < 2.3
Merge branch 'release' into upstream