Closed iujames closed 12 months ago
Should there be a shadow on the capture confirmation modal in your screenshots?
Should there be a shadow on the capture confirmation modal in your screenshots?
yeah, there is normally - this is some emulator artifact that we ran into a while back, and maybe only on my machine? but we've confirmed that it is not an issue on an real device.
It was observed that screen capture could fail sometimes, seemingly randomly, and the log message seen was
The error was seen on a tablet device, using rotation to landscape as well during capture (important later). This message is coming from a call to PixelCopy, which was introduced recently in the 3.1.7 version.
However, further research seems to show that the root cause was actually a bad current
Activity
reference, from theAppcuesActivityMonitor
, due to some other recent 3.1.7 changes in https://github.com/appcues/appcues-android-sdk/pull/543. Specifically, on a rotation change, theonActivityCreated
handler would not set the current activity tonull
, thus when it went intoonActivityResumed
, it was not updating the current activity with the reference to the new (different) Activity being passed in. This would eventually lead to a bad activity reference in the screen capture code, after a rotation, and then the error message seen above.Three small related fixes here:
Activity
correctly at all times in theAppcuesActivityMonitor
(root cause)The selector displays now look correct in both orientations (ignore the missing dialog backdrop here, thats just an emulator rendering issue, known).