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
                     it.changeCode()
58
                     it.changeCode()
59
                 }
59
                 }
60
             }else if (appInfo.packageName.equals(Const.UPDATESTRATEGYPKGNAME)){
60
             }else if (appInfo.packageName.equals(Const.UPDATESTRATEGYPKGNAME)){
61
-                Toaster.show(R.string.updatetips)
62
                 UIEvent(Const.CODE2004.toString()).post()
61
                 UIEvent(Const.CODE2004.toString()).post()
63
             }else if (appInfo.packageName.equals(Const.STOREAPPPKG)){
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
     private var userBean: UserBean? = null
82
     private var userBean: UserBean? = null
83
     private var timer: Timer? = null
83
     private var timer: Timer? = null
84
     private val currentSpUtils by lazy { CurrentAppSharedPreferencesUtils.getInstance(this) }
84
     private val currentSpUtils by lazy { CurrentAppSharedPreferencesUtils.getInstance(this) }
85
+    //标记是否请求了时间策略
86
+    private var updateTimeFlag=false
87
+    //标记是否请求了应用策略,都为真则提示
88
+    private var updateStrategyFlag=false
85
     override fun getBinding() = ActivityMainBinding.inflate(layoutInflater)
89
     override fun getBinding() = ActivityMainBinding.inflate(layoutInflater)
86
 
90
 
87
     override fun initData() {
91
     override fun initData() {
181
         viewModel.appStrategyData.observe(this) {
185
         viewModel.appStrategyData.observe(this) {
182
             //存储app时间策略
186
             //存储app时间策略
183
             spUtils.saveJson(Const.APPSTRATEGYBEANKEY, it)
187
             spUtils.saveJson(Const.APPSTRATEGYBEANKEY, it)
188
+            showSucessToast()
184
         }
189
         }
185
         viewModel.padInfoData.observe(this) {
190
         viewModel.padInfoData.observe(this) {
186
             //存储信息上传时间
191
             //存储信息上传时间
259
         updateAllStrategy()
264
         updateAllStrategy()
260
     }
265
     }
261
 
266
 
267
+    private fun showSucessToast() {
268
+        Toaster.show(R.string.updatetips)
269
+    }
270
+
262
 
271
 
263
     override fun onNewIntent(intent: Intent?) {
272
     override fun onNewIntent(intent: Intent?) {
264
         super.onNewIntent(intent)
273
         super.onNewIntent(intent)
693
                 StrategyUtils.releaseControl(this)
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
             Const.LOGAPPSTART -> {
711
             Const.LOGAPPSTART -> {
697
                 val message = uiEvent.message
712
                 val message = uiEvent.message
698
                 if (Const.LASTPKGNAME == message) {
713
                 if (Const.LASTPKGNAME == message) {

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

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

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

104
     //解除管控
104
     //解除管控
105
     const val CODE2007 = 2007
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
                         //解除管控
67
                         //解除管控
68
                         UIEvent(Const.CODE2007.toString()).post()
68
                         UIEvent(Const.CODE2007.toString()).post()
69
                     }
69
                     }
70
+                    Const.CODE2008->{
71
+                        //解除绑定,我调用退出登录
72
+                        UIEvent(Const.CODE2008.toString()).post()
73
+                    }
70
 
74
 
71
                     Const.CODE3002 -> {
75
                     Const.CODE3002 -> {
72
                         //违规事件自动调用的限制使用
76
                         //违规事件自动调用的限制使用

Loading…
Cancel
Save