I have a problem when trying to use startActivity from my service.
I am using ADB command - "appops set com.nexperience.android SYSTEM_ALERT_WINDOW allow" to give the app the permission to start activities from the background.
my service worked fine with Android 10 and below. The devices I am using are: pixel 2, pixel 3 xl, pixel 4 , pixel 4 a and pixel 5.
the exception:
IntentStarted during UNKNOWN. Intent { cmp=com.nexperience.android/.MPScreenCapActivity (has extras) }
<200804 11:32:15.446> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] java.lang.Throwable: EventSequenceValidator#getStackTrace
<200804 11:32:15.447> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at com.google.android.startop.iorap.EventSequenceValidator.logWarningWithStackTrace(EventSequenceValidator.java:260)
<200804 11:32:15.447> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at com.google.android.startop.iorap.EventSequenceValidator.onIntentStarted(EventSequenceValidator.java:106)
<200804 11:32:15.447> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at com.android.server.wm.LaunchObserverRegistryImpl.handleOnIntentStarted(LaunchObserverRegistryImpl.java:139)
<200804 11:32:15.447> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at com.android.server.wm.LaunchObserverRegistryImpl.lambda$veRn_GhgLZLlOHOJ0ZYT6KcfYqo(Unknown Source:0)
<200804 11:32:15.447> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at com.android.server.wm.-$$Lambda$LaunchObserverRegistryImpl$veRn_GhgLZLlOHOJ0ZYT6KcfYqo.accept(Unknown Source:10)
<200804 11:32:15.447> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at com.android.internal.util.function.pooled.PooledLambdaImpl.doInvoke(PooledLambdaImpl.java:292)
<200804 11:32:15.447> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at com.android.internal.util.function.pooled.PooledLambdaImpl.invoke(PooledLambdaImpl.java:201)
<200804 11:32:15.447> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at com.android.internal.util.function.pooled.OmniFunction.run(OmniFunction.java:97)
<200804 11:32:15.447> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at android.os.Handler.handleCallback(Handler.java:938)
<200804 11:32:15.447> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at android.os.Handler.dispatchMessage(Handler.java:99)
<200804 11:32:15.448> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at android.os.Looper.loop(Looper.java:223)
<200804 11:32:15.448> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at android.os.HandlerThread.run(HandlerThread.java:67)
<200804 11:32:15.448> DEBUG [Y17HPU" logcat -v long] (32768)/syslog] at com.android.server.ServiceThread.run(ServiceThread.java:44)