Browse Source

1.添加2008注销消息

2.增加策略更新后的提示。
20241218TB223FC(测试jar包)
wangwanlei 8 months ago
parent
commit
c67ee26c06

+ 0
- 1
app/src/main/java/com/xhly/manageapp/AppAdapter.kt View File

@@ -58,7 +58,6 @@ class AppAdapter(var context: Context, var data: ArrayList<AppInfo>) :
58 58
                     it.changeCode()
59 59
                 }
60 60
             }else if (appInfo.packageName.equals(Const.UPDATESTRATEGYPKGNAME)){
61
-                Toaster.show(R.string.updatetips)
62 61
                 UIEvent(Const.CODE2004.toString()).post()
63 62
             }else if (appInfo.packageName.equals(Const.STOREAPPPKG)){
64 63
                 //跳转应用商店

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

@@ -82,6 +82,10 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
82 82
     private var userBean: UserBean? = null
83 83
     private var timer: Timer? = null
84 84
     private val currentSpUtils by lazy { CurrentAppSharedPreferencesUtils.getInstance(this) }
85
+    //标记是否请求了时间策略
86
+    private var updateTimeFlag=false
87
+    //标记是否请求了应用策略,都为真则提示
88
+    private var updateStrategyFlag=false
85 89
     override fun getBinding() = ActivityMainBinding.inflate(layoutInflater)
86 90
 
87 91
     override fun initData() {
@@ -181,6 +185,7 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
181 185
         viewModel.appStrategyData.observe(this) {
182 186
             //存储app时间策略
183 187
             spUtils.saveJson(Const.APPSTRATEGYBEANKEY, it)
188
+            showSucessToast()
184 189
         }
185 190
         viewModel.padInfoData.observe(this) {
186 191
             //存储信息上传时间
@@ -259,6 +264,10 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
259 264
         updateAllStrategy()
260 265
     }
261 266
 
267
+    private fun showSucessToast() {
268
+        Toaster.show(R.string.updatetips)
269
+    }
270
+
262 271
 
263 272
     override fun onNewIntent(intent: Intent?) {
264 273
         super.onNewIntent(intent)
@@ -693,6 +702,12 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>() {
693 702
                 StrategyUtils.releaseControl(this)
694 703
             }
695 704
 
705
+            Const.CODE2008.toString() -> {
706
+                postLogPush(8)
707
+                currentSpUtils.setParam(Const.EXIT_CONTROL,true)
708
+                StrategyUtils.releaseControl(this)
709
+            }
710
+
696 711
             Const.LOGAPPSTART -> {
697 712
                 val message = uiEvent.message
698 713
                 if (Const.LASTPKGNAME == message) {

+ 1
- 1
app/src/main/res/values/strings.xml View File

@@ -42,6 +42,6 @@
42 42
     <string name="syncsucess">同步完成。</string>
43 43
     <string name="exitcontrol">解除管控</string>
44 44
     <string name="updatestrategy">更新策略</string>
45
-    <string name="updatetips">开始请求策略</string>
45
+    <string name="updatetips">策略更新完成</string>
46 46
     <string name="checkcode">密码校验</string>
47 47
 </resources>

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

@@ -104,6 +104,8 @@ object Const {
104 104
     //解除管控
105 105
     const val CODE2007 = 2007
106 106
 
107
+    //解除绑定
108
+    const val CODE2008 = 2008
107 109
 
108 110
     /**
109 111
      * 违规事件自动调用的锁定

+ 4
- 0
websocket/src/main/java/com/xhly/websocket/utils/SocketPushUtils.kt View File

@@ -67,6 +67,10 @@ object SocketPushUtils {
67 67
                         //解除管控
68 68
                         UIEvent(Const.CODE2007.toString()).post()
69 69
                     }
70
+                    Const.CODE2008->{
71
+                        //解除绑定,我调用退出登录
72
+                        UIEvent(Const.CODE2008.toString()).post()
73
+                    }
70 74
 
71 75
                     Const.CODE3002 -> {
72 76
                         //违规事件自动调用的限制使用

Loading…
Cancel
Save