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

Commit f42c074f authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Guard mIsPendingCellInfoRequest with synch block" am: 9ecbfb29 am: 3dd76bb6

Change-Id: I71ef697bd5677ed438e3df99aa8486772a52ae66
parents c45d3c8d 3dd76bb6
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.