A famous issue for Nexus 7 2nd [*1] is that auto-rotation suddenly stop working, though software setting is set properly. Additionally, almost all apps related to accelerometer or magnetometer ( such as "compass" or "fitness" apps) do not work properly at the same time. A possible reason is all sensors related to gyro are physically offline (Mostly, GPS and light sensor are survived).
the technique works quite well. I tried it finally. But it takes some risks due to open the device.
I introduce a "moderate" technique for temporally fix the auto-rotation issue below. The method is quite simple, do not need to open the case. Just push one spot after shutdown. The area is just above the connector of the flat cable. Push gently, then boot your Nexus 7. That's it. It's too easy, so it seems to be doubtful at all, although it works well.
If your device (around the connector) is not so much damaged, your Nexus 7 temporarily recover the function of auto-rotation. Unfortunately, this technique is not for permanent solution. It is safe way in comparison to the technique with open the cover.