I tried to create a overlay app for android 11 and I see that I can't use the
<uses-permission android:name="android.permission.TYPE_APPLICATION_OVERLAY" />
in android 11 only if this is a system app so I make it for a system app and I still not able to preform a system overlay I get this error
Caused by: android.view.WindowManager$BadTokenException: Unable to add window android.view.ViewRootImpl$W@10f390 -- permission denied for window type 2006
https://developer.android.com/reference/android/view/WindowManager.LayoutParams#TYPE_APPLICATION_OVERLAY
Your TYPE_APPLICATION_OVERLAY requires
Data can be found https://developer.android.com/reference/android/Manifest.permission#SYSTEM_ALERT_WINDOW
Did you request that specific permission and did you grant it? (Even though if you are system app it's probably granted