|
@@ -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) {
|