[ActivityManager] handle dumpHeap() but no free space case.
Symptom:
in ActivityManager.dumpHeap(), will calling
ActivityThread.handleDumpHeap()-> Debug.dumpHprofData()->
dalvik_system_VMDebug.VMDebug_dumpHprofData to dump hprof file,
althouth Debug.dumpHprofData defined only throw IOException,
but dalvik_system_VMDebug.VMDebug_dumpHprofData will throw
NullPointException when file name is null or
RuntimeException when no free space,
it will caused calling process crash.
Root Cause:
in ActivityThread.handleDumpHeap, only catch IOException when calling
Debug.dumpHprofData().
Solution:
1. if caller is system process, catch RuntimeException to prevent system crash.
2. if caller is non-system process, re-throw RuntimeException back to prcess.
Change-Id: I5ad1ab61bdc088a8d95c845e5602036164939693
Signed-off-by: mydongistiny <jaysonedson@gmail.com>
1 file changed