Merge "Only capture activity snapshot if the app has adapted to onBackInvoked" into main