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

Commit 3dd76bb6 authored by Nathan Harold's avatar Nathan Harold Committed by android-build-merger
Browse files

Merge "Guard mIsPendingCellInfoRequest with synch block"

am: 9ecbfb29

Change-Id: I302d652282f171ee02e62756d2a8998414224b33
parents c59ea346 9ecbfb29
Loading
Loading
Loading
Loading
+17 −13
Original line number Diff line number Diff line
@@ -1141,21 +1141,25 @@ public class ServiceStateTracker extends Handler {
                        }
                    }
                } else {
                    synchronized (mPendingCellInfoRequests) {
                        // If we receive an empty message, it's probably a timeout; if there is no
                        // pending request, drop it.
                        if (!mIsPendingCellInfoRequest) break;
                    // If there is a request pending, we still need to check whether it's a timeout
                    // for the current request of whether it's leftover from a previous request.
                        // If there is a request pending, we still need to check whether it's a
                        // timeout for the current request of whether it's leftover from a
                        // previous request.
                        final long curTime = SystemClock.elapsedRealtime();
                        if ((curTime - mLastCellInfoReqTime) <  CELL_INFO_LIST_QUERY_TIMEOUT) {
                            break;
                        }
                    // We've received a legitimate timeout, so something has gone terribly wrong.
                        // We've received a legitimate timeout, so something has gone terribly
                        // wrong.
                        loge("Timeout waiting for CellInfo; (everybody panic)!");
                        mLastCellInfoList = null;
                        // Since the timeout is applicable, fall through and update all synchronous
                        // callers with the failure.
                    }
                }
                synchronized (mPendingCellInfoRequests) {
                    // If we have pending requests, then service them. Note that in case of a
                    // timeout, we send null responses back to the callers.