Adaptive brightness works for me (Pixel 7), with or without camera blocking. The sensor is below the front-facing camera.
It's subtle, depending on your environment. You can watch the slider activate in real-time by fully pulling down the notification screen, cover the screen just below the front-facing camera. If you're in a bright room, the brightness slider should drop almost immediately.
If you're in a dimly lit room, cover the sensor area and hold it up to a light source; the brightness should remain the same until uncovered.