feat(platform): 优化设备适配与抖动检测逻辑
- 新增DX11平台强制安装应用白名单 - 优化加速度传感器选择策略,优先使用TYPE_ACCELEROMETER - 分离普通加速度计与线性加速度计检测算法,调整方差阈值参数 - 增加默认输入法和默认浏览器设置广播 - 扩展USB广播兼容DX11平台 - 移除已废弃的ActivityController和重复代码 - 统一强制安装应用设置逻辑
This commit is contained in:
@@ -176,6 +176,7 @@ public class JgyUtils {
|
||||
public static final int MT6765Platform = 28;
|
||||
public static final int G128TPlatform = 29;
|
||||
public static final int QualcommTPlatform = 30;
|
||||
public static final int DX11Platform = 31;
|
||||
|
||||
|
||||
public static final String Other = "其他";
|
||||
@@ -202,6 +203,7 @@ public class JgyUtils {
|
||||
public static final String MT6765_TAG = "MT6765";
|
||||
public static final String G128T_TAG = "G128T";
|
||||
public static final String Qualcomm_TAG = "QualcommA";
|
||||
public static final String DX11_TAG = "DX11";
|
||||
|
||||
|
||||
private CacheHelper cacheHelper;
|
||||
@@ -361,6 +363,9 @@ public class JgyUtils {
|
||||
} else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "QualcommA");
|
||||
return QualcommTPlatform;
|
||||
} else if (DX11_TAG.equalsIgnoreCase(platform)) {
|
||||
Log.i(TAG, "checkAppPlatform: " + "DX11");
|
||||
return DX11Platform;
|
||||
} else {
|
||||
Log.i(TAG, "checkAppPlatform: " + "没有数据");
|
||||
return UnknowPlatform;
|
||||
@@ -429,6 +434,8 @@ public class JgyUtils {
|
||||
getAppPlatformCallback.AppPlatform(G128TPlatform);
|
||||
} else if (Qualcomm_TAG.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(QualcommTPlatform);
|
||||
} else if (DX11_TAG.equalsIgnoreCase(platform)) {
|
||||
getAppPlatformCallback.AppPlatform(DX11Platform);
|
||||
} else {
|
||||
getAppPlatformCallback.AppPlatform(UnknowPlatform);
|
||||
}
|
||||
@@ -1476,6 +1483,9 @@ public class JgyUtils {
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G11Platform) {
|
||||
pkgSet.addAll(ApkUtils.G11Pkgs);
|
||||
}
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.DX11Platform) {
|
||||
pkgSet.addAll(ApkUtils.DX11App);
|
||||
}
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.YXPD1Platform) {
|
||||
pkgSet.add("com.tencent.wemeet.app");
|
||||
}
|
||||
@@ -1510,10 +1520,14 @@ public class JgyUtils {
|
||||
|
||||
String aole_app_forbid = String.join(",", pkgSet);
|
||||
Log.e(TAG, "writeAppPackageList: " + aole_app_forbid);
|
||||
boolean b = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid);
|
||||
try {
|
||||
boolean b = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid);
|
||||
Log.e("writeAppPackageList: ", "aole_app_forbid: " + b + " " + Settings.System.getString(crv, CommonConfig.AOLE_ACTION_APP_FORBID));
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "writeAppPackageList: Settings.System.putString failed", e);
|
||||
}
|
||||
setAppRestriction(2);
|
||||
addAppInstallWhiteList(new ArrayList<>(pkgSet));
|
||||
Log.e("writeAppPackageList: ", "aole_app_forbid: " + b + " " + Settings.System.getString(crv, CommonConfig.AOLE_ACTION_APP_FORBID));
|
||||
}
|
||||
|
||||
public void writeAppPackageList() {
|
||||
@@ -1536,7 +1550,11 @@ public class JgyUtils {
|
||||
|
||||
String aole_app_forbid = String.join(",", pkgSet);
|
||||
Log.e(TAG, "writeAppPackageList: " + aole_app_forbid);
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid);
|
||||
try {
|
||||
Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID, aole_app_forbid);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "writeAppPackageList: Settings.System.putString failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@@ -1812,6 +1830,11 @@ public class JgyUtils {
|
||||
if (ApkUtils.mJxwApp.contains(packageName)) {
|
||||
continue;
|
||||
}
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.DX11Platform) {
|
||||
if (ApkUtils.DX11App.contains(packageName)) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (PackageNames.DEVICE_INFO.equals(packageName) || PackageNames.APPSTORE.equals(packageName)
|
||||
) {
|
||||
continue;
|
||||
|
||||
Reference in New Issue
Block a user