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
diff --git a/src/com/android/settings/network/telephony/scan/NetworkScanRepository.kt b/src/com/android/settings/network/telephony/scan/NetworkScanRepository.kt
index 2067b8c..dfa79cb 100644
--- a/src/com/android/settings/network/telephony/scan/NetworkScanRepository.kt
+++ b/src/com/android/settings/network/telephony/scan/NetworkScanRepository.kt
@@ -25,8 +25,8 @@
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.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 @@
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 @@
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
}
}