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

Commit db644122 authored by Josh Gao's avatar Josh Gao Committed by John Reck
Browse files

GraphicsStatService: fix double close.

MemoryFile closes its file descriptor by itself, or would have, if its
Cleaner didn't have a reference cycle. Dup its fd instead of acquiring
it directly.

Bug: http://b/138422309
Test: booted
Change-Id: I1930f3ba47f332c075177d1b34df2371b92d1a1c
parent 2b551ea6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -191,7 +191,7 @@ public class GraphicsStatsService extends IGraphicsStats.Stub {
            if (!file.getFileDescriptor().valid()) {
                throw new IllegalStateException("Invalid file descriptor");
            }
            return new ParcelFileDescriptor(file.getFileDescriptor());
            return ParcelFileDescriptor.dup(file.getFileDescriptor());
        } catch (IOException ex) {
            throw new IllegalStateException("Failed to get PFD from memory file", ex);
        }