Improve android p system detection in qqplay for fireball/issues/8126 (#3086)

This commit is contained in:
Knox
2018-08-14 15:55:14 +08:00
committed by pandamicro
parent 482fe0a040
commit c70d7d6f61
+8 -2
View File
@@ -661,6 +661,7 @@ function initSys () {
sys.isMobile = true;
sys.platform = sys.QQ_PLAY;
sys.language = sys.LANGUAGE_UNKNOWN;
var system = env.system.toLowerCase();
if (env.platform === "android") {
sys.os = sys.OS_ANDROID;
}
@@ -671,8 +672,13 @@ function initSys () {
sys.os = sys.OS_UNKNOWN;
}
var version = /[\d\.]+/.exec(env.version);
sys.osVersion = version[0];
// Adaptation to Android P
if (system === 'android p') {
system = 'android p 9.0';
}
var version = /[\d\.]+/.exec(system);
sys.osVersion = version ? version[0] : system;
sys.osMainVersion = parseInt(sys.osVersion.split('.')[0]);
sys.browserType = sys.BROWSER_TYPE_QQ_PLAY;
sys.browserVersion = 0;