feat(platform): 新增 G122J 平台适配与蓝牙重命名开关

This commit is contained in:
tongtong committed 2026-10-14 15:16:36 +08:00
1 parent b3c0355eb7
commit fa729afb49
7 files changed
+57 -6

No files matched your search

@@ -178,6 +178,8 @@ public class CommonConfig {
public final static String AOLE_BT_COMPUTER_KEY = "aole_bt_computer_on";
/*鼠标键盘*/
public final static String AOLE_BT_KEYBOARD_KEY = "aole_bt_keyboard_on";
/*蓝牙重命名开关*/
public final static String AOLE_ACTION_BT_RENAME_ALLOW = "aole_bt_rename_allow";
/*电话白名单开关*/
public final static String AOLE_ACTION_WHITE_LIST_ON = "aole_white_list_on";
@@ -455,9 +455,12 @@ public class MainService extends BaseService implements NetworkUtils.OnNetworkSt
setStatusbar();
setFloatingWindow();
JgyUtils.getInstance().writeAppPackageList();
// mNotificationManagerCompat = NotificationManagerCompat.from(this);
// createNotificationChannel();
// sendSimpleNotification();
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.HL500Platform) {
mNotificationManagerCompat = NotificationManagerCompat.from(this);
createNotificationChannel();
sendSimpleNotification();
}
// aliyunPushInit();
@@ -179,6 +179,7 @@ public class JgyUtils {
public static final int QualcommPlatform = 30;
public static final int DX11Platform = 31;
public static final int G12NLPlatform = 32;
public static final int G122JPlatform = 34;
public static final String Other = "其他";
@@ -207,6 +208,7 @@ public class JgyUtils {
public static final String Qualcomm_TAG = "QualcommA";
public static final String DX11_TAG = "DX11";
public static final String G12NL_TAG = "G12NL";
public static final String G122J_TAG = "G122J";
private CacheHelper cacheHelper;
@@ -372,6 +374,9 @@ public class JgyUtils {
} else if (DX11_TAG.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "DX11");
return DX11Platform;
} else if (G122J_TAG.equalsIgnoreCase(platform)) {
Log.i(TAG, "checkAppPlatform: " + "G122J");
return G122JPlatform;
} else {
Log.i(TAG, "checkAppPlatform: " + "没有数据");
return UnknowPlatform;
@@ -444,6 +449,8 @@ public class JgyUtils {
getAppPlatformCallback.AppPlatform(G12NLPlatform);
} else if (DX11_TAG.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(DX11Platform);
} else if (G122J_TAG.equalsIgnoreCase(platform)) {
getAppPlatformCallback.AppPlatform(G122JPlatform);
} else {
getAppPlatformCallback.AppPlatform(UnknowPlatform);
}
@@ -2676,7 +2683,15 @@ public class JgyUtils {
Log.e(TAG, "startServices: " + "lastTime: " + lastTime);
} else {
lastTime = System.currentTimeMillis();
context.startService(new Intent(context, MainService.class));
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.HL500Platform) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context.startForegroundService(new Intent(context, MainService.class));
} else {
context.startService(new Intent(context, MainService.class));
}
} else {
context.startService(new Intent(context, MainService.class));
}
context.startService(new Intent(context, StepService.class));
context.startService(new Intent(context, GuardService.class));
// context.startService(new Intent(context, LogcatService.class));
@@ -393,6 +393,8 @@ public class SysSettingUtils {
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setBluetoothEnable(state == 0);
}
// TODO: 2026/10/14 默认不管控
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BT_RENAME_ALLOW, 1);
}
/**
@@ -498,6 +500,10 @@ public class SysSettingUtils {
if (JgyUtils.isAllWinnerDevice()) {
AllwinnerCubeMdmManager.getInstance().setBluetoothEnable(setting_bht == 0);
}
int bt_rename = changeNum(jsonObject.get("bluetooth_name_change").getAsInt());
Settings.System.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BT_RENAME_ALLOW, bt_rename);
}
public static int getBluetooth(Context context) {
@@ -1848,6 +1848,7 @@ public class Utils {
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.QualcommPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.DX11Platform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G12NLPlatform
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.G122JPlatform
) {
return Utils.getProperty("ro.build.display.id", "获取失败");
} else {