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

Commit 7a72844f authored by Marco Nelissen's avatar Marco Nelissen Committed by android-build-merger
Browse files

Merge "Fix race condition in MediaHTTPConnection" into pi-dev

am: d7c87b74

Change-Id: I65de507c2b98b81a25141994baba38831aea9142
parents e6ac04e0 d7c87b74
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -323,9 +323,11 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
        StrictMode.setThreadPolicy(policy);

        try {
            synchronized(this) {
                if (offset != mCurrentOffset) {
                    seekTo(offset);
                }
            }

            int n = mInputStream.read(data, 0, size);

@@ -366,7 +368,7 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
    }

    @Override
    public long getSize() {
    public synchronized long getSize() {
        if (mConnection == null) {
            try {
                seekTo(0);
@@ -379,7 +381,7 @@ public class MediaHTTPConnection extends IMediaHTTPConnection.Stub {
    }

    @Override
    public String getMIMEType() {
    public synchronized String getMIMEType() {
        if (mConnection == null) {
            try {
                seekTo(0);