Samsung has patented a self-healing tech to protect sensors (like camera and fingerprint) integrated into the display of foldable phones.
Samsung's patent document describes a tiny sensing loop around the hole in the screen that can detect small cracks.