Merge pull request #3285 from asmorkalov:android_servive_big.little_fix

This commit is contained in:
Roman Donchenko 2014-09-30 15:19:07 +00:00
commit 774d6c1d0a

View File

@ -39,19 +39,13 @@ int GetCpuID()
#else #else
result = ARCH_UNKNOWN; result = ARCH_UNKNOWN;
#endif #endif
#else #elif defined(__arm__)
LOGD("Using ARM HW detector"); LOGD("Using ARM HW detector");
it = cpu_info.find("Processor"); it = cpu_info.find("Processor");
if (cpu_info.end() != it) if (cpu_info.end() != it)
{ {
size_t proc_name_pos = it->second.find(CPU_INFO_ARCH_X86_STR); size_t proc_name_pos = it->second.find(CPU_INFO_ARCH_ARMV7_STR);
if (string::npos != proc_name_pos)
{
}
else
{
proc_name_pos = it->second.find(CPU_INFO_ARCH_ARMV7_STR);
if (string::npos != proc_name_pos) if (string::npos != proc_name_pos)
{ {
result |= ARCH_ARMv7; result |= ARCH_ARMv7;
@ -70,13 +64,32 @@ int GetCpuID()
{ {
result |= ARCH_ARMv5; result |= ARCH_ARMv5;
} }
else
{
// Treat the arch of current binary. Google Play checks
// device hardware before installation. Let's assume that
// if the binary works, it's compatible with current hardware
#if defined __ARM_ARCH_7A__
result |= ARCH_ARMv7;
result |= FEATURES_HAS_VFPv3d16;
#else
result |= ARCH_ARMv5;
#endif
} }
} }
} }
} }
else else
{ {
return ARCH_UNKNOWN; // Treat the arch of current binary. Google Play checks
// device hardware before installation. Let's assume that
// if the binary works, it's compatible with current hardware
#if defined __ARM_ARCH_7A__
result |= ARCH_ARMv7;
result |= FEATURES_HAS_VFPv3;
#else
result |= ARCH_ARMv5;
#endif
} }
it = cpu_info.find("Features"); it = cpu_info.find("Features");
@ -107,6 +120,8 @@ int GetCpuID()
} }
} }
} }
#else
result = ARCH_UNKNOWN;
#endif #endif
return result; return result;