From https://code.google.com/p/android/issues/detail?id=38009