|
@@ -307,18 +307,20 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
|
307
|
307
|
LogShow("冻结失败" + e.toString())
|
308
|
308
|
}
|
309
|
309
|
unInstallAppList.clear()
|
310
|
|
- appList.forEach { app ->
|
311
|
|
- val filter = modelList.filter { it.appPackage.equals(app.packageName) }
|
312
|
|
- val appInfos = firstAppList.filter { app.packageName.equals(it) }
|
313
|
|
- //接口列表以及初始化列表中不存在则将应用冻结或者卸载,目前是卸载
|
314
|
|
- LogShow("${app.name},被冻结" + (filter.isEmpty() && appInfos.isEmpty()))
|
315
|
|
- if (filter.isEmpty() && appInfos.isEmpty()) {
|
316
|
|
- unInstallAppList.add(app)
|
317
|
|
- //ManageApplication.setPackageEnabled(app.packageName, (filter.isNotEmpty()))
|
318
|
|
- ManageApplication.uninstallPackage(app.packageName)
|
|
310
|
+ if (modelList.size>0){
|
|
311
|
+ //modelList为0表示未打开应用策略,不删除应用
|
|
312
|
+ appList.forEach { app ->
|
|
313
|
+ val filter = modelList.filter { it.appPackage.equals(app.packageName) }
|
|
314
|
+ val appInfos = firstAppList.filter { app.packageName.equals(it) }
|
|
315
|
+ //接口列表以及初始化列表中不存在则将应用冻结或者卸载,目前是卸载
|
|
316
|
+ LogShow("${app.name},被冻结" + (filter.isEmpty() && appInfos.isEmpty()))
|
|
317
|
+ if (filter.isEmpty() && appInfos.isEmpty()) {
|
|
318
|
+ unInstallAppList.add(app)
|
|
319
|
+ //ManageApplication.setPackageEnabled(app.packageName, (filter.isNotEmpty()))
|
|
320
|
+ ManageApplication.uninstallPackage(app.packageName)
|
|
321
|
+ }
|
319
|
322
|
}
|
320
|
323
|
}
|
321
|
|
-
|
322
|
324
|
}
|
323
|
325
|
}
|
324
|
326
|
}
|