File tree Expand file tree Collapse file tree
app/src/main/java/com/fankes/coloros/notify Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ class NotifyIconRuleUpdateActivity : Activity() {
4343 View .SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN or View .SYSTEM_UI_FLAG_LAYOUT_STABLE
4444 window?.addFlags(WindowManager .LayoutParams .FLAG_TRANSLUCENT_STATUS )
4545 window?.addFlags(WindowManager .LayoutParams .FLAG_TRANSLUCENT_NAVIGATION )
46+ /* * 注册 */
47+ SystemUITool .register(context = this )
4648 /* * 检测运行状态 */
4749 if (BaseActivity .isMainThreadRunning) {
4850 finish()
4951 return
5052 }
51- /* * 注册 */
52- SystemUITool .register(context = this )
5353 /* * 拉取云端数据 */
5454 IconRuleManagerTool .sync(appContext) {
5555 /* * 刷新系统界面 */
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ object SystemUITool {
4747 * 注册广播
4848 * @param context 实例
4949 */
50- fun register (context : Context ) {
50+ fun register (context : Context ) = runInSafe {
5151 /* * 注册广播检查模块激活状态 */
5252 context.registerReceiver(moduleHandlerReceiver, IntentFilter ().apply { addAction(Const .ACTION_MODULE_HANDLER_RECEIVER ) })
5353 /* * 注册广播通知系统界面改变 */
@@ -58,7 +58,7 @@ object SystemUITool {
5858 * 取消注册广播
5959 * @param context 实例
6060 */
61- fun unregister (context : Context ) {
61+ fun unregister (context : Context ) = runInSafe {
6262 context.unregisterReceiver(moduleHandlerReceiver)
6363 context.unregisterReceiver(remindHandlerReceiver)
6464 }
You can’t perform that action at this time.
0 commit comments