Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2b3c1350 authored by Calin Juravle's avatar Calin Juravle
Browse files

Ensure the profile descriptor gets closed after posting the result

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
parent ad1fe519
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -203,8 +203,6 @@ public class ArtManagerService extends android.content.pm.dex.IArtManager.Stub {
            Slog.w(TAG, "Could not open snapshot profile for " + packageName + ":"
                    + snapshotProfile, e);
            postError(callback, packageName, ArtManager.SNAPSHOT_FAILED_INTERNAL_ERROR);
        } finally {
            IoUtils.closeQuietly(fd);
        }
    }

@@ -283,6 +281,8 @@ public class ArtManagerService extends android.content.pm.dex.IArtManager.Stub {
            } catch (RemoteException e) {
                Slog.w(TAG,
                        "Failed to call onSuccess after profile snapshot for " + packageName, e);
            } finally {
                IoUtils.closeQuietly(fd);
            }
        });
    }