Browse Source

1.添加应用自动拉起时和星火云鸽学生端app的联动退出。

20241218TB223FC(测试jar包)
wangwanlei 2 months ago
parent
commit
9bc45590e9

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

@@ -128,6 +128,8 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
128 128
     //标记当前是否锁定
129 129
     private var mainLockFlag = false
130 130
     private var autoAppFlag = true
131
+    //标记是否来自广播退出登录
132
+    private var loginoutFlag=false
131 133
 
132 134
     private var accountDialog: CustomDialog? = null
133 135
     private var quitAccountDialog: CustomDialog? = null
@@ -1179,7 +1181,8 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
1179 1181
             mBinding.lockLlayout.visibility = View.GONE
1180 1182
         }
1181 1183
         LogShow("锁定了吧" + mainLockFlag + "|||" + autoAppFlag)
1182
-        if (autoAppFlag) {
1184
+        //自动退出时优先退出而不是拉起app
1185
+        if (autoAppFlag&&!loginoutFlag) {
1183 1186
             userBean?.let {
1184 1187
                 viewModel.postAutoAppDetail(it.regionid)
1185 1188
             }
@@ -1457,6 +1460,8 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
1457 1460
             }
1458 1461
 
1459 1462
             Const.ACCOUNTLOGINOUT -> {
1463
+                //退出则不拉起app
1464
+                loginoutFlag=true
1460 1465
                 loginOut()
1461 1466
             }
1462 1467
 
@@ -1937,6 +1942,8 @@ class MainActivity : BaseActivity<MainViewModel, ActivityMainBinding>(), Downloa
1937 1942
     }
1938 1943
 
1939 1944
     private fun loginOut(hasUser: Boolean = true) {
1945
+        //退出登录时默认关闭usb调试
1946
+        ManageApplication.enableUsbDebugging(false)
1940 1947
         //没有用户信息时,判断为初次调用,直接跳转登录页面
1941 1948
         if (hasUser) {
1942 1949
             //调用接口传递退出事件,成功则退出登录

Loading…
Cancel
Save