SYSTEM_ALERT_WINDOW stop working after a while for kde connect

hey guys, I’m trying to sync clipboard from my android phone to Windows automatically. This device is not rooted, so I’m using the Log Reading way. The problem is that clipboard sync stop working after a while(1 or 2 hours maybe?). Redo adb.exe shell appops set org.kde.kdeconnect_tp SYSTEM_ALERT_WINDOW allow; makes it work but it fails again after a while. I tried googling shell appops ... allow but found no useful infomation.

Below is the logs when I do a copy from my phone(when it’s not working).

10-04 21:42:12.948  7297 15773 D AppScoutStateMachine: 7297-ScoutStateMachinecreated
10-04 21:42:12.951  7297  7297 D MiuiMultiWindowAdapter: MiuiMultiWindowAdapter::getFreeformVideoWhiteListInSystem::LIST_ABOUT_SUPPORT_LANDSCAPE_VIDEO = [com.hunantv.imgo.activity, com.tencent.qqlive, com.qiyi.video, com.hunantv.imgo.activity.inter, com.tencent.qqlivei18n, com.iqiyi.i18n, tv.danmaku.bili]
10-04 21:42:12.953  7297  7297 E e.kdeconnect_tp: Invalid ID 0x00000000.
10-04 21:42:12.954  7297 15796 D ViewContentFactory: initViewContentFetcherClass
10-04 21:42:12.955  7297 15796 I ContentCatcher: ViewContentFetcher : ViewContentFetcher
10-04 21:42:12.955  7297 15796 D ViewContentFactory: createInterceptor took 0ms
10-04 21:42:12.955  7297  7297 D IS_CTS_MODE: false
10-04 21:42:12.955  7297  7297 D MULTI_WINDOW_ENABLED: false
10-04 21:42:12.955  7297  7297 D DecorView[]: getWindowModeFromSystem  windowmode is 1
10-04 21:42:12.993  7297 15793 W Parcel  : Expecting binder but got null!
10-04 21:42:13.081  7297  7297 D DecorView[]: onWindowFocusChanged hasWindowFocus true
10-04 21:42:13.082  7297  7297 I HandWritingStubImpl: refreshLastKeyboardType: 1
10-04 21:42:13.082  7297  7297 I HandWritingStubImpl: getCurrentKeyboardType: 1
10-04 21:42:13.094  7297  7297 I HandWritingStubImpl: isKeyboardTypeChanged: false
10-04 21:42:13.095  7297  7297 D DecorView[]: onWindowFocusChanged hasWindowFocus false

(when it’s working)

10-04 22:14:39.586  7297  7297 D MiuiMultiWindowAdapter: MiuiMultiWindowAdapter::getFreeformVideoWhiteListInSystem::LIST_ABOUT_SUPPORT_LANDSCAPE_VIDEO = [com.hunantv.imgo.activity, com.tencent.qqlive, com.qiyi.video, com.hunantv.imgo.activity.inter, com.tencent.qqlivei18n, com.iqiyi.i18n, tv.danmaku.bili]
10-04 22:14:39.592  7297  7297 E e.kdeconnect_tp: Invalid ID 0x00000000.
10-04 22:14:39.594  7297  7297 D IS_CTS_MODE: false
10-04 22:14:39.594  7297  7297 D MULTI_WINDOW_ENABLED: false
10-04 22:14:39.595  7297  7297 D DecorView[]: getWindowModeFromSystem  windowmode is 1
10-04 22:14:39.595  7297 15796 D ViewContentFactory: initViewContentFetcherClass
10-04 22:14:39.596  7297 15796 I ContentCatcher: ViewContentFetcher : ViewContentFetcher
10-04 22:14:39.596  7297 15796 D ViewContentFactory: createInterceptor took 0ms
10-04 22:14:39.598  7297 15773 D AppScoutStateMachine: 7297-ScoutStateMachinecreated
10-04 22:14:39.633  7297 15793 W Parcel  : Expecting binder but got null!
10-04 22:14:39.729  7297  7297 D DecorView[]: onWindowFocusChanged hasWindowFocus true
10-04 22:14:39.729  7297  7297 I HandWritingStubImpl: refreshLastKeyboardType: 1
10-04 22:14:39.729  7297  7297 I HandWritingStubImpl: getCurrentKeyboardType: 1
10-04 22:14:39.742  7297  7297 I HandWritingStubImpl: isKeyboardTypeChanged: false
10-04 22:14:39.742  7297  7297 D DecorView[]: onWindowFocusChanged hasWindowFocus false
10-04 22:14:39.855  7297  7297 D MiuiMultiWindowAdapter: MiuiMultiWindowAdapter::getFreeformVideoWhiteListInSystem::LIST_ABOUT_SUPPORT_LANDSCAPE_VIDEO = [com.hunantv.imgo.activity, com.tencent.qqlive, com.qiyi.video, com.hunantv.imgo.activity.inter, com.tencent.qqlivei18n, com.iqiyi.i18n, tv.danmaku.bili]
10-04 22:14:39.858  7297  7297 E e.kdeconnect_tp: Invalid ID 0x00000000.
10-04 22:14:39.858  7297 15779 D AppScoutStateMachine: 7297-ScoutStateMachinecreated
10-04 22:14:39.859  7297 15796 D ViewContentFactory: initViewContentFetcherClass
10-04 22:14:39.859  7297 15796 I ContentCatcher: ViewContentFetcher : ViewContentFetcher
10-04 22:14:39.859  7297 15796 D ViewContentFactory: createInterceptor took 0ms
10-04 22:14:39.859  7297  7297 D IS_CTS_MODE: false
10-04 22:14:39.859  7297  7297 D MULTI_WINDOW_ENABLED: false
10-04 22:14:39.861  7297  7297 D DecorView[]: getWindowModeFromSystem  windowmode is 1
10-04 22:14:39.886  7297 15793 W Parcel  : Expecting binder but got null!
10-04 22:14:39.963  7297  7297 D DecorView[]: onWindowFocusChanged hasWindowFocus true
10-04 22:14:39.963  7297  7297 I HandWritingStubImpl: refreshLastKeyboardType: 1
10-04 22:14:39.963  7297  7297 I HandWritingStubImpl: getCurrentKeyboardType: 1
10-04 22:14:39.973  7297  7297 I HandWritingStubImpl: isKeyboardTypeChanged: false
10-04 22:14:39.980  7297  7297 D DecorView[]: onWindowFocusChanged hasWindowFocus false

My device is running on Android13 MIUI14.0.9