Merge "Fixed Handler Leak on WrapperInit" am: 9c7e15ab31 am: d723dd9191
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1495716 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I14173b39846f2ef92698731b48dd4dd79d361b97
This commit is contained in:
@@ -69,15 +69,16 @@ public class WrapperInit {
|
|||||||
// Tell the Zygote what our actual PID is (since it only knows about the
|
// Tell the Zygote what our actual PID is (since it only knows about the
|
||||||
// wrapper that it directly forked).
|
// wrapper that it directly forked).
|
||||||
if (fdNum != 0) {
|
if (fdNum != 0) {
|
||||||
|
FileDescriptor fd = new FileDescriptor();
|
||||||
try {
|
try {
|
||||||
FileDescriptor fd = new FileDescriptor();
|
|
||||||
fd.setInt$(fdNum);
|
fd.setInt$(fdNum);
|
||||||
DataOutputStream os = new DataOutputStream(new FileOutputStream(fd));
|
DataOutputStream os = new DataOutputStream(new FileOutputStream(fd));
|
||||||
os.writeInt(Process.myPid());
|
os.writeInt(Process.myPid());
|
||||||
os.close();
|
os.close();
|
||||||
IoUtils.closeQuietly(fd);
|
|
||||||
} catch (IOException ex) {
|
} catch (IOException ex) {
|
||||||
Slog.d(TAG, "Could not write pid of wrapped process to Zygote pipe.", ex);
|
Slog.d(TAG, "Could not write pid of wrapped process to Zygote pipe.", ex);
|
||||||
|
} finally {
|
||||||
|
IoUtils.closeQuietly(fd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user