(Answered in a question edit. Converted to a community wiki answer. See What is the appropriate action when the answer to a question is added to the question itself? )
The OP wrote:
I solved this problem today.
Just change
descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
to
descriptor.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
Follow Up:
After I did some research and testing, I found that the automatically disconnection problem has something to do with the interference between Bluetooth and WIFI on Nexus 7. If I turned off the WIFI, then the disconnection problem of Bluetooth has gone. And this problem did not occur on Galaxy 3,4,5.