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

Commit 84f8961e authored by Colin Cross's avatar Colin Cross
Browse files

Fix kotlin nullable errors in Settings

Fix kotlin nullable errors that were exposed by setting the retention
of android.annotation.NonNull and android.annotation.Nullable to
class retention.

Bug: 294110802
Test: builds
Change-Id: I6aa0516fa4f6443b6d4dff873baf3b08ff9189f0
Merged-In: I6aa0516fa4f6443b6d4dff873baf3b08ff9189f0
parent dc5fd85f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ class RegulatoryInfoDisplayActivity : Activity() {

        getRegulatoryInfo()?.let {
            val view = layoutInflater.inflate(R.layout.regulatory_info, null)
            val image = view.findViewById<ImageView>(R.id.regulatoryInfo)
            val image = view.requireViewById<ImageView>(R.id.regulatoryInfo)
            image.setImageDrawable(it)
            builder.setView(view)
            builder.show()
+2 −2
Original line number Diff line number Diff line
@@ -106,8 +106,8 @@ class FingerprintSettingsRenameDialog : InstrumentedDialogFragment() {
        val dialog = FingerprintSettingsRenameDialog()
        val onClick =
          DialogInterface.OnClickListener { _, _ ->
            val dialogTextField =
              dialog.requireDialog().findViewById(R.id.fingerprint_rename_field) as ImeAwareEditText
            val dialogTextField = dialog.requireDialog()
                .requireViewById(R.id.fingerprint_rename_field) as ImeAwareEditText
            val newName = dialogTextField.text.toString()
            if (!TextUtils.equals(newName, fp.name)) {
              Log.d(TAG, "rename $fp.name to $newName for $dialog")
+2 −2
Original line number Diff line number Diff line
@@ -95,10 +95,10 @@ class SimEidPreferenceController(context: Context, preferenceKey: String) :
            WindowManager.LayoutParams.FLAG_SECURE
        )
        dialog.setCanceledOnTouchOutside(false)
        val textView = dialog.findViewById<TextView>(R.id.esim_id_value)
        val textView = dialog.requireViewById<TextView>(R.id.esim_id_value)
        textView.text = PhoneNumberUtil.expandByTts(eid)

        val qrCodeView = dialog.findViewById<ImageView>(R.id.esim_id_qrcode)
        val qrCodeView = dialog.requireViewById<ImageView>(R.id.esim_id_qrcode)
        qrCodeView.setImageBitmap(getEidQrCode(eid))

        // After "Tap to show", eid is displayed on preference.
+2 −2
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ class FullScreenIntentPermissionPreferenceController(
    private fun isPermissionRequested(): Boolean {
        val packageInfo = packageManager.getPackageInfo(packageName, GET_PERMISSIONS)

        for (requestedPermission in packageInfo.requestedPermissions) {
        for (requestedPermission in packageInfo.requestedPermissions.orEmpty()) {
            if (USE_FULL_SCREEN_INTENT.equals(requestedPermission)) {
                return true
            }
+1 −1
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ private class AppButtonsPresenter(private val packageInfoPresenter: PackageInfoP
    @Composable
    fun getActionButtons() =
        packageInfoPresenter.flow.collectAsStateWithLifecycle(initialValue = null).value?.let {
            getActionButtons(it.applicationInfo)
            getActionButtons(checkNotNull(it.applicationInfo))
        } ?: emptyList()

    @Composable
Loading