We need to close the descriptor after posting the result on the
handler, otherwise we might risk sending in a close descriptor.
Bug:
73505439
Test: gts ArtManagerHostTest
Change-Id: I469683e323940ac88ea9e8c16e3df7a526ca77b3
Slog.w(TAG, "Could not open snapshot profile for " + packageName + ":"
+ snapshotProfile, e);
postError(callback, packageName, ArtManager.SNAPSHOT_FAILED_INTERNAL_ERROR);
- } finally {
- IoUtils.closeQuietly(fd);
}
}
} catch (RemoteException e) {
Slog.w(TAG,
"Failed to call onSuccess after profile snapshot for " + packageName, e);
+ } finally {
+ IoUtils.closeQuietly(fd);
}
});
}