Snap for 11473031 from 192f95ee5e to 24Q2-release
Change-Id: If4791c6d8d69b653af268e3a19af8581adb0bbb6
This commit is contained in:
@@ -32,6 +32,7 @@ import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.IPackageManager;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.pm.UserProperties;
|
||||
import android.os.RemoteException;
|
||||
import android.os.UserHandle;
|
||||
import android.os.UserManager;
|
||||
@@ -156,12 +157,23 @@ public class DeviceAdminListPreferenceController extends BasePreferenceControlle
|
||||
mAdmins.clear();
|
||||
final List<UserHandle> profiles = mUm.getUserProfiles();
|
||||
for (UserHandle profile : profiles) {
|
||||
if (shouldSkipProfile(profile)) {
|
||||
continue;
|
||||
}
|
||||
final int profileId = profile.getIdentifier();
|
||||
updateAvailableAdminsForProfile(profileId);
|
||||
}
|
||||
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() {
|
||||
if (mPreferenceGroup == null) {
|
||||
return;
|
||||
|
||||
@@ -26,6 +26,7 @@ import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.pm.ResolveInfo;
|
||||
import android.content.pm.UserInfo;
|
||||
import android.content.pm.UserProperties;
|
||||
import android.content.res.Resources;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.VpnManager;
|
||||
@@ -220,6 +221,9 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
|
||||
public int getNumberOfActiveDeviceAdminsForCurrentUserAndManagedProfile() {
|
||||
int activeAdmins = 0;
|
||||
for (final UserInfo userInfo : mUm.getProfiles(MY_USER_ID)) {
|
||||
if (shouldSkipProfile(userInfo)) {
|
||||
continue;
|
||||
}
|
||||
final List<ComponentName> activeAdminsForUser
|
||||
= mDpm.getActiveAdminsAsUser(userInfo.id);
|
||||
if (activeAdminsForUser != null) {
|
||||
@@ -250,6 +254,14 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
|
||||
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() {
|
||||
final ComponentName componentName =
|
||||
mDpm.getProfileOwnerOrDeviceOwnerSupervisionComponent(new UserHandle(MY_USER_ID));
|
||||
|
||||
@@ -22,19 +22,25 @@ import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.telephony.SubscriptionManager
|
||||
import android.util.Log
|
||||
import android.view.MotionEvent
|
||||
import androidx.activity.compose.setContent
|
||||
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.size
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.material.icons.Icons
|
||||
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.CircularProgressIndicator
|
||||
import androidx.compose.material3.ExperimentalMaterial3Api
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.ModalBottomSheet
|
||||
import androidx.compose.material3.SheetState
|
||||
import androidx.compose.material3.Surface
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.rememberModalBottomSheetState
|
||||
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.framework.theme.SettingsDimension
|
||||
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.spaprivileged.framework.common.userManager
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
@@ -193,26 +200,43 @@ class SimOnboardingActivity : SpaBaseDialogActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Composable
|
||||
fun ProgressDialogImpl() {
|
||||
// TODO: 1. Create the SPA's ProgressDialog and using SPA's widget
|
||||
val dialog: ProgressDialog = object : ProgressDialog(this) {
|
||||
override fun onTouchEvent(event: MotionEvent): Boolean {
|
||||
return true
|
||||
if(showDialog.value) {
|
||||
// TODO: Create the SPA's ProgressDialog and using SPA's widget
|
||||
BasicAlertDialog(
|
||||
onDismissRequest = {},
|
||||
modifier = Modifier.width(
|
||||
getDialogWidth()
|
||||
),
|
||||
) {
|
||||
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(
|
||||
R.string.sim_onboarding_progressbar_turning_sim_on,
|
||||
onboardingService.targetSubInfo?.displayName ?: ""
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dialog.setMessage(
|
||||
stringResource(
|
||||
R.string.sim_onboarding_progressbar_turning_sim_on,
|
||||
onboardingService.targetSubInfo?.displayName ?: ""
|
||||
)
|
||||
)
|
||||
dialog.setCancelable(false)
|
||||
|
||||
if(showDialog.value) {
|
||||
dialog.show()
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun registerSidecarReceiverFlow(){
|
||||
switchToEuiccSubscriptionSidecar?.sidecarReceiverFlow()
|
||||
|
||||
@@ -45,7 +45,6 @@ class SimOnboardingService {
|
||||
var activeSubInfoList: List<SubscriptionInfo> = listOf()
|
||||
var slotInfoList: List<UiccSlotInfo> = listOf()
|
||||
var uiccCardInfoList: List<UiccCardInfo> = listOf()
|
||||
var selectedSubInfoList: MutableList<SubscriptionInfo> = mutableListOf()
|
||||
var targetPrimarySimCalls: Int = SubscriptionManager.INVALID_SUBSCRIPTION_ID
|
||||
var targetPrimarySimTexts: Int = SubscriptionManager.INVALID_SUBSCRIPTION_ID
|
||||
var targetPrimarySimMobileData: Int = SubscriptionManager.INVALID_SUBSCRIPTION_ID
|
||||
@@ -56,10 +55,8 @@ class SimOnboardingService {
|
||||
Log.w(TAG, "No DDS")
|
||||
return SubscriptionManager.INVALID_SUBSCRIPTION_ID
|
||||
}
|
||||
return selectedSubInfoList
|
||||
.filter { info ->
|
||||
(info.simSlotIndex != -1) && (info.subscriptionId != targetPrimarySimMobileData)
|
||||
}
|
||||
return userSelectedSubInfoList
|
||||
.filter { info -> info.subscriptionId != targetPrimarySimMobileData }
|
||||
.map { it.subscriptionId }
|
||||
.firstOrNull() ?: SubscriptionManager.INVALID_SUBSCRIPTION_ID
|
||||
}
|
||||
@@ -118,7 +115,6 @@ class SimOnboardingService {
|
||||
&& targetSubInfo != null
|
||||
&& activeSubInfoList.isNotEmpty()
|
||||
&& slotInfoList.isNotEmpty()
|
||||
&& selectedSubInfoList.isNotEmpty()
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
@@ -128,7 +124,6 @@ class SimOnboardingService {
|
||||
activeSubInfoList = listOf()
|
||||
slotInfoList = listOf()
|
||||
uiccCardInfoList = listOf()
|
||||
selectedSubInfoList = mutableListOf()
|
||||
targetPrimarySimCalls = -1
|
||||
targetPrimarySimTexts = -1
|
||||
targetPrimarySimMobileData = -1
|
||||
@@ -151,7 +146,8 @@ class SimOnboardingService {
|
||||
ThreadUtils.postOnBackgroundThread {
|
||||
activeSubInfoList = SubscriptionUtil.getActiveSubscriptions(subscriptionManager)
|
||||
availableSubInfoList = SubscriptionUtil.getAvailableSubscriptions(context)
|
||||
targetSubInfo = availableSubInfoList.find { subInfo -> subInfo.subscriptionId == targetSubId }
|
||||
targetSubInfo =
|
||||
availableSubInfoList.find { subInfo -> subInfo.subscriptionId == targetSubId }
|
||||
targetSubInfo?.let { userSelectedSubInfoList.add(it) }
|
||||
Log.d(
|
||||
TAG, "targetSubId: $targetSubId" + ", targetSubInfo: $targetSubInfo" +
|
||||
@@ -186,7 +182,6 @@ class SimOnboardingService {
|
||||
targetSubInfo?.let { list.add(it) }
|
||||
}
|
||||
|
||||
Log.d(TAG, "list: $list")
|
||||
return list.toList()
|
||||
}
|
||||
|
||||
@@ -206,7 +201,10 @@ class SimOnboardingService {
|
||||
return
|
||||
}
|
||||
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 {
|
||||
@@ -278,11 +276,18 @@ class SimOnboardingService {
|
||||
targetPrimarySimMobileData
|
||||
)
|
||||
|
||||
|
||||
val telephonyManagerForNonDds: TelephonyManager? =
|
||||
context.getSystemService(TelephonyManager::class.java)
|
||||
?.createForSubscriptionId(targetNonDds)
|
||||
setAutomaticData(telephonyManagerForNonDds, targetPrimarySimAutoDataSwitch)
|
||||
var nonDds = targetNonDds
|
||||
Log.d(
|
||||
TAG,
|
||||
"setAutomaticData: targetNonDds: $nonDds," +
|
||||
" targetPrimarySimAutoDataSwitch: $targetPrimarySimAutoDataSwitch"
|
||||
)
|
||||
if (nonDds != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
val telephonyManagerForNonDds: TelephonyManager? =
|
||||
context.getSystemService(TelephonyManager::class.java)
|
||||
?.createForSubscriptionId(nonDds)
|
||||
setAutomaticData(telephonyManagerForNonDds, targetPrimarySimAutoDataSwitch)
|
||||
}
|
||||
|
||||
// no next action, send finish
|
||||
callback(SimOnboardingActivity.CALLBACK_FINISH)
|
||||
|
||||
@@ -219,24 +219,24 @@ fun SimsSectionImpl(
|
||||
mutableStateOf(false)
|
||||
}
|
||||
//TODO: Add the Restricted TwoTargetSwitchPreference in SPA
|
||||
TwoTargetSwitchPreference(remember {
|
||||
object : SwitchPreferenceModel {
|
||||
override val title = subInfo.displayName.toString()
|
||||
override val summary = { subInfo.number }
|
||||
override val checked = {
|
||||
coroutineScope.launch {
|
||||
withContext(Dispatchers.Default) {
|
||||
checked.value = subscriptionManager?.isSubscriptionEnabled(
|
||||
TwoTargetSwitchPreference(
|
||||
object : SwitchPreferenceModel {
|
||||
override val title = subInfo.displayName.toString()
|
||||
override val summary = { subInfo.number }
|
||||
override val checked = {
|
||||
coroutineScope.launch {
|
||||
withContext(Dispatchers.Default) {
|
||||
checked.value = subscriptionManager?.isSubscriptionEnabled(
|
||||
subInfo.subscriptionId)?:false
|
||||
}
|
||||
}
|
||||
checked.value
|
||||
}
|
||||
override val onCheckedChange = { newChecked: Boolean ->
|
||||
startToggleSubscriptionDialog(context, subInfo, newChecked)
|
||||
}
|
||||
checked.value
|
||||
}
|
||||
override val onCheckedChange = { newChecked: Boolean ->
|
||||
startToggleSubscriptionDialog(context, subInfo, newChecked)
|
||||
}
|
||||
}
|
||||
}) {
|
||||
) {
|
||||
startMobileNetworkSettings(context, subInfo)
|
||||
}
|
||||
}
|
||||
@@ -258,7 +258,7 @@ fun SimsSectionImpl(
|
||||
}
|
||||
|
||||
@Composable
|
||||
fun PrimarySimSectionImpl(
|
||||
fun PrimarySimImpl(
|
||||
subscriptionInfoList: List<SubscriptionInfo>,
|
||||
callsSelectedId: MutableIntState,
|
||||
textsSelectedId: MutableIntState,
|
||||
@@ -318,15 +318,18 @@ fun PrimarySimSectionImpl(
|
||||
for (info in subscriptionInfoList) {
|
||||
var item = ListPreferenceOption(
|
||||
id = info.subscriptionId,
|
||||
text = "${info.displayName}"
|
||||
text = "${info.displayName}",
|
||||
summary = "${info.number}"
|
||||
)
|
||||
callsAndSmsList.add(item)
|
||||
dataList.add(item)
|
||||
}
|
||||
callsAndSmsList.add(ListPreferenceOption(
|
||||
callsAndSmsList.add(
|
||||
ListPreferenceOption(
|
||||
id = SubscriptionManager.INVALID_SUBSCRIPTION_ID,
|
||||
text = stringResource(id = R.string.sim_calls_ask_first_prefs_title)
|
||||
))
|
||||
)
|
||||
)
|
||||
} else {
|
||||
// hide the primary sim
|
||||
state.value = false
|
||||
@@ -341,33 +344,31 @@ fun PrimarySimSectionImpl(
|
||||
mutableStateOf(false)
|
||||
}
|
||||
|
||||
Category(title = stringResource(id = R.string.primary_sim_title)) {
|
||||
CreatePrimarySimListPreference(
|
||||
stringResource(id = R.string.primary_sim_calls_title),
|
||||
callsAndSmsList,
|
||||
callsSelectedId,
|
||||
ImageVector.vectorResource(R.drawable.ic_phone),
|
||||
actionSetCalls
|
||||
)
|
||||
CreatePrimarySimListPreference(
|
||||
stringResource(id = R.string.primary_sim_texts_title),
|
||||
callsAndSmsList,
|
||||
textsSelectedId,
|
||||
Icons.AutoMirrored.Outlined.Message,
|
||||
actionSetTexts
|
||||
)
|
||||
CreatePrimarySimListPreference(
|
||||
stringResource(id = R.string.mobile_data_settings_title),
|
||||
dataList,
|
||||
mobileDataSelectedId,
|
||||
Icons.Outlined.DataUsage,
|
||||
actionSetMobileData
|
||||
)
|
||||
}
|
||||
CreatePrimarySimListPreference(
|
||||
stringResource(id = R.string.primary_sim_calls_title),
|
||||
callsAndSmsList,
|
||||
callsSelectedId,
|
||||
ImageVector.vectorResource(R.drawable.ic_phone),
|
||||
actionSetCalls
|
||||
)
|
||||
CreatePrimarySimListPreference(
|
||||
stringResource(id = R.string.primary_sim_texts_title),
|
||||
callsAndSmsList,
|
||||
textsSelectedId,
|
||||
Icons.AutoMirrored.Outlined.Message,
|
||||
actionSetTexts
|
||||
)
|
||||
CreatePrimarySimListPreference(
|
||||
stringResource(id = R.string.mobile_data_settings_title),
|
||||
dataList,
|
||||
mobileDataSelectedId,
|
||||
Icons.Outlined.DataUsage,
|
||||
actionSetMobileData
|
||||
)
|
||||
|
||||
val autoDataTitle = stringResource(id = R.string.primary_sim_automatic_data_title)
|
||||
val autoDataSummary = stringResource(id = R.string.primary_sim_automatic_data_msg)
|
||||
SwitchPreference(remember {
|
||||
SwitchPreference(
|
||||
object : SwitchPreferenceModel {
|
||||
override val title = autoDataTitle
|
||||
override val summary = { autoDataSummary }
|
||||
@@ -375,6 +376,11 @@ fun PrimarySimSectionImpl(
|
||||
if (nonDds.intValue != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
coroutineScope.launch {
|
||||
automaticDataChecked.value = getAutomaticData(telephonyManagerForNonDds)
|
||||
Log.d(
|
||||
NetworkCellularGroupProvider.name,
|
||||
"NonDds:${nonDds.intValue}" +
|
||||
"getAutomaticData:${automaticDataChecked.value}"
|
||||
)
|
||||
}
|
||||
}
|
||||
automaticDataChecked.value
|
||||
@@ -384,7 +390,26 @@ fun PrimarySimSectionImpl(
|
||||
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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -442,32 +467,42 @@ private fun showEuiccSettings(context: Context): Boolean {
|
||||
}
|
||||
|
||||
suspend fun setDefaultVoice(
|
||||
subscriptionManager: SubscriptionManager?,
|
||||
subId: Int): Unit = withContext(Dispatchers.Default) {
|
||||
subscriptionManager?.setDefaultVoiceSubscriptionId(subId)
|
||||
}
|
||||
subscriptionManager: SubscriptionManager?,
|
||||
subId: Int
|
||||
): Unit =
|
||||
withContext(Dispatchers.Default) {
|
||||
subscriptionManager?.setDefaultVoiceSubscriptionId(subId)
|
||||
}
|
||||
|
||||
suspend fun setDefaultSms(
|
||||
subscriptionManager: SubscriptionManager?,
|
||||
subId: Int): Unit = withContext(Dispatchers.Default) {
|
||||
subscriptionManager?.setDefaultSmsSubId(subId)
|
||||
}
|
||||
subscriptionManager: SubscriptionManager?,
|
||||
subId: Int
|
||||
): Unit =
|
||||
withContext(Dispatchers.Default) {
|
||||
subscriptionManager?.setDefaultSmsSubId(subId)
|
||||
}
|
||||
|
||||
suspend fun setDefaultData(context: Context,
|
||||
subscriptionManager: SubscriptionManager?,
|
||||
wifiPickerTrackerHelper: WifiPickerTrackerHelper?,
|
||||
subId: Int): Unit = withContext(Dispatchers.Default) {
|
||||
subscriptionManager?.setDefaultDataSubId(subId)
|
||||
MobileNetworkUtils.setMobileDataEnabled(
|
||||
suspend fun setDefaultData(
|
||||
context: Context,
|
||||
subscriptionManager: SubscriptionManager?,
|
||||
wifiPickerTrackerHelper: WifiPickerTrackerHelper?,
|
||||
subId: Int
|
||||
): Unit =
|
||||
withContext(Dispatchers.Default) {
|
||||
subscriptionManager?.setDefaultDataSubId(subId)
|
||||
MobileNetworkUtils.setMobileDataEnabled(
|
||||
context,
|
||||
subId,
|
||||
true /* enabled */,
|
||||
true /* disableOtherSubscriptions */)
|
||||
if (wifiPickerTrackerHelper != null
|
||||
&& !wifiPickerTrackerHelper.isCarrierNetworkProvisionEnabled(subId)) {
|
||||
wifiPickerTrackerHelper.setCarrierNetworkEnabled(true)
|
||||
true /* disableOtherSubscriptions */
|
||||
)
|
||||
if (wifiPickerTrackerHelper != null
|
||||
&& !wifiPickerTrackerHelper.isCarrierNetworkProvisionEnabled(subId)
|
||||
) {
|
||||
wifiPickerTrackerHelper.setCarrierNetworkEnabled(true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getAutomaticData(telephonyManagerForNonDds: TelephonyManager?): Boolean =
|
||||
withContext(Dispatchers.Default) {
|
||||
telephonyManagerForNonDds != null
|
||||
@@ -478,7 +513,7 @@ suspend fun getAutomaticData(telephonyManagerForNonDds: TelephonyManager?): Bool
|
||||
suspend fun setAutomaticData(telephonyManager: TelephonyManager?, newState: Boolean): Unit =
|
||||
withContext(Dispatchers.Default) {
|
||||
Log.d(
|
||||
"NetworkCellularGroupProvider",
|
||||
NetworkCellularGroupProvider.name,
|
||||
"setAutomaticData: MOBILE_DATA_POLICY_AUTO_DATA_SWITCH as $newState"
|
||||
)
|
||||
telephonyManager?.setMobileDataPolicyEnabled(
|
||||
|
||||
@@ -20,6 +20,7 @@ import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.SignalCellularAlt
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -91,11 +92,13 @@ private fun labelSimBody(onboardingService: SimOnboardingService) {
|
||||
},
|
||||
title = stringResource(R.string.sim_onboarding_label_sim_dialog_title),
|
||||
text = {
|
||||
Text(summaryNumber)
|
||||
Text(summaryNumber,
|
||||
modifier = Modifier.padding(bottom = SettingsDimension.itemPaddingVertical))
|
||||
SettingsOutlinedTextField(
|
||||
value = titleSimName,
|
||||
label = stringResource(R.string.sim_onboarding_label_sim_dialog_label),
|
||||
enabled = true
|
||||
enabled = true,
|
||||
shape = MaterialTheme.shapes.extraLarge
|
||||
) {
|
||||
titleSimName = it
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@ import androidx.compose.material.icons.outlined.SignalCellularAlt
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.MutableIntState
|
||||
import androidx.compose.runtime.mutableIntStateOf
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.saveable.rememberSaveable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
@@ -82,7 +81,7 @@ fun SimOnboardingPrimarySimImpl(
|
||||
callsSelectedId.intValue = onboardingService.targetPrimarySimCalls
|
||||
textsSelectedId.intValue = onboardingService.targetPrimarySimTexts
|
||||
mobileDataSelectedId.intValue = onboardingService.targetPrimarySimMobileData
|
||||
PrimarySimSectionImpl(
|
||||
PrimarySimImpl(
|
||||
subscriptionInfoList = selectedSubscriptionInfoList,
|
||||
callsSelectedId = callsSelectedId,
|
||||
textsSelectedId = textsSelectedId,
|
||||
@@ -110,7 +109,7 @@ fun CreatePrimarySimListPreference(
|
||||
selectedId: MutableIntState,
|
||||
icon: ImageVector,
|
||||
onIdSelected: (id: Int) -> Unit
|
||||
) = ListPreference(remember {
|
||||
) = ListPreference(
|
||||
object : ListPreferenceModel {
|
||||
override val title = title
|
||||
override val options = list
|
||||
@@ -119,5 +118,4 @@ fun CreatePrimarySimListPreference(
|
||||
override val icon = @Composable {
|
||||
SettingsIcon(icon)
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -47,7 +47,6 @@ class SimOnboardingLabelSimTest {
|
||||
on { activeSubInfoList }.doReturn(listOf())
|
||||
on { slotInfoList }.doReturn(listOf())
|
||||
on { uiccCardInfoList }.doReturn(listOf())
|
||||
on { selectedSubInfoList }.doReturn(mutableListOf())
|
||||
|
||||
on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
|
||||
on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
|
||||
|
||||
@@ -47,7 +47,6 @@ class SimOnboardingPageProviderTest {
|
||||
on { activeSubInfoList }.doReturn(listOf())
|
||||
on { slotInfoList }.doReturn(listOf())
|
||||
on { uiccCardInfoList }.doReturn(listOf())
|
||||
on { selectedSubInfoList }.doReturn(mutableListOf())
|
||||
|
||||
on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
|
||||
on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
|
||||
|
||||
@@ -48,7 +48,6 @@ class SimOnboardingPrimarySimTest {
|
||||
on { activeSubInfoList }.doReturn(listOf())
|
||||
on { slotInfoList }.doReturn(listOf())
|
||||
on { uiccCardInfoList }.doReturn(listOf())
|
||||
on { selectedSubInfoList }.doReturn(mutableListOf())
|
||||
|
||||
on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
|
||||
on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
|
||||
|
||||
@@ -47,7 +47,6 @@ class SimOnboardingSelectSimTest {
|
||||
on { activeSubInfoList }.doReturn(listOf())
|
||||
on { slotInfoList }.doReturn(listOf())
|
||||
on { uiccCardInfoList }.doReturn(listOf())
|
||||
on { selectedSubInfoList }.doReturn(mutableListOf())
|
||||
|
||||
on { targetPrimarySimCalls }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
|
||||
on { targetPrimarySimTexts }.doReturn(PRIMARY_SIM_ASK_EVERY_TIME)
|
||||
|
||||
Reference in New Issue
Block a user