Calculate app and device state in crashing thread