version:1.5.0719
bugfixes: add:优化websocket,增加锁定显示,优化解锁加锁恢复出厂设置
This commit is contained in:
@@ -29,8 +29,8 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId "com.aoleyun.sn"
|
||||
versionCode 186
|
||||
versionName "1.5.0714"
|
||||
versionCode 187
|
||||
versionName "1.5.0719"
|
||||
|
||||
//There are no CERT files because If the mini sdk version is 23+, the AGP will ignore the V1 scheme signature.
|
||||
minSdkVersion 24
|
||||
@@ -47,7 +47,7 @@ android {
|
||||
buildConfigField "String", "ROOT_URL", '"https://led.aoleyun.cn/api/"'
|
||||
buildConfigField "String", "SCREEN_BASE_URL", '"https://led.aoleyun.cn:2018/"'
|
||||
buildConfigField "String", "SCREEN_URL", '"https://led.aoleyun.cn:2018/wm/is_online"'
|
||||
buildConfigField "String", "WebsocketURL", '"wss://led.aoleyun.cn:2018"'
|
||||
buildConfigField "String", "WEBSOCKET_URL", '"wss://led.aoleyun.cn/wss/"'
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -397,7 +397,7 @@
|
||||
</service>
|
||||
|
||||
<meta-data
|
||||
android:name=".base.CustomGlideModule"
|
||||
android:name="com.aoleyun.sn.base.CustomGlideModule"
|
||||
android:value="AppGlideModule" />
|
||||
|
||||
<meta-data
|
||||
|
||||
@@ -8,7 +8,6 @@ import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.content.ServiceConnection;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.IBinder;
|
||||
import android.os.SystemClock;
|
||||
@@ -258,7 +257,9 @@ public class MainActivity extends BaseMvvmActivity<MainViewModel, ActivityMainBi
|
||||
Log.e(TAG, "setLockedState: " + aBoolean);
|
||||
if (aBoolean) {
|
||||
mViewModel.getStudesInfo();
|
||||
mViewDataBinding.ivLockStatus.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mViewDataBinding.ivLockStatus.setVisibility(View.GONE);
|
||||
setNumberText("", View.GONE);
|
||||
setNameText("", View.GONE);
|
||||
setClassText("", View.GONE);
|
||||
|
||||
@@ -2,8 +2,14 @@ package com.aoleyun.sn.manager;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.cubemdm.cubemdmmanager.CubeMdmManager;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.view.inputmethod.InputMethodSubtype;
|
||||
|
||||
import com.aoleyun.sn.utils.JgyUtils;
|
||||
|
||||
@@ -192,14 +198,28 @@ public class AllwinnerCubeMdmManager {
|
||||
public void setDefaultLauncher(String packageName) {
|
||||
Log.e(TAG, "setDefaultLauncher: packageName = " + packageName);
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
if (getDefaultLauncherPackage(mContext).equals(packageName)) {
|
||||
Log.e(TAG, "setDefaultLauncher: same launcher package name, skip");
|
||||
return;
|
||||
}
|
||||
if (mCubeMdmManager != null) {
|
||||
mCubeMdmManager.setDefaultLauncher(packageName);
|
||||
}
|
||||
} else {
|
||||
Log.e(TAG, "setUsbStatus: Not Allwinner Platform");
|
||||
Log.e(TAG, "setDefaultLauncher: Not Allwinner Platform");
|
||||
}
|
||||
}
|
||||
|
||||
public String getDefaultLauncherPackage(Context context) {
|
||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||
intent.addCategory(Intent.CATEGORY_HOME);
|
||||
ResolveInfo resolveInfo = context.getPackageManager().resolveActivity(intent, 0);
|
||||
if (resolveInfo != null && resolveInfo.activityInfo != null) {
|
||||
return resolveInfo.activityInfo.packageName;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* 强制安装应用名单,包名列表不允许删除
|
||||
*
|
||||
|
||||
@@ -2524,6 +2524,7 @@ public class NetInterfaceManager {
|
||||
Settings.System.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, "");
|
||||
JgyUtils.getInstance().addAppInstallWhiteList(new ArrayList<>());
|
||||
JgyUtils.getInstance().setAppRestriction(0);
|
||||
JgyUtils.getInstance().setDeveloperOptions(1);
|
||||
}
|
||||
} else if (response.code == NOTFOUND) {
|
||||
Settings.System.putInt(mContext.getContentResolver(), JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
|
||||
@@ -3040,7 +3041,7 @@ public class NetInterfaceManager {
|
||||
public void onNext(BaseResponse<BrowserData> browserDataBaseResponse) {
|
||||
Log.e("setBrowserBlackList", "onNext: ");
|
||||
String homePage = Settings.System.getString(mContext.getContentResolver(), "homepagURL");
|
||||
setBlackWhiteLis(browserDataBaseResponse, homePage);
|
||||
setBlackWhiteList(browserDataBaseResponse, homePage);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -3091,7 +3092,7 @@ public class NetInterfaceManager {
|
||||
}
|
||||
|
||||
setBrowserBookmarks(browserBookmarksBaseResponse);
|
||||
setBlackWhiteLis(browserDataBaseResponse, homePage);
|
||||
setBlackWhiteList(browserDataBaseResponse, homePage);
|
||||
return homePage;
|
||||
}
|
||||
})
|
||||
@@ -3135,7 +3136,7 @@ public class NetInterfaceManager {
|
||||
}
|
||||
|
||||
setBrowserBookmarks(browserBookmarksBaseResponse);
|
||||
setBlackWhiteLis(browserDataBaseResponse, homePage);
|
||||
setBlackWhiteList(browserDataBaseResponse, homePage);
|
||||
return homePage;
|
||||
}
|
||||
})
|
||||
@@ -3261,7 +3262,7 @@ public class NetInterfaceManager {
|
||||
}
|
||||
}
|
||||
|
||||
private void setBlackWhiteLis(BaseResponse<BrowserData> browserDataBaseResponse, String homePage) {
|
||||
private void setBlackWhiteList(BaseResponse<BrowserData> browserDataBaseResponse, String homePage) {
|
||||
//黑白名单
|
||||
if (browserDataBaseResponse.code == 200) {
|
||||
BrowserData browserData = browserDataBaseResponse.data;
|
||||
@@ -3280,6 +3281,10 @@ public class NetInterfaceManager {
|
||||
if (!TextUtils.isEmpty(black)) {
|
||||
boolean qch_webblack_url = Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", black);
|
||||
Log.e("setBrowserBlackList", "setBrowserList black = " + black + ":" + qch_webblack_url);
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
List<String> componentNames = new ArrayList<>(Arrays.asList(black.split(",")));
|
||||
AllwinnerCubeMdmManager.getInstance().setComponentDisable(componentNames, true);
|
||||
}
|
||||
} else {
|
||||
Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", " ");
|
||||
}
|
||||
|
||||
@@ -549,6 +549,8 @@ public class PushManager {
|
||||
NetInterfaceManager.getInstance().getAppLimit();
|
||||
break;
|
||||
case UPDATE_BATCH:
|
||||
Utils.doMasterClear(mContext);
|
||||
break;
|
||||
case UPDATE_CHILD_BATCH:
|
||||
Toaster.debugShow("收到管控:更换批次不恢复出厂设置");
|
||||
NetInterfaceManager.getInstance().setPushTags();
|
||||
|
||||
@@ -10,18 +10,17 @@ import android.content.ServiceConnection;
|
||||
import android.os.Binder;
|
||||
import android.os.Handler;
|
||||
import android.os.IBinder;
|
||||
import android.os.PowerManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import com.aoleyun.sn.BuildConfig;
|
||||
import com.aoleyun.sn.utils.JgyUtils;
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.aoleyun.sn.KeepAliveConnection;
|
||||
import com.aoleyun.sn.utils.JgyUtils;
|
||||
import com.aoleyun.sn.utils.ServiceAliveUtils;
|
||||
import com.aoleyun.sn.utils.Utils;
|
||||
import com.blankj.utilcode.util.NetworkUtils;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import org.java_websocket.handshake.ServerHandshake;
|
||||
@@ -40,6 +39,11 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
public JWebSocketClient client;
|
||||
private JWebSocketClientBinder mBinder = new JWebSocketClientBinder();
|
||||
|
||||
// 新增防抖控制变量
|
||||
private static final long MIN_MESSAGE_INTERVAL = 15 * 1000; // 15秒最小消息间隔
|
||||
private volatile long lastMessageTime = 0;
|
||||
private final Object sendLock = new Object();
|
||||
|
||||
@Override
|
||||
public void onDisconnected() {
|
||||
|
||||
@@ -135,15 +139,17 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
case Intent.ACTION_BOOT_COMPLETED:
|
||||
case Intent.ACTION_USER_PRESENT:
|
||||
case Intent.ACTION_SCREEN_ON:
|
||||
mHandler.removeCallbacks(heartBeatRunnable);
|
||||
mHandler.post(heartBeatRunnable);//开启心跳检测
|
||||
sendMsg(1);
|
||||
sendMsg();
|
||||
break;
|
||||
case Intent.ACTION_SCREEN_OFF:
|
||||
case Intent.ACTION_SHUTDOWN:
|
||||
case Intent.ACTION_REBOOT:
|
||||
case Intent.ACTION_FACTORY_RESET:
|
||||
case Intent.ACTION_MASTER_CLEAR:
|
||||
sendMsg(2);
|
||||
mHandler.removeCallbacks(heartBeatRunnable);
|
||||
closeConnect();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -165,9 +171,7 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
* 初始化websocket连接
|
||||
*/
|
||||
private void initSocketClient() {
|
||||
URI uri = URI.create(BuildConfig.WebsocketURL);
|
||||
// URI uri = URI.create("ws://echo.websocket.org");
|
||||
// URI uri = URI.create("ws://123.207.136.134:9010/ajaxchattest");
|
||||
URI uri = URI.create(BuildConfig.WEBSOCKET_URL + "device?sn=" + Utils.getSerial(StepService.this));
|
||||
client = new JWebSocketClient(uri) {
|
||||
@Override
|
||||
public void onMessage(String message) {
|
||||
@@ -178,7 +182,9 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
public void onOpen(ServerHandshake handshakedata) {
|
||||
super.onOpen(handshakedata);
|
||||
Log.i("JWebSocketClientService", "websocket连接成功");
|
||||
sendMsg(1);
|
||||
mHandler.postDelayed(() -> {
|
||||
if (isOpen()) sendMsg();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -231,19 +237,26 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
* 发送消息
|
||||
*/
|
||||
public void sendMsg() {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("sn", Utils.getSerial(this));
|
||||
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
|
||||
if (!pm.isScreenOn()) {
|
||||
jsonObject.addProperty("online", 2);
|
||||
//熄屏状态
|
||||
} else {
|
||||
jsonObject.addProperty("online", 1);
|
||||
}
|
||||
if (null != client) {
|
||||
synchronized (sendLock) {
|
||||
long currentTime = System.currentTimeMillis();
|
||||
// 检查时间间隔和连接状态
|
||||
if (currentTime - lastMessageTime < MIN_MESSAGE_INTERVAL) {
|
||||
Log.w("JWebSocketClientService", "消息发送过于频繁,已忽略");
|
||||
return;
|
||||
}
|
||||
if (client == null || !client.isOpen()) {
|
||||
Log.w("JWebSocketClientService", "连接未建立,取消发送");
|
||||
return;
|
||||
}
|
||||
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("type", "ping");
|
||||
jsonObject.addProperty("sn", Utils.getSerial(this));
|
||||
|
||||
Log.i("JWebSocketClientService", "发送的消息:" + jsonObject.toString());
|
||||
try {
|
||||
client.send(jsonObject.toString());
|
||||
lastMessageTime = currentTime; // 更新最后发送时间
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "sendMsg: " + e.getMessage());
|
||||
}
|
||||
@@ -251,22 +264,6 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
}
|
||||
}
|
||||
|
||||
public void sendMsg(int state) {
|
||||
JsonObject jsonObject = new JsonObject();
|
||||
jsonObject.addProperty("sn", Utils.getSerial(this));
|
||||
jsonObject.addProperty("online", state);
|
||||
try {
|
||||
if (null != client) {
|
||||
Log.i("JWebSocketClientService", "发送的消息:" + jsonObject.toString());
|
||||
client.send(jsonObject.toString());
|
||||
} else {
|
||||
Log.i("JWebSocketClientService", "未连接");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "sendMsg: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 断开连接
|
||||
*/
|
||||
@@ -289,23 +286,23 @@ public class StepService extends Service implements NetworkUtils.OnNetworkStatus
|
||||
@Override
|
||||
public void run() {
|
||||
Log.i("JWebSocketClientService", "心跳包检测websocket连接状态");
|
||||
if (client != null) {
|
||||
if (client.isOpen()) {
|
||||
Log.i("JWebSocketClientService", "websocket已连接");
|
||||
sendMsg();
|
||||
} else if (client.isClosed()) {
|
||||
Log.i("JWebSocketClientService", "websocket重连中");
|
||||
if (JgyUtils.getInstance().isScreenOn()) {
|
||||
reconnectWs();
|
||||
} else {
|
||||
Log.i("JWebSocketClientService", "reconnectWs off");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//如果client已为空,重新初始化连接
|
||||
client = null;
|
||||
if (client == null) {
|
||||
initSocketClient();
|
||||
return;
|
||||
}
|
||||
|
||||
if (client.isOpen()) {
|
||||
Log.i("JWebSocketClientService", "websocket已连接");
|
||||
sendMsg();
|
||||
} else if (client.isClosed()) {
|
||||
Log.i("JWebSocketClientService", "websocket重连中");
|
||||
if (JgyUtils.getInstance().isScreenOn()) {
|
||||
reconnectWs();
|
||||
} else {
|
||||
Log.i("JWebSocketClientService", "reconnectWs off");
|
||||
}
|
||||
}
|
||||
|
||||
//每隔一定的时间,对长连接进行一次心跳检测
|
||||
if (JgyUtils.getInstance().isScreenOn()) {
|
||||
mHandler.postDelayed(this, HEART_BEAT_RATE);
|
||||
|
||||
@@ -804,6 +804,9 @@ public class JgyUtils {
|
||||
} else {
|
||||
Settings.System.putString(context.getContentResolver(), "aole_app_info", String.join(",", pkgSet));
|
||||
}
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
AllwinnerCubeMdmManager.getInstance().setDisallowNotification(new ArrayList<>(pkgSet));
|
||||
}
|
||||
}
|
||||
|
||||
public void setAllowPermissionsPackage() {
|
||||
@@ -816,6 +819,9 @@ public class JgyUtils {
|
||||
} else {
|
||||
Settings.System.putString(crv, "aole_app_privilege", String.join(",", pkgSet));
|
||||
}
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
AllwinnerCubeMdmManager.getInstance().setDefaultPermissions(new ArrayList<>(pkgSet));
|
||||
}
|
||||
}
|
||||
|
||||
public static final Set<String> DEFAULT_ALLOW_NETWORK_APP_SET = new HashSet<String>() {{
|
||||
@@ -1384,7 +1390,10 @@ public class JgyUtils {
|
||||
public void SettingSysData(String data) {
|
||||
if (TextUtils.isEmpty(data)) {
|
||||
Log.e(TAG, "SettingSysData: " + "data is empty");
|
||||
SysSettingUtils.setDisableSetting(mContext);
|
||||
int locked = Settings.System.getInt(crv, JGYActions.ACTION_QCH_UNLOCK_IPAD, JGYActions.FRAME_CODE_LOCKED);
|
||||
if (locked==JGYActions.FRAME_CODE_LOCKED) {
|
||||
SysSettingUtils.setDisableSetting(mContext);
|
||||
}
|
||||
SPUtils.put(mContext, JGYActions.ACTION_STATUSBAR_STATUS, "");
|
||||
} else {
|
||||
if (JgyUtils.getInstance().getAppPlatform().equals(JgyUtils.ZR6016Tag)) {
|
||||
@@ -3705,7 +3714,7 @@ public class JgyUtils {
|
||||
}
|
||||
Log.e(TAG, "setAllwinnerDefaulBrowser: " + pkg);
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
AllwinnerCubeMdmManager.getInstance().setDefaultInputMethod(pkg);
|
||||
AllwinnerCubeMdmManager.getInstance().setDefaultBrowser(pkg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,11 +115,12 @@ public class SysSettingUtils {
|
||||
*/
|
||||
public static void setEnableSetting(Context context) {
|
||||
Toaster.debugShow("打开所有功能");
|
||||
Log.e(TAG, "setEnableSetting: ");
|
||||
setPhoneList(context, 0);
|
||||
if (JgyUtils.C2Tag.equalsIgnoreCase(JgyUtils.getInstance().getAppPlatform())) {
|
||||
openMtp(context);
|
||||
}
|
||||
// setUSBstate(context, 0);
|
||||
setUsbStatus(context, 0);
|
||||
setBluetooth(context, 0);
|
||||
setHotspot(context, 0);
|
||||
setBar(context, 0);
|
||||
@@ -191,19 +192,21 @@ public class SysSettingUtils {
|
||||
}
|
||||
|
||||
private static void setUsbStatus(Context context, int state) {
|
||||
Log.e(TAG, "setUsbStatus: " + state);
|
||||
//USB数据功能管控
|
||||
//仅充电:usb_charge
|
||||
//MTP模式:usb_mtp
|
||||
//Midi模式:usb_midi
|
||||
if (!BuildConfig.DEBUG) {
|
||||
if (JgyUtils.isCubeDevice()) {
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
AllwinnerCubeMdmManager.getInstance().setUsbStatus(state);
|
||||
} else {
|
||||
SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
mService.setUsbDataDisabled(true);
|
||||
}
|
||||
// if (!BuildConfig.DEBUG) {
|
||||
if (JgyUtils.isCubeDevice()) {
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
AllwinnerCubeMdmManager.getInstance().setUsbStatus(state);
|
||||
} else {
|
||||
SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
mService.setUsbDataDisabled(true);
|
||||
}
|
||||
} else {
|
||||
if (state == 0) {
|
||||
String oldUsb = Settings.System.getString(context.getContentResolver(), "aole_usb_choose");
|
||||
if ("usb_charge".equals(oldUsb)) {
|
||||
Log.e(TAG, "setUsbStatus: oldUsb = " + oldUsb + " no changed , skip");
|
||||
@@ -211,30 +214,35 @@ public class SysSettingUtils {
|
||||
}
|
||||
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", "usb_charge");
|
||||
Log.e("setUsbStatus", "aole_usb_choose: " + aole_usb_choose);
|
||||
String usbStatus;
|
||||
switch (state) {
|
||||
default:
|
||||
case 0:
|
||||
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
|
||||
JgyUtils.getInstance().setMtpEnable(false);
|
||||
break;
|
||||
case 1:
|
||||
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
|
||||
JgyUtils.getInstance().setMtpEnable(true);
|
||||
break;
|
||||
}
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AH6016Platform) {
|
||||
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
|
||||
}
|
||||
Intent usbIntent = new Intent(usbStatus);
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.TeclastP20sPlatform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AH6016Platform
|
||||
) {
|
||||
usbIntent.setPackage("com.android.settings");
|
||||
}
|
||||
context.sendBroadcast(usbIntent);
|
||||
} else {
|
||||
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", "usb_mtp");
|
||||
Log.e("setUsbStatus", "aole_usb_choose: " + aole_usb_choose);
|
||||
}
|
||||
String usbStatus;
|
||||
switch (state) {
|
||||
default:
|
||||
case 0:
|
||||
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE;
|
||||
JgyUtils.getInstance().setMtpEnable(false);
|
||||
break;
|
||||
case 1:
|
||||
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
|
||||
JgyUtils.getInstance().setMtpEnable(true);
|
||||
break;
|
||||
}
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AH6016Platform) {
|
||||
usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP;
|
||||
}
|
||||
Intent usbIntent = new Intent(usbStatus);
|
||||
if (JgyUtils.getInstance().checkAppPlatform() == JgyUtils.TeclastP20sPlatform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.AH6016Platform
|
||||
|| JgyUtils.getInstance().checkAppPlatform() == JgyUtils.seewoPlatform
|
||||
) {
|
||||
usbIntent.setPackage("com.android.settings");
|
||||
}
|
||||
context.sendBroadcast(usbIntent);
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
private static void setUsbStatus(Context context, JsonObject jsonObject) {
|
||||
@@ -867,6 +875,10 @@ public class SysSettingUtils {
|
||||
}
|
||||
what |= integer;
|
||||
}
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
AllwinnerCubeMdmManager.getInstance().setHomeEnable(home == 1);
|
||||
AllwinnerCubeMdmManager.getInstance().setRecentsEnable(taskbar == 1);
|
||||
}
|
||||
StatusBarManager mStatusBarManager = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE);
|
||||
mStatusBarManager.disable(what);
|
||||
}
|
||||
@@ -879,6 +891,10 @@ public class SysSettingUtils {
|
||||
StatusBarManager mStatusBarManager = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE);
|
||||
mStatusBarManager.disable(StatusBarManager.DISABLE_BACK | StatusBarManager.DISABLE_RECENT | StatusBarManager.DISABLE_HOME);
|
||||
mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);//显示隐藏的虚拟按键
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
AllwinnerCubeMdmManager.getInstance().setHomeEnable(true);
|
||||
AllwinnerCubeMdmManager.getInstance().setRecentsEnable(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -888,33 +904,19 @@ public class SysSettingUtils {
|
||||
* @param context
|
||||
* @param jsonObject
|
||||
*/
|
||||
// TODO: 2025/7/14 待优化,逻辑太差了
|
||||
private static void setBrowserInput(Context context, JsonObject jsonObject) {
|
||||
int state = 1;
|
||||
try {
|
||||
state = jsonObject.get("setting_browserInput").getAsInt();
|
||||
Log.e(TAG, "setBrowserInput: setting_browserInput = " + state);
|
||||
String json = jsonObject.get("setting_browserInput").getAsString();
|
||||
if (TextUtils.isEmpty(json)) {
|
||||
state = 1;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "setBrowserInput: e: " + e.getMessage());
|
||||
}
|
||||
Log.e(TAG, "setBrowserInput: " + state);
|
||||
//后台没有这个选项默认打开
|
||||
if (state == 0) {
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 1);
|
||||
} else {
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 0);
|
||||
}
|
||||
|
||||
if (jsonObject.get("is_browser_network") != null) {
|
||||
int is_browser_network = jsonObject.get("is_browser_network").getAsInt();
|
||||
Log.e(TAG, "setBrowserInput: is_browser_network = " + is_browser_network);
|
||||
Settings.Global.putInt(context.getContentResolver(), "is_browser_network", is_browser_network);
|
||||
}
|
||||
|
||||
if (jsonObject.get("setting_browserInput") != null) {
|
||||
int qch_Browser_input = jsonObject.get("setting_browserInput").getAsInt();
|
||||
Log.e(TAG, "setBrowserInput: qch_Browser_input = " + qch_Browser_input);
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", qch_Browser_input);
|
||||
}
|
||||
|
||||
if (jsonObject.get("browser_down") != null) {
|
||||
int browser_down = jsonObject.get("browser_down").getAsInt();
|
||||
Settings.System.putInt(context.getContentResolver(), "aoleyun_browser_down", browser_down);
|
||||
@@ -928,8 +930,8 @@ public class SysSettingUtils {
|
||||
* @param state
|
||||
*/
|
||||
private static void setBrowserInput(Context context, int state) {
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 0);
|
||||
Settings.Global.putInt(context.getContentResolver(), "is_browser_network", changeNum(state));
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", state);
|
||||
Settings.Global.putInt(context.getContentResolver(), "is_browser_network", state);
|
||||
Settings.System.putInt(context.getContentResolver(), "aoleyun_browser_down", state);
|
||||
}
|
||||
|
||||
@@ -1225,6 +1227,9 @@ public class SysSettingUtils {
|
||||
break;
|
||||
}
|
||||
context.sendBroadcast(intent);
|
||||
if (JgyUtils.isAllWinnerDevice()) {
|
||||
AllwinnerCubeMdmManager.getInstance().setNotificationEnable(status == 1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void setPanelShow(Context context, JsonObject jsonObject) {
|
||||
|
||||
9
app/src/main/res/drawable/ic_device_lock.xml
Normal file
9
app/src/main/res/drawable/ic_device_lock.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="80dp"
|
||||
android:height="80dp"
|
||||
android:viewportWidth="1024"
|
||||
android:viewportHeight="1024">
|
||||
<path
|
||||
android:pathData="M469.33,85.33a213.33,213.33 0,0 0,-213.33 213.33v42.67a170.67,170.67 0,0 0,-170.67 170.67v256a170.67,170.67 0,0 0,170.67 170.67h512a170.67,170.67 0,0 0,170.67 -170.67v-256a170.67,170.67 0,0 0,-170.67 -170.67L768,298.67a213.33,213.33 0,0 0,-213.33 -213.33h-85.33zM256,426.67h512a85.33,85.33 0,0 1,85.33 85.33v256a85.33,85.33 0,0 1,-85.33 85.33L256,853.33a85.33,85.33 0,0 1,-85.33 -85.33v-256a85.33,85.33 0,0 1,85.33 -85.33zM341.33,298.67a128,128 0,0 1,128 -128h85.33a128,128 0,0 1,128 128v42.67L341.33,341.33L341.33,298.67zM469.33,554.67a42.67,42.67 0,1 0,0 85.33h85.33a42.67,42.67 0,1 0,0 -85.33h-85.33z"
|
||||
android:fillColor="#2c2c2c"/>
|
||||
</vector>
|
||||
@@ -117,6 +117,19 @@
|
||||
android:layout_weight="2"
|
||||
android:background="@drawable/card_background">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_lock_status"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_device_lock"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_head"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
|
||||
@@ -123,6 +123,19 @@
|
||||
android:layout_weight="2"
|
||||
android:background="@drawable/card_background">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_lock_status"
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:adjustViewBounds="true"
|
||||
android:scaleType="centerInside"
|
||||
android:src="@drawable/ic_device_lock"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_head"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
|
||||
Reference in New Issue
Block a user