Yes, they are all stored in m_resources. I do not clear NO_PRESERVE_TEXTURE bitmaps, as they are usually drawn over completely on the next frame. It's still would be more proper to clear them, of course, than to rely on that, so I'll do that.
What bothers me more, is those ALLEGRO_EVENT_DISPLAY_RESUME_DRAWING events... Why am I getting two of them, and why recreating bitmaps twice screws things up royally (compared to a common screw up that happens if I only recreated them once, during handling of the second event)? I can't find any relevant references to surfaceChanged being called twice in Google...
EDIT: I've done some digging, and it seems that I found the reason for some of my troubles. Based on attached log, I deduced the following sequence of events:
1) The game is paused, halt_drawing is acknowledged, the game goes to background
2) The game is resumed, a new Surface is created in response to onCreate, nativeOnCreate is called, resume_drawing event is posted to queue.
3) My code begins to react to resume_drawing event by re-creating bitmaps
4) SUDDENLY! In the middle of it all, a second onCreate is called in another thread! The current Surface is destroyed - but my code is in the middle of recreation of bitmaps, and has no notion that something has gone wrong. After this part, all bitmaps I try to re-create are corrupted, because they have no Surface to be created against.
5) The second resume_drawing event reaches my code. I begin to recreate bitmaps once again, but most of their data is already corrupted (?).
This explains why things looks the best when I only react to the second resume_drawing event. I couldn't discern why onCreate is called twice, but there are mentions of such behaviour here and there. It seems like it's normal behaviour on Android sometimes. So the question is, how to make Allegro handle it correctly? The main problem I see is that Surface is destroyed when my own code is in the middle of work with bitmaps. Is there any way to postpone destruction of the old Surface? I don't quite see what to do here...