@@ -211,8 +211,8 @@ public final class DeviceOs {
211211 static final String [] OS_CONDITIONS_NAME_MAGIC_OS = { "msc.config.magic.version" ,
212212 "ro.build.version.magic" };
213213
214- static final int OS_TYPE_ZYT_ON_HARMONY_OS_NEXT = -1214041693 ;
215- static final String OS_NAME_ZYT_ON_HARMONY_OS_NEXT = "HarmonyOS NEXT ZhuoYiTong " ;
214+ static final int OS_TYPE_HARMONY_OS_NEXT_ANDROID_COMPATIBLE = -182666708 ;
215+ static final String OS_NAME_HARMONY_OS_NEXT_ANDROID_COMPATIBLE = "HarmonyOS NEXT AndroidCompatible " ;
216216
217217 /**
218218 * HarmonyOS NEXT 6.0.0 版本属性:
@@ -226,7 +226,7 @@ public final class DeviceOs {
226226 * 所以综合取舍下来最优解是:
227227 * [ro.sys.anco.product.software.version]: [PLA-AL10 6.0.0.100(SP6C00E47R4P3)]
228228 */
229- static final String OS_VERSION_ZYT_ON_HARMONY_OS_NEXT = "ro.sys.anco.product.software.version" ;
229+ static final String OS_VERSION_HARMONY_OS_NEXT_ANDROID_COMPATIBLE = "ro.sys.anco.product.software.version" ;
230230
231231 /**
232232 * [ro.product.anco.devicetype]: [phone]
@@ -237,10 +237,10 @@ public final class DeviceOs {
237237 * [ro.product.os.dist.anco.releasetype]: [Release]
238238 * [ro.product.os.dist.anco.releasetype]: [Beta5]
239239 */
240- static final String [] OS_CONDITIONS_ZYT_ON_HARMONY_OS_NEXT = { "ro.product.anco.devicetype" ,
241- OS_VERSION_ZYT_ON_HARMONY_OS_NEXT ,
242- "ro.product.os.dist.anco.apiversion" ,
243- "ro.product.os.dist.anco.releasetype" };
240+ static final String [] OS_CONDITIONS_HARMONY_OS_NEXT_ANDROID_COMPATIBLE = { "ro.product.anco.devicetype" ,
241+ OS_VERSION_HARMONY_OS_NEXT_ANDROID_COMPATIBLE ,
242+ "ro.product.os.dist.anco.apiversion" ,
243+ "ro.product.os.dist.anco.releasetype" };
244244
245245 /**
246246 * MagicOS 9.0 版本属性:
@@ -658,10 +658,10 @@ private DeviceOs() {
658658
659659 // 判断是否为纯血鸿蒙应该要放在残血鸿蒙之前,因为纯血鸿蒙有 persist.sys.ohos.osd.cloud.switch 这个系统属性
660660 // 经过验证得出:如果这段代码放在残血鸿蒙之后再进行判断,会出现误判的情况,所以这里需要注意代码判断的顺序
661- if (sCurrentOsName == null && SystemPropertyCompat .isSystemPropertyAnyOneExist (OS_CONDITIONS_ZYT_ON_HARMONY_OS_NEXT )) {
662- sCurrentOsType = OS_TYPE_ZYT_ON_HARMONY_OS_NEXT ;
663- sCurrentOsName = OS_NAME_ZYT_ON_HARMONY_OS_NEXT ;
664- sCurrentOsVersionName = getBestVersionNameBySystemProperties (OS_VERSION_ZYT_ON_HARMONY_OS_NEXT );
661+ if (sCurrentOsName == null && SystemPropertyCompat .isSystemPropertyAnyOneExist (OS_CONDITIONS_HARMONY_OS_NEXT_ANDROID_COMPATIBLE )) {
662+ sCurrentOsType = OS_TYPE_HARMONY_OS_NEXT_ANDROID_COMPATIBLE ;
663+ sCurrentOsName = OS_NAME_HARMONY_OS_NEXT_ANDROID_COMPATIBLE ;
664+ sCurrentOsVersionName = getBestVersionNameBySystemProperties (OS_VERSION_HARMONY_OS_NEXT_ANDROID_COMPATIBLE );
665665 }
666666
667667 if (sCurrentOsName == null && SystemPropertyCompat .isSystemPropertyAnyOneExist (OS_CONDITIONS_HARMONY_OS )) {
@@ -1038,10 +1038,17 @@ public static boolean isHarmonyOs() {
10381038 }
10391039
10401040 /**
1041- * 判断是否在 HarmonyOS NEXT(纯血鸿蒙)的卓易通上面运行
1041+ * @deprecated 该 API 已经过时,随时会被删除,请尽早迁移到 {@link #isHarmonyOsNextAndroidCompatible()}
10421042 */
10431043 public static boolean isZytOnHarmonyOsNext () {
1044- return sCurrentOsType == OS_TYPE_ZYT_ON_HARMONY_OS_NEXT ;
1044+ return isHarmonyOsNextAndroidCompatible ();
1045+ }
1046+
1047+ /**
1048+ * 判断是否在 HarmonyOS NEXT(纯血鸿蒙)的卓易通或者出境易环境上运行
1049+ */
1050+ public static boolean isHarmonyOsNextAndroidCompatible () {
1051+ return sCurrentOsType == OS_TYPE_HARMONY_OS_NEXT_ANDROID_COMPATIBLE ;
10451052 }
10461053
10471054 /**
0 commit comments