Update Android CPU device detection (#45139)

This commit is contained in:
Jonah Williams
2019-11-19 19:04:17 -08:00
committed by GitHub
parent 868578b150
commit c724504142
3 changed files with 82 additions and 1 deletions

View File

@@ -192,7 +192,16 @@ class AndroidDevice extends Device {
// http://developer.android.com/ndk/guides/abis.html (x86, armeabi-v7a, ...)
switch (await _getProperty('ro.product.cpu.abi')) {
case 'arm64-v8a':
_platform = TargetPlatform.android_arm64;
// Perform additional verification for 64 bit ABI. Some devices,
// like the Kindle Fire 8, misreport the abilist. We might not
// be able to retrieve this property, in which case we fall back
// to assuming 64 bit.
final String abilist = await _getProperty('ro.product.cpu.abilist');
if (abilist == null || abilist.contains('arm64-v8a')) {
_platform = TargetPlatform.android_arm64;
} else {
_platform = TargetPlatform.android_arm;
}
break;
case 'x86_64':
_platform = TargetPlatform.android_x64;