@@ -301,6 +301,25 @@ public final class DeviceOs {
301301 "persist.radio.zui.feature" ,
302302 "ro.config.zuisdk.enabled" };
303303
304+ /* ---------------------------------------- 下面是努比亚的老系统 ---------------------------------------- */
305+
306+ static final String OS_NAME_NUBIA_UI = "nubiaUI" ;
307+ /**
308+ * [ro.build.nubia.rom.code]: [V1.6]
309+ * [ro.build.nubia.rom.code]: [V2.0]
310+ * [ro.build.nubia.rom.code]: [V3.0]
311+ * [ro.build.nubia.rom.code]: [V3.7]
312+ * [ro.build.nubia.rom.code]: [V4.0]
313+ * [ro.build.nubia.rom.code]: [V6.0]
314+ */
315+ static final String OS_VERSION_NAME_NUBIA_UI = "ro.build.nubia.rom.code" ;
316+
317+ /**
318+ * [ro.build.nubia.rom.name]: [nubiaUI]
319+ */
320+ static final String [] OS_CONDITIONS_NUBIA_UI = { "ro.build.nubia.rom.name" ,
321+ OS_VERSION_NAME_NUBIA_UI };
322+
304323 /* ---------------------------------------- 下面是 360 的系统 ---------------------------------------- */
305324
306325 static final String OS_NAME_360_UI = "360UI" ;
@@ -473,6 +492,14 @@ private DeviceOs() {
473492 sCurrentOriginalOsVersionName = SystemPropertyCompat .getSystemPropertyValue (OS_VERSION_NAME_ZUI_OS );
474493 }
475494
495+ if (sCurrentOsName == null && SystemPropertyCompat .isSystemPropertyAnyOneExist (OS_CONDITIONS_NUBIA_UI )) {
496+ sCurrentOsName = OS_NAME_NUBIA_UI ;
497+ String nubiaUiVersion = SystemPropertyCompat .getSystemPropertyValue (OS_VERSION_NAME_NUBIA_UI );
498+ if (!TextUtils .isEmpty (nubiaUiVersion )) {
499+ sCurrentOriginalOsVersionName = nubiaUiVersion ;
500+ }
501+ }
502+
476503 if (sCurrentOsName == null ) {
477504 String osVersion = SystemPropertyCompat .getSystemPropertyValue (OS_VERSION_NAME_360_UI );
478505 if (!TextUtils .isEmpty (osVersion ) && osVersion .toLowerCase ().contains ("360ui" )) {
@@ -723,6 +750,13 @@ public static boolean isZui() {
723750 return TextUtils .equals (sCurrentOsName , OS_NAME_ZUI_OS );
724751 }
725752
753+ /**
754+ * 判断当前设备的厂商系统是否为 nubiaUI(努比亚的老系统)
755+ */
756+ public static boolean isNubiaUi () {
757+ return TextUtils .equals (sCurrentOsName , OS_NAME_NUBIA_UI );
758+ }
759+
726760 /**
727761 * 判断当前设备的厂商系统是否为 360UI(360 的系统)
728762 */
0 commit comments