I'm investigating a crash in an Android app that started to appear on some Xiaomi and OnePlus devices a couple of days back. It only occurs for a low number of users (< 10) at the moment, but it bothers me that I can't figure out what is going on.
The crash is triggered by a call to startActivity(...) in the app, but the actual exception is thrown by a system process, inside ActivityStarter:
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'boolean com.android.server.wm.ConfigurationContainer.inPinnedWindowingMode()' on a null object reference
at com.android.server.wm.ActivityStarter.isAllowedToStart(ActivityStarter.java:2068)
at com.android.server.wm.ActivityStarter.startActivityInner(ActivityStarter.java:1874)
at com.android.server.wm.ActivityStarter.startActivityUnchecked(ActivityStarter.java:1678)
at com.android.server.wm.ActivityStarter.executeRequest(ActivityStarter.java:1231)
at com.android.server.wm.ActivityStarter.execute(ActivityStarter.java:717)
There are two things in that puzzles me about this:
boolean blockBalInTask = (newTask
|| !targetTask.isUidPresent(mCallingUid)
|| (LAUNCH_SINGLE_INSTANCE == mLaunchMode && targetTask.inPinnedWindowingMode()));
What could explain this behaviour?
Unable to reproduce the issue and it only happens for a low number of users.
It seems like the crashes is being triggered by a custom "Evolution-X" version of Android: https://github.com/Evolution-X/frameworks_base/blob/l10n_tiramisu/services/core/java/com/android/server/wm/ActivityStarter.java