In this receiver, I check
SYSTEM_ALERT_WINDOW permission by using
Settings.canDrawOverlays(context) . When I run this in Android Studio, it works well. However, permission is not checked when built with apk only on Android 13. Returns false even though you have permission. Sometimes, an error occurs when calling addView within Worker even if the permission is correctly confirmed on the broadcast
When receiving a phone call or text message, WindowManager.addView is called within the same worker, but the view is normally displayed when receiving a text message, and there is no permission when receiving a phone call. For your information, I’m testing with Samsung Galaxy Note20 Ultra.