Remove special case for Android in QSysInfo::productVersion

Incidentally, this means that the function will no longer include the
patch version number on Android, but this is more consistent with other
platforms like Apple and Windows anyways.

Change-Id: I9996317e73e491b3a139a511efe1384c57b73e0a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Jake Petroules 2016-09-09 10:01:58 -07:00
parent 55ac42dd13
commit 42ac179631

View File

@ -2669,7 +2669,7 @@ QString QSysInfo::productType()
*/
QString QSysInfo::productVersion()
{
#if defined(Q_OS_DARWIN)
#if defined(Q_OS_ANDROID) || defined(Q_OS_DARWIN)
const auto version = QOperatingSystemVersion::current();
return QString::number(version.majorVersion()) + QLatin1Char('.') + QString::number(version.minorVersion());
#elif defined(Q_OS_WIN)
@ -2680,9 +2680,6 @@ QString QSysInfo::productVersion()
}
// fall through
// Android should not fall through to the Unix code
#elif defined(Q_OS_ANDROID)
return QJNIObjectPrivate::getStaticObjectField("android/os/Build$VERSION", "RELEASE", "Ljava/lang/String;").toString();
#elif defined(USE_ETC_OS_RELEASE) // Q_OS_UNIX
QUnixOSVersion unixOsVersion;
findUnixOsVersion(unixOsVersion);