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

Commit b5d6cff6 authored by Aishwarya Mallampati's avatar Aishwarya Mallampati
Browse files

Change long to AtomicLong

Following variables are changed to atomic variables:
- mWaitTimeForSatelliteEnablingResponse
- mDemoPointingAlignedDurationMillis
- mDemoPointingNotAlignedDurationMillis
- mEvaluateEsosProfilesPrioritizationDurationMillis
- mLastEmergencyCallTime
- mSatelliteEmergencyModeDurationMillis
- mSessionStartTimeStamp
- mSessionProcessingTimeStamp
- mEnforcedEmergencyCallToSatelliteHandoverType
- mDelayInSendingEventDisplayEmergencyMessage
- mSelectedSatelliteSubId
- mResultReceiverTotalCount

mResultReceiverCountPerMethodMap changed to concurrentHashMap

Bug: 409584433
Test: 417808605
Test: atest
Flag: com.android.internal.telephony.flags.satellite_improve_multi_thread_design
Change-Id: I3a3240d9a1265d1c6ed55da31cba4af039df6883
parent e1c268a2
Loading
Loading
Loading
Loading
+118 −132

File changed.

Preview size limit exceeded, changes collapsed.

+5 −10
Original line number Diff line number Diff line
@@ -228,6 +228,7 @@ import java.util.concurrent.Executor;
import java.util.concurrent.Semaphore;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;

@RunWith(AndroidTestingRunner.class)
@@ -6015,9 +6016,7 @@ public class SatelliteControllerTest extends TelephonyTest {
        @Override
        protected void setSelectedSatelliteSubId(int subId) {
            logd("setSelectedSatelliteSubId: subId=" + subId);
            synchronized (mSatelliteTokenProvisionedLock) {
                mSelectedSatelliteSubId = subId;
            }
            mSelectedSatelliteSubId = new AtomicInteger(subId);
        }

        @Override
@@ -6147,16 +6146,12 @@ public class SatelliteControllerTest extends TelephonyTest {
        }

        public int getResultReceiverTotalCount() {
            synchronized (mResultReceiverTotalCountLock) {
                return mResultReceiverTotalCount;
            }
            return mResultReceiverTotalCount.get();
        }

        public HashMap<String, Integer> getResultReceiverCountPerMethodMap() {
            synchronized (mResultReceiverTotalCountLock) {
        public ConcurrentHashMap<String, Integer> getResultReceiverCountPerMethodMap() {
            return mResultReceiverCountPerMethodMap;
        }
        }

        public void setIsSatelliteAllowedState(boolean isAllowed) {
            mSatelliteAccessAllowed = new AtomicBoolean(isAllowed);