[Stability]: fix system_server crash issue caused by fd leak.
If an app incorrect use of registerListener, it will cause
system_server socket fd leak, for example:
protected void onResume() {
super.onResume();
mSensorManager.registerListener(new MySensorEventListener(),
mSensor, SensorManager.SENSOR_DELAY_UI);
Each time a new SensorEventQueue, then in the system_server
will open a new socket fd, as time increases system_server's
fd will be more than 1024 and crash, so we needed add count limit
for sensor listener to improve the system stability.
Test: use the apk attached in the issue
https://code.google.com/p/android/issues/detail?id=258634
Bug: 37543280
Change-Id: I35006966a1638c25bb0f54611e117e16a764e12b
Signed-off-by: songjinshi <songjinshi@xiaomi.com>
1 file changed