Snap for 11473031 from 192f95ee5e to 24Q2-release

Change-Id: If4791c6d8d69b653af268e3a19af8581adb0bbb6
This commit is contained in:
Android Build Coastguard Worker
2024-02-21 00:21:43 +00:00
11 changed files with 189 additions and 104 deletions

View File

@@ -32,6 +32,7 @@ import android.content.pm.ActivityInfo;
import android.content.pm.IPackageManager; import android.content.pm.IPackageManager;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
import android.content.pm.UserProperties;
import android.os.RemoteException; import android.os.RemoteException;
import android.os.UserHandle; import android.os.UserHandle;
import android.os.UserManager; import android.os.UserManager;
@@ -156,12 +157,23 @@ public class DeviceAdminListPreferenceController extends BasePreferenceControlle
mAdmins.clear(); mAdmins.clear();
final List<UserHandle> profiles = mUm.getUserProfiles(); final List<UserHandle> profiles = mUm.getUserProfiles();
for (UserHandle profile : profiles) { for (UserHandle profile : profiles) {
if (shouldSkipProfile(profile)) {
continue;
}
final int profileId = profile.getIdentifier(); final int profileId = profile.getIdentifier();
updateAvailableAdminsForProfile(profileId); updateAvailableAdminsForProfile(profileId);
} }
Collections.sort(mAdmins); Collections.sort(mAdmins);
} }
private boolean shouldSkipProfile(UserHandle profile) {
return android.os.Flags.allowPrivateProfile()
&& android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace()
&& mUm.isQuietModeEnabled(profile)
&& mUm.getUserProperties(profile).getShowInQuietMode()
== UserProperties.SHOW_IN_QUIET_MODE_HIDDEN;
}
private void refreshUI() { private void refreshUI() {
if (mPreferenceGroup == null) { if (mPreferenceGroup == null) {
return; return;

View File

@@ -26,6 +26,7 @@ import android.content.Intent;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo; import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo; import android.content.pm.UserInfo;
import android.content.pm.UserProperties;
import android.content.res.Resources; import android.content.res.Resources;
import android.net.ConnectivityManager; import android.net.ConnectivityManager;
import android.net.VpnManager; import android.net.VpnManager;
@@ -220,6 +221,9 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
public int getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile() { public int getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile() {
int activeAdmins = 0; int activeAdmins = 0;
for (final UserInfo userInfo : mUm.getProfiles(MY_USER_ID)) { for (final UserInfo userInfo : mUm.getProfiles(MY_USER_ID)) {
if (shouldSkipProfile(userInfo)) {
continue;
}
final List<ComponentName> activeAdminsForUser final List<ComponentName> activeAdminsForUser
= mDpm.getActiveAdminsAsUser(userInfo.id); = mDpm.getActiveAdminsAsUser(userInfo.id);
if (activeAdminsForUser != null) { if (activeAdminsForUser != null) {
@@ -250,6 +254,14 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
return false; return false;
} }
private boolean shouldSkipProfile(UserInfo userInfo) {
return android.os.Flags.allowPrivateProfile()
&& android.multiuser.Flags.handleInterleavedSettingsForPrivateSpace()
&& userInfo.isQuietModeEnabled()
&& mUm.getUserProperties(userInfo.getUserHandle()).getShowInQuietMode()
== UserProperties.SHOW_IN_QUIET_MODE_HIDDEN;
}
private Intent getParentalControlsIntent() { private Intent getParentalControlsIntent() {
final ComponentName componentName = final ComponentName componentName =
mDpm.getProfileOwnerOrDeviceOwnerSupervisionComponent(new UserHandle(MY_USER_ID)); mDpm.getProfileOwnerOrDeviceOwnerSupervisionComponent(new UserHandle(MY_USER_ID));

View File

@@ -22,19 +22,25 @@ import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.telephony.SubscriptionManager import android.telephony.SubscriptionManager
import android.util.Log import android.util.Log
import android.view.MotionEvent
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.SignalCellularAlt import androidx.compose.material.icons.outlined.SignalCellularAlt
import androidx.compose.material3.AlertDialogDefaults
import androidx.compose.material3.BasicAlertDialog
import androidx.compose.material3.Button import androidx.compose.material3.Button
import androidx.compose.material3.CircularProgressIndicator
import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ModalBottomSheet import androidx.compose.material3.ModalBottomSheet
import androidx.compose.material3.SheetState import androidx.compose.material3.SheetState
import androidx.compose.material3.Surface
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.rememberModalBottomSheetState import androidx.compose.material3.rememberModalBottomSheetState
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@@ -58,6 +64,7 @@ import com.android.settings.spa.network.SimOnboardingPageProvider.getRoute
import com.android.settingslib.spa.SpaBaseDialogActivity import com.android.settingslib.spa.SpaBaseDialogActivity
import com.android.settingslib.spa.framework.theme.SettingsDimension import com.android.settingslib.spa.framework.theme.SettingsDimension
import com.android.settingslib.spa.framework.util.collectLatestWithLifecycle import com.android.settingslib.spa.framework.util.collectLatestWithLifecycle
import com.android.settingslib.spa.widget.dialog.getDialogWidth
import com.android.settingslib.spa.widget.ui.SettingsTitle import com.android.settingslib.spa.widget.ui.SettingsTitle
import com.android.settingslib.spaprivileged.framework.common.userManager import com.android.settingslib.spaprivileged.framework.common.userManager
import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.CoroutineScope
@@ -193,26 +200,43 @@ class SimOnboardingActivity : SpaBaseDialogActivity() {
} }
} }
@OptIn(ExperimentalMaterial3Api::class)
@Composable @Composable
fun ProgressDialogImpl() { fun ProgressDialogImpl() {
// TODO: 1. Create the SPA's ProgressDialog and using SPA's widget if(showDialog.value) {
val dialog: ProgressDialog = object : ProgressDialog(this) { // TODO: Create the SPA's ProgressDialog and using SPA's widget
override fun onTouchEvent(event: MotionEvent): Boolean { BasicAlertDialog(
return true onDismissRequest = {},
} modifier = Modifier.width(
} getDialogWidth()
dialog.setMessage( ),
) {
Surface(
color = AlertDialogDefaults.containerColor,
shape = AlertDialogDefaults.shape
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(SettingsDimension.itemPaddingStart),
verticalAlignment = Alignment.CenterVertically
) {
CircularProgressIndicator()
Column(modifier = Modifier
.padding(start = SettingsDimension.itemPaddingStart)) {
SettingsTitle(
stringResource( stringResource(
R.string.sim_onboarding_progressbar_turning_sim_on, R.string.sim_onboarding_progressbar_turning_sim_on,
onboardingService.targetSubInfo?.displayName ?: "" onboardingService.targetSubInfo?.displayName ?: ""
) )
) )
dialog.setCancelable(false) }
}
}
}
}
}
if(showDialog.value) {
dialog.show()
}
}
@Composable @Composable
fun registerSidecarReceiverFlow(){ fun registerSidecarReceiverFlow(){
switchToEuiccSubscriptionSidecar?.sidecarReceiverFlow() switchToEuiccSubscriptionSidecar?.sidecarReceiverFlow()

View File

@@ -45,7 +45,6 @@ class SimOnboardingService {
var activeSubInfoList: List<SubscriptionInfo> = listOf() var activeSubInfoList: List<SubscriptionInfo> = listOf()
var slotInfoList: List<UiccSlotInfo> = listOf() var slotInfoList: List<UiccSlotInfo> = listOf()
var uiccCardInfoList: List<UiccCardInfo> = listOf() var uiccCardInfoList: List<UiccCardInfo> = listOf()
var selectedSubInfoList: MutableList<SubscriptionInfo> = mutableListOf()
var targetPrimarySimCalls: Int = SubscriptionManager.INVALID_SUBSCRIPTION_ID var targetPrimarySimCalls: Int = SubscriptionManager.INVALID_SUBSCRIPTION_ID
var targetPrimarySimTexts: Int = SubscriptionManager.INVALID_SUBSCRIPTION_ID var targetPrimarySimTexts: Int = SubscriptionManager.INVALID_SUBSCRIPTION_ID
var targetPrimarySimMobileData: Int = SubscriptionManager.INVALID_SUBSCRIPTION_ID var targetPrimarySimMobileData: Int = SubscriptionManager.INVALID_SUBSCRIPTION_ID
@@ -56,10 +55,8 @@ class SimOnboardingService {
Log.w(TAG, "No DDS") Log.w(TAG, "No DDS")
return SubscriptionManager.INVALID_SUBSCRIPTION_ID return SubscriptionManager.INVALID_SUBSCRIPTION_ID
} }
return selectedSubInfoList return userSelectedSubInfoList
.filter { info -> .filter { info -> info.subscriptionId != targetPrimarySimMobileData }
(info.simSlotIndex != -1) && (info.subscriptionId != targetPrimarySimMobileData)
}
.map { it.subscriptionId } .map { it.subscriptionId }
.firstOrNull() ?: SubscriptionManager.INVALID_SUBSCRIPTION_ID .firstOrNull() ?: SubscriptionManager.INVALID_SUBSCRIPTION_ID
} }
@@ -118,7 +115,6 @@ class SimOnboardingService {
&& targetSubInfo != null && targetSubInfo != null
&& activeSubInfoList.isNotEmpty() && activeSubInfoList.isNotEmpty()
&& slotInfoList.isNotEmpty() && slotInfoList.isNotEmpty()
&& selectedSubInfoList.isNotEmpty()
} }
fun clear() { fun clear() {
@@ -128,7 +124,6 @@ class SimOnboardingService {
activeSubInfoList = listOf() activeSubInfoList = listOf()
slotInfoList = listOf() slotInfoList = listOf()
uiccCardInfoList = listOf() uiccCardInfoList = listOf()
selectedSubInfoList = mutableListOf()
targetPrimarySimCalls = -1 targetPrimarySimCalls = -1
targetPrimarySimTexts = -1 targetPrimarySimTexts = -1
targetPrimarySimMobileData = -1 targetPrimarySimMobileData = -1
@@ -151,7 +146,8 @@ class SimOnboardingService {
ThreadUtils.postOnBackgroundThread { ThreadUtils.postOnBackgroundThread {
activeSubInfoList = SubscriptionUtil.getActiveSubscriptions(subscriptionManager) activeSubInfoList = SubscriptionUtil.getActiveSubscriptions(subscriptionManager)
availableSubInfoList = SubscriptionUtil.getAvailableSubscriptions(context) availableSubInfoList = SubscriptionUtil.getAvailableSubscriptions(context)
targetSubInfo = availableSubInfoList.find { subInfo -> subInfo.subscriptionId == targetSubId } targetSubInfo =
availableSubInfoList.find { subInfo -> subInfo.subscriptionId == targetSubId }
targetSubInfo?.let { userSelectedSubInfoList.add(it) } targetSubInfo?.let { userSelectedSubInfoList.add(it) }
Log.d( Log.d(
TAG, "targetSubId: $targetSubId" + ", targetSubInfo: $targetSubInfo" + TAG, "targetSubId: $targetSubId" + ", targetSubInfo: $targetSubInfo" +
@@ -186,7 +182,6 @@ class SimOnboardingService {
targetSubInfo?.let { list.add(it) } targetSubInfo?.let { list.add(it) }
} }
Log.d(TAG, "list: $list")
return list.toList() return list.toList()
} }
@@ -206,7 +201,10 @@ class SimOnboardingService {
return return
} }
renameMutableMap[subInfo.subscriptionId] = newName renameMutableMap[subInfo.subscriptionId] = newName
Log.d(TAG, "renameMutableMap add ${subInfo.subscriptionId} & $newName into: $renameMutableMap") Log.d(
TAG,
"renameMutableMap add ${subInfo.subscriptionId} & $newName into: $renameMutableMap"
)
} }
fun getSubscriptionInfoDisplayName(subInfo: SubscriptionInfo): String { fun getSubscriptionInfoDisplayName(subInfo: SubscriptionInfo): String {
@@ -278,11 +276,18 @@ class SimOnboardingService {
targetPrimarySimMobileData targetPrimarySimMobileData
) )
var nonDds = targetNonDds
Log.d(
TAG,
"setAutomaticData: targetNonDds: $nonDds," +
" targetPrimarySimAutoDataSwitch: $targetPrimarySimAutoDataSwitch"
)
if (nonDds != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
val telephonyManagerForNonDds: TelephonyManager? = val telephonyManagerForNonDds: TelephonyManager? =
context.getSystemService(TelephonyManager::class.java) context.getSystemService(TelephonyManager::class.java)
?.createForSubscriptionId(targetNonDds) ?.createForSubscriptionId(nonDds)
setAutomaticData(telephonyManagerForNonDds, targetPrimarySimAutoDataSwitch) setAutomaticData(telephonyManagerForNonDds, targetPrimarySimAutoDataSwitch)
}
// no next action, send finish // no next action, send finish
callback(SimOnboardingActivity.CALLBACK_FINISH) callback(SimOnboardingActivity.CALLBACK_FINISH)

View File

@@ -219,7 +219,7 @@ fun SimsSectionImpl(
mutableStateOf(false) mutableStateOf(false)
} }
//TODO: Add the Restricted TwoTargetSwitchPreference in SPA //TODO: Add the Restricted TwoTargetSwitchPreference in SPA
TwoTargetSwitchPreference(remember { TwoTargetSwitchPreference(
object : SwitchPreferenceModel { object : SwitchPreferenceModel {
override val title = subInfo.displayName.toString() override val title = subInfo.displayName.toString()
override val summary = { subInfo.number } override val summary = { subInfo.number }
@@ -236,7 +236,7 @@ fun SimsSectionImpl(
startToggleSubscriptionDialog(context, subInfo, newChecked) startToggleSubscriptionDialog(context, subInfo, newChecked)
} }
} }
}) { ) {
startMobileNetworkSettings(context, subInfo) startMobileNetworkSettings(context, subInfo)
} }
} }
@@ -258,7 +258,7 @@ fun SimsSectionImpl(
} }
@Composable @Composable
fun PrimarySimSectionImpl( fun PrimarySimImpl(
subscriptionInfoList: List<SubscriptionInfo>, subscriptionInfoList: List<SubscriptionInfo>,
callsSelectedId: MutableIntState, callsSelectedId: MutableIntState,
textsSelectedId: MutableIntState, textsSelectedId: MutableIntState,
@@ -318,15 +318,18 @@ fun PrimarySimSectionImpl(
for (info in subscriptionInfoList) { for (info in subscriptionInfoList) {
var item = ListPreferenceOption( var item = ListPreferenceOption(
id = info.subscriptionId, id = info.subscriptionId,
text = "${info.displayName}" text = "${info.displayName}",
summary = "${info.number}"
) )
callsAndSmsList.add(item) callsAndSmsList.add(item)
dataList.add(item) dataList.add(item)
} }
callsAndSmsList.add(ListPreferenceOption( callsAndSmsList.add(
ListPreferenceOption(
id = SubscriptionManager.INVALID_SUBSCRIPTION_ID, id = SubscriptionManager.INVALID_SUBSCRIPTION_ID,
text = stringResource(id = R.string.sim_calls_ask_first_prefs_title) text = stringResource(id = R.string.sim_calls_ask_first_prefs_title)
)) )
)
} else { } else {
// hide the primary sim // hide the primary sim
state.value = false state.value = false
@@ -341,7 +344,6 @@ fun PrimarySimSectionImpl(
mutableStateOf(false) mutableStateOf(false)
} }
Category(title = stringResource(id = R.string.primary_sim_title)) {
CreatePrimarySimListPreference( CreatePrimarySimListPreference(
stringResource(id = R.string.primary_sim_calls_title), stringResource(id = R.string.primary_sim_calls_title),
callsAndSmsList, callsAndSmsList,
@@ -363,11 +365,10 @@ fun PrimarySimSectionImpl(
Icons.Outlined.DataUsage, Icons.Outlined.DataUsage,
actionSetMobileData actionSetMobileData
) )
}
val autoDataTitle = stringResource(id = R.string.primary_sim_automatic_data_title) val autoDataTitle = stringResource(id = R.string.primary_sim_automatic_data_title)
val autoDataSummary = stringResource(id = R.string.primary_sim_automatic_data_msg) val autoDataSummary = stringResource(id = R.string.primary_sim_automatic_data_msg)
SwitchPreference(remember { SwitchPreference(
object : SwitchPreferenceModel { object : SwitchPreferenceModel {
override val title = autoDataTitle override val title = autoDataTitle
override val summary = { autoDataSummary } override val summary = { autoDataSummary }
@@ -375,6 +376,11 @@ fun PrimarySimSectionImpl(
if (nonDds.intValue != SubscriptionManager.INVALID_SUBSCRIPTION_ID) { if (nonDds.intValue != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
coroutineScope.launch { coroutineScope.launch {
automaticDataChecked.value = getAutomaticData(telephonyManagerForNonDds) automaticDataChecked.value = getAutomaticData(telephonyManagerForNonDds)
Log.d(
NetworkCellularGroupProvider.name,
"NonDds:${nonDds.intValue}" +
"getAutomaticData:${automaticDataChecked.value}"
)
} }
} }
automaticDataChecked.value automaticDataChecked.value
@@ -384,7 +390,26 @@ fun PrimarySimSectionImpl(
actionSetAutoDataSwitch(it) actionSetAutoDataSwitch(it)
} }
} }
}) )
}
}
@Composable
fun PrimarySimSectionImpl(
subscriptionInfoList: List<SubscriptionInfo>,
callsSelectedId: MutableIntState,
textsSelectedId: MutableIntState,
mobileDataSelectedId: MutableIntState,
nonDds: MutableIntState,
) {
Category(title = stringResource(id = R.string.primary_sim_title)) {
PrimarySimImpl(
subscriptionInfoList,
callsSelectedId,
textsSelectedId,
mobileDataSelectedId,
nonDds
)
} }
} }
@@ -443,31 +468,41 @@ private fun showEuiccSettings(context: Context): Boolean {
suspend fun setDefaultVoice( suspend fun setDefaultVoice(
subscriptionManager: SubscriptionManager?, subscriptionManager: SubscriptionManager?,
subId: Int): Unit = withContext(Dispatchers.Default) { subId: Int
): Unit =
withContext(Dispatchers.Default) {
subscriptionManager?.setDefaultVoiceSubscriptionId(subId) subscriptionManager?.setDefaultVoiceSubscriptionId(subId)
} }
suspend fun setDefaultSms( suspend fun setDefaultSms(
subscriptionManager: SubscriptionManager?, subscriptionManager: SubscriptionManager?,
subId: Int): Unit = withContext(Dispatchers.Default) { subId: Int
): Unit =
withContext(Dispatchers.Default) {
subscriptionManager?.setDefaultSmsSubId(subId) subscriptionManager?.setDefaultSmsSubId(subId)
} }
suspend fun setDefaultData(context: Context, suspend fun setDefaultData(
context: Context,
subscriptionManager: SubscriptionManager?, subscriptionManager: SubscriptionManager?,
wifiPickerTrackerHelper: WifiPickerTrackerHelper?, wifiPickerTrackerHelper: WifiPickerTrackerHelper?,
subId: Int): Unit = withContext(Dispatchers.Default) { subId: Int
): Unit =
withContext(Dispatchers.Default) {
subscriptionManager?.setDefaultDataSubId(subId) subscriptionManager?.setDefaultDataSubId(subId)
MobileNetworkUtils.setMobileDataEnabled( MobileNetworkUtils.setMobileDataEnabled(
context, context,
subId, subId,
true /* enabled */, true /* enabled */,
true /* disableOtherSubscriptions */) true /* disableOtherSubscriptions */
)
if (wifiPickerTrackerHelper != null if (wifiPickerTrackerHelper != null
&& !wifiPickerTrackerHelper.isCarrierNetworkProvisionEnabled(subId)) { && !wifiPickerTrackerHelper.isCarrierNetworkProvisionEnabled(subId)
) {
wifiPickerTrackerHelper.setCarrierNetworkEnabled(true) wifiPickerTrackerHelper.setCarrierNetworkEnabled(true)
} }
} }
suspend fun getAutomaticData(telephonyManagerForNonDds: TelephonyManager?): Boolean = suspend fun getAutomaticData(telephonyManagerForNonDds: TelephonyManager?): Boolean =
withContext(Dispatchers.Default) { withContext(Dispatchers.Default) {
telephonyManagerForNonDds != null telephonyManagerForNonDds != null
@@ -478,7 +513,7 @@ suspend fun getAutomaticData(telephonyManagerForNonDds: TelephonyManager?): Bool
suspend fun setAutomaticData(telephonyManager: TelephonyManager?, newState: Boolean): Unit = suspend fun setAutomaticData(telephonyManager: TelephonyManager?, newState: Boolean): Unit =
withContext(Dispatchers.Default) { withContext(Dispatchers.Default) {
Log.d( Log.d(
"NetworkCellularGroupProvider", NetworkCellularGroupProvider.name,
"setAutomaticData: MOBILE_DATA_POLICY_AUTO_DATA_SWITCH as $newState" "setAutomaticData: MOBILE_DATA_POLICY_AUTO_DATA_SWITCH as $newState"
) )
telephonyManager?.setMobileDataPolicyEnabled( telephonyManager?.setMobileDataPolicyEnabled(

View File

@@ -20,6 +20,7 @@ import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.SignalCellularAlt import androidx.compose.material.icons.outlined.SignalCellularAlt
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
@@ -91,11 +92,13 @@ private fun labelSimBody(onboardingService: SimOnboardingService) {
}, },
title = stringResource(R.string.sim_onboarding_label_sim_dialog_title), title = stringResource(R.string.sim_onboarding_label_sim_dialog_title),
text = { text = {
Text(summaryNumber) Text(summaryNumber,
modifier = Modifier.padding(bottom = SettingsDimension.itemPaddingVertical))
SettingsOutlinedTextField( SettingsOutlinedTextField(
value = titleSimName, value = titleSimName,
label = stringResource(R.string.sim_onboarding_label_sim_dialog_label), label = stringResource(R.string.sim_onboarding_label_sim_dialog_label),
enabled = true enabled = true,
shape = MaterialTheme.shapes.extraLarge
) { ) {
titleSimName = it titleSimName = it
} }

View File

@@ -24,7 +24,6 @@ import androidx.compose.material.icons.outlined.SignalCellularAlt
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.MutableIntState import androidx.compose.runtime.MutableIntState
import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
@@ -82,7 +81,7 @@ fun SimOnboardingPrimarySimImpl(
callsSelectedId.intValue = onboardingService.targetPrimarySimCalls callsSelectedId.intValue = onboardingService.targetPrimarySimCalls
textsSelectedId.intValue = onboardingService.targetPrimarySimTexts textsSelectedId.intValue = onboardingService.targetPrimarySimTexts
mobileDataSelectedId.intValue = onboardingService.targetPrimarySimMobileData mobileDataSelectedId.intValue = onboardingService.targetPrimarySimMobileData
PrimarySimSectionImpl( PrimarySimImpl(
subscriptionInfoList = selectedSubscriptionInfoList, subscriptionInfoList = selectedSubscriptionInfoList,
callsSelectedId = callsSelectedId, callsSelectedId = callsSelectedId,
textsSelectedId = textsSelectedId, textsSelectedId = textsSelectedId,
@@ -110,7 +109,7 @@ fun CreatePrimarySimListPreference(
selectedId: MutableIntState, selectedId: MutableIntState,
icon: ImageVector, icon: ImageVector,
onIdSelected: (id: Int) -> Unit onIdSelected: (id: Int) -> Unit
) = ListPreference(remember { ) = ListPreference(
object : ListPreferenceModel { object : ListPreferenceModel {
override val title = title override val title = title
override val options = list override val options = list
@@ -119,5 +118,4 @@ fun CreatePrimarySimListPreference(
override val icon = @Composable { override val icon = @Composable {
SettingsIcon(icon) SettingsIcon(icon)
} }
}
}) })

View File

@@ -47,7 +47,6 @@ class SimOnboardingLabelSimTest {
on { activeSubInfoList }.doReturn(listOf()) on { activeSubInfoList }.doReturn(listOf())
on { slotInfoList }.doReturn(listOf()) on { slotInfoList }.doReturn(listOf())
on { uiccCardInfoList }.doReturn(listOf()) on { uiccCardInfoList }.doReturn(listOf())
on { selectedSubInfoList }.doReturn(mutableListOf())
on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME) on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME) on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)

View File

@@ -47,7 +47,6 @@ class SimOnboardingPageProviderTest {
on { activeSubInfoList }.doReturn(listOf()) on { activeSubInfoList }.doReturn(listOf())
on { slotInfoList }.doReturn(listOf()) on { slotInfoList }.doReturn(listOf())
on { uiccCardInfoList }.doReturn(listOf()) on { uiccCardInfoList }.doReturn(listOf())
on { selectedSubInfoList }.doReturn(mutableListOf())
on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME) on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME) on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)

View File

@@ -48,7 +48,6 @@ class SimOnboardingPrimarySimTest {
on { activeSubInfoList }.doReturn(listOf()) on { activeSubInfoList }.doReturn(listOf())
on { slotInfoList }.doReturn(listOf()) on { slotInfoList }.doReturn(listOf())
on { uiccCardInfoList }.doReturn(listOf()) on { uiccCardInfoList }.doReturn(listOf())
on { selectedSubInfoList }.doReturn(mutableListOf())
on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME) on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME) on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)

View File

@@ -47,7 +47,6 @@ class SimOnboardingSelectSimTest {
on { activeSubInfoList }.doReturn(listOf()) on { activeSubInfoList }.doReturn(listOf())
on { slotInfoList }.doReturn(listOf()) on { slotInfoList }.doReturn(listOf())
on { uiccCardInfoList }.doReturn(listOf()) on { uiccCardInfoList }.doReturn(listOf())
on { selectedSubInfoList }.doReturn(mutableListOf())
on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME) on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME) on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)