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
This commit is contained in:
Chaohui Wang
2024-04-16 09:26:22 +08:00
parent 39e42bf97a
commit 660986353e

View File

@@ -25,8 +25,8 @@ import android.telephony.RadioAccessSpecifier
import android.telephony.TelephonyManager import android.telephony.TelephonyManager
import android.telephony.TelephonyScanManager import android.telephony.TelephonyScanManager
import android.util.Log import android.util.Log
import androidx.annotation.VisibleForTesting
import androidx.lifecycle.LifecycleOwner import androidx.lifecycle.LifecycleOwner
import com.android.settings.R
import com.android.settings.network.telephony.CellInfoUtil import com.android.settings.network.telephony.CellInfoUtil
import com.android.settings.network.telephony.CellInfoUtil.getNetworkTitle import com.android.settings.network.telephony.CellInfoUtil.getNetworkTitle
import com.android.settingslib.spa.framework.util.collectLatestWithLifecycle 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.callbackFlow
import kotlinx.coroutines.flow.flowOn import kotlinx.coroutines.flow.flowOn
class NetworkScanRepository(context: Context, subId: Int) { class NetworkScanRepository(private val context: Context, subId: Int) {
sealed interface NetworkScanResult sealed interface NetworkScanResult
data class NetworkScanCellInfos(val cellInfos: List<CellInfo>) : NetworkScanResult data class NetworkScanCellInfos(val cellInfos: List<CellInfo>) : NetworkScanResult
@@ -105,7 +105,7 @@ class NetworkScanRepository(context: Context, subId: Int) {
NetworkScanRequest.SCAN_TYPE_ONE_SHOT, NetworkScanRequest.SCAN_TYPE_ONE_SHOT,
radioAccessSpecifiers, radioAccessSpecifiers,
NetworkScanRequest.MIN_SEARCH_PERIODICITY_SEC, // one shot, not used 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, true,
INCREMENTAL_RESULTS_PERIODICITY_SEC, INCREMENTAL_RESULTS_PERIODICITY_SEC,
null, null,
@@ -158,10 +158,6 @@ class NetworkScanRepository(context: Context, subId: Int) {
companion object { companion object {
private const val TAG = "NetworkScanRepository" private const val TAG = "NetworkScanRepository"
@VisibleForTesting private const val INCREMENTAL_RESULTS_PERIODICITY_SEC = 3
val MAX_SEARCH_TIME_SEC = 300
@VisibleForTesting
val INCREMENTAL_RESULTS_PERIODICITY_SEC = 3
} }
} }