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

Commit f8bc0841 authored by Charlotte Lu's avatar Charlotte Lu
Browse files

When apn is read only, hide the save button.

Test: Visual Test
Fix: 320200491
Change-Id: I8280fdaa3643a982137936473d827b8502a6e023
parent 59d67c3d
Loading
Loading
Loading
Loading
+16 −12
Original line number Diff line number Diff line
@@ -101,6 +101,7 @@ fun ApnPage(apnDataInit: ApnData, apnDataCur: MutableState<ApnData>, uriInit: Ur
    RegularScaffold(
        title = if (apnDataInit.newApn) stringResource(id = R.string.apn_add) else stringResource(id = R.string.apn_edit),
        actions = {
            if (!apnData.customizedConfig.readOnlyApn) {
                IconButton(onClick = {
                    if (!apnData.validEnabled) apnData = apnData.copy(validEnabled = true)
                    val valid = validateAndSaveApnData(
@@ -112,6 +113,7 @@ fun ApnPage(apnDataInit: ApnData, apnDataCur: MutableState<ApnData>, uriInit: Ur
                    )
                    if (valid) navController.navigateBack()
                }) { Icon(imageVector = Icons.Outlined.Done, contentDescription = null) }
            }
        },
    ) {
        Column {
@@ -212,7 +214,9 @@ fun ApnPage(apnDataInit: ApnData, apnDataCur: MutableState<ApnData>, uriInit: Ur
                emptyVal = stringResource(R.string.network_type_unspecified),
                enabled = apnData.networkTypeEnabled
            ) {}
            if (!apnData.newApn) {
            if (!apnData.newApn && !apnData.customizedConfig.readOnlyApn
                && apnData.customizedConfig.isAddApnAllowed
            ) {
                Preference(
                    object : PreferenceModel {
                        override val title = stringResource(R.string.menu_delete)