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

Commit 66098635 authored by Chaohui Wang's avatar Chaohui Wang
Browse files

Fix NetworkScanRequest maxSearchTime

Which should read from resource
R.integer.config_network_scan_helper_max_search_time_sec

Fix: 334814332
Test: manual - with network scan
Change-Id: I4afefe6470d6ef4bf325e83a0decce41b321e201
parent 39e42bf9
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ import android.telephony.RadioAccessSpecifier
import android.telephony.TelephonyManager
import android.telephony.TelephonyScanManager
import android.util.Log
import androidx.annotation.VisibleForTesting
import androidx.lifecycle.LifecycleOwner
import com.android.settings.R
import com.android.settings.network.telephony.CellInfoUtil
import com.android.settings.network.telephony.CellInfoUtil.getNetworkTitle
import com.android.settingslib.spa.framework.util.collectLatestWithLifecycle
@@ -37,7 +37,7 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.callbackFlow
import kotlinx.coroutines.flow.flowOn

class NetworkScanRepository(context: Context, subId: Int) {
class NetworkScanRepository(private val context: Context, subId: Int) {
    sealed interface NetworkScanResult

    data class NetworkScanCellInfos(val cellInfos: List<CellInfo>) : NetworkScanResult
@@ -105,7 +105,7 @@ class NetworkScanRepository(context: Context, subId: Int) {
            NetworkScanRequest.SCAN_TYPE_ONE_SHOT,
            radioAccessSpecifiers,
            NetworkScanRequest.MIN_SEARCH_PERIODICITY_SEC, // one shot, not used
            MAX_SEARCH_TIME_SEC,
            context.resources.getInteger(R.integer.config_network_scan_helper_max_search_time_sec),
            true,
            INCREMENTAL_RESULTS_PERIODICITY_SEC,
            null,
@@ -158,10 +158,6 @@ class NetworkScanRepository(context: Context, subId: Int) {
    companion object {
        private const val TAG = "NetworkScanRepository"

        @VisibleForTesting
        val MAX_SEARCH_TIME_SEC = 300

        @VisibleForTesting
        val INCREMENTAL_RESULTS_PERIODICITY_SEC = 3
        private const val INCREMENTAL_RESULTS_PERIODICITY_SEC = 3
    }
}