Browse Source

1.x505f默认冻结日历和必应浏览器。

2.处理对日历的管控,学校设置可以控制日历是否冻结和显示与隐藏。
20241218TB223FC(测试jar包)
wangwanlei 5 months ago
parent
commit
7afdb769c3

+ 8
- 2
app/src/main/java/com/xhly/manageapp/ui/main/activity/MainActivity.kt View File

@@ -838,7 +838,6 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
838 838
 
839 839
     override fun onResume() {
840 840
         super.onResume()
841
-        LogShow("执行onresume")
842 841
         isResumeFlag = true
843 842
         Const.startAppStoreFlag = false
844 843
         updateNetErrorAppRv()
@@ -905,7 +904,6 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
905 904
     }
906 905
 
907 906
     private fun updateAllStrategy() {
908
-        LogShow("请求策略锁定了吧")
909 907
         Const.backNum = 0
910 908
         userBean?.let {
911 909
             Const.USERID = it.userid
@@ -1705,6 +1703,14 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
1705 1703
             //获得预装应用和商店应用,商店应用(隐藏图标的不显示)和预装重叠直接显示,其余预装直接隐藏
1706 1704
             var schoolDeviceSetBean: SchoolDeviceSetBean? = null
1707 1705
             schoolDeviceSetBean = StrategyUtils.getSchoolDeviceSetBean(this)
1706
+            schoolDeviceSetBean?.let {
1707
+                if (it.calendar==0){
1708
+                    //如果不隐藏日历则需要先解除冻结,否则继续冻结,需要优先处理否则之后会存在读取不到日历安装包的情况
1709
+                    ManageApplication.setPackageEnabled(Const.ANDROIDCALENDAR,true)
1710
+                }else{
1711
+                    ManageApplication.setPackageEnabled(Const.ANDROIDCALENDAR,false)
1712
+                }
1713
+            }
1708 1714
             val storeList = arrayListOf<String>()
1709 1715
             val storeRemoveList = arrayListOf<String>()
1710 1716
             //获得已安装app

+ 13
- 0
app/src/main/java/com/xhly/manageapp/utils/StrategyUtils.kt View File

@@ -396,6 +396,12 @@ object StrategyUtils {
396 396
               //关闭网络白名单
397 397
               ManageApplication.setUrlWhiteListEnable(false)
398 398
               ManageApplication.setLockScreenMode(1)
399
+              //X505F默认应用解除应用冻结
400
+              Const.X505FBANAPPLIST.forEach {
401
+                  if (ModelNameUtils.IS_LianxX505f()){
402
+                      ManageApplication.setPackageEnabled(it,true)
403
+                  }
404
+              }
399 405
               //清除数据
400 406
               WorkManager.getInstance(context).cancelAllWork()
401 407
               context.deleteSharedPreferences(SharedPreferencesUtils.SP_FILE_NAME)
@@ -452,7 +458,14 @@ object StrategyUtils {
452 458
             ManageApplication.hideMenuSoftKey(true)
453 459
             ManageApplication.enableAccessibility()
454 460
             ManageApplication.setLockScreenMode()
461
+            //冻结默认启动器
455 462
             ManageApplication.setPackageEnabled("com.tblenovo.launcher",false)
463
+            //X505F冻结默认应用
464
+            Const.X505FBANAPPLIST.forEach {
465
+                if (ModelNameUtils.IS_LianxX505f()){
466
+                    ManageApplication.setPackageEnabled(it,false)
467
+                }
468
+            }
456 469
             ManageApplication.setCustomLauncher(
457 470
                 Const.CURRENTAPPPKG,
458 471
                 Const.CURRENTAPPPKG + ".ui.ManageActivity"

+ 13
- 0
corelib/src/main/java/com/xhly/corelib/Const.kt View File

@@ -315,6 +315,19 @@ object Const {
315 315
      */
316 316
     const val LENOVOSEETING="com.android.settings"
317 317
 
318
+    /**
319
+     * 必应浏览器 x505f
320
+     */
321
+    const val BINGINTLX505F="com.microsoft.bingintl"
322
+
323
+    /**
324
+     * x505f 默认冻结的应用,解除管控时解除
325
+     */
326
+    val X505FBANAPPLIST= arrayListOf(
327
+        ANDROIDCALENDAR,
328
+        BINGINTLX505F
329
+    )
330
+
318 331
     /**
319 332
      * 这几个应用由学校设置接口处理
320 333
      */

Loading…
Cancel
Save