Browse Source

refactor: remove low nvram warnings (#263)

It did not work as expected and may require an external, continuously updated profile size database as a statistical reference.

Reviewed-on: https://gitea.angry.im/PeterCxy/OpenEUICC/pulls/263
Co-authored-by: septs <github@septs.pw>
Co-committed-by: septs <github@septs.pw>
septs 2 months ago
parent
commit
6b0e058d5c

+ 0 - 23
app-common/src/main/java/im/angry/openeuicc/ui/wizard/DownloadWizardSlotSelectFragment.kt

@@ -7,7 +7,6 @@ import android.view.View
 import android.view.ViewGroup
 import android.widget.CheckBox
 import android.widget.TextView
-import androidx.appcompat.app.AlertDialog
 import androidx.lifecycle.lifecycleScope
 import androidx.recyclerview.widget.DividerItemDecoration
 import androidx.recyclerview.widget.LinearLayoutManager
@@ -25,9 +24,6 @@ import kotlinx.coroutines.launch
 
 class DownloadWizardSlotSelectFragment : DownloadWizardActivity.DownloadWizardStepFragment() {
     companion object {
-        const val LOW_NVRAM_THRESHOLD =
-            30 * 1024 // < 30 KiB, alert about potential download failure
-
         fun decodeSyntheticSlotId(id: Int): Pair<Int, EuiccChannel.SecureElementId> =
             Pair(id shr 16, EuiccChannel.SecureElementId.createFromInt(id and 0xFF))
     }
@@ -68,25 +64,6 @@ class DownloadWizardSlotSelectFragment : DownloadWizardActivity.DownloadWizardSt
 
     override fun createPrevFragment(): DownloadWizardActivity.DownloadWizardStepFragment? = null
 
-    override fun beforeNext() {
-        super.beforeNext()
-
-        if (adapter.selected.freeSpace < LOW_NVRAM_THRESHOLD) {
-            val activity = requireActivity()
-
-            AlertDialog.Builder(requireContext()).apply {
-                setTitle(R.string.profile_download_low_nvram_title)
-                setMessage(R.string.profile_download_low_nvram_message)
-                setCancelable(true)
-                setPositiveButton(android.R.string.ok, null)
-                setNegativeButton(android.R.string.cancel) { _, _ ->
-                    activity.finish()
-                }
-                show()
-            }
-        }
-    }
-
     override fun onCreateView(
         inflater: LayoutInflater,
         container: ViewGroup?,

+ 0 - 2
app-common/src/main/res/values-ja/strings.xml

@@ -49,8 +49,6 @@
     <string name="profile_download_confirmation_code">確認コード (オプション)</string>
     <string name="profile_download_confirmation_code_required">確認コード (必須)</string>
     <string name="profile_download_imei">IMEI (オプション)</string>
-    <string name="profile_download_low_nvram_title">残りの容量が少量です</string>
-    <string name="profile_download_low_nvram_message">残り容量が少ないため、このプロファイルのダウンロードに失敗する可能性があります。</string>
     <string name="profile_download_no_lpa_string">クリップボードに LPA コードがありません</string>
     <string name="profile_download_incorrect_lpa_string">解析できません</string>
     <string name="profile_download_incorrect_lpa_string_message">QR コードまたはクリップボードの内容を LPA コードとして解析できませんでした。</string>

+ 0 - 2
app-common/src/main/res/values-zh-rCN/strings.xml

@@ -45,8 +45,6 @@
     <string name="euicc_info_fw_ver">产品固件版本</string>
     <string name="profile_download_confirmation_code_required">确认码 (必需)</string>
     <string name="profile_download_imei">IMEI (可选)</string>
-    <string name="profile_download_low_nvram_title">剩余空间不足</string>
-    <string name="profile_download_low_nvram_message">当前芯片的剩余空间不足,可能导致配置下载失败。\n是否继续下载?</string>
     <string name="download_wizard_error_suggest_network_unreachable">请连接到其他网络(例如在 Wi-Fi 和数据之间切换)后重试。</string>
     <string name="logs_saved_message">日志已保存到指定路径。需要通过其他 App 分享吗?</string>
     <string name="profile_rename_new_name">新昵称</string>

+ 0 - 2
app-common/src/main/res/values-zh-rTW/strings.xml

@@ -45,8 +45,6 @@
     <string name="euicc_info_fw_ver">產品韌體版本</string>
     <string name="profile_download_confirmation_code_required">確認碼 (必需)</string>
     <string name="profile_download_imei">IMEI (可選)</string>
-    <string name="profile_download_low_nvram_title">剩餘空間不足</string>
-    <string name="profile_download_low_nvram_message">目前晶片的剩餘空間不足,可能導致設定檔下載失敗。\n是否繼續下載?</string>
     <string name="download_wizard_error_suggest_network_unreachable">請連線到其他網路(例如在 Wi-Fi 和行動網路之間切換)後重試。</string>
     <string name="logs_saved_message">日誌已儲存到指定路徑。需要透過其他 App 分享嗎?</string>
     <string name="profile_rename_new_name">新名稱</string>

+ 0 - 2
app-common/src/main/res/values/strings.xml

@@ -65,8 +65,6 @@
     <string name="profile_download_confirmation_code_required">Confirmation Code (Required)</string>
     <string name="profile_download_imei">IMEI (Optional)</string>
 
-    <string name="profile_download_low_nvram_title">Low remaining capacity</string>
-    <string name="profile_download_low_nvram_message">This profile may fail to download due to low remaining capacity.</string>
     <string name="profile_download_no_lpa_string">No LPA code found in clipboard</string>
     <string name="profile_download_incorrect_lpa_string">Unable to parse</string>
     <string name="profile_download_incorrect_lpa_string_message">Could not parse QR code or clipboard content as a LPA code.</string>