diff --git a/res/xml/my_device_info.xml b/res/xml/my_device_info.xml index 6576742e404..6edb5b7023a 100644 --- a/res/xml/my_device_info.xml +++ b/res/xml/my_device_info.xml @@ -114,7 +114,7 @@ settings:controller="com.android.settings.deviceinfo.HardwareInfoPreferenceController"/> - ) { + if (!getIsAvailableAndUpdateEid()) { + keys.add(preferenceKey) } - return super.handlePreferenceTreeClick(preference) } companion object { @@ -122,11 +161,13 @@ class SimEidPreferenceController(context: Context, preferenceKey: String) : * @param eid is the EID string * @return a Bitmap of QR code */ - private fun getEidQrCode(eid: String): Bitmap? = try { - QrCodeGenerator.encodeQrCode(eid, QR_CODE_SIZE) - } catch (exception: Exception) { - Log.w(TAG, "Error when creating QR code width $QR_CODE_SIZE", exception) - null + private suspend fun getEidQrCode(eid: String): Bitmap? = withContext(Dispatchers.Default) { + try { + QrCodeGenerator.encodeQrCode(contents = eid, size = QR_CODE_SIZE) + } catch (exception: Exception) { + Log.w(TAG, "Error when creating QR code width $QR_CODE_SIZE", exception) + null + } } } } diff --git a/src/com/android/settings/network/telephony/TelephonyPreferenceDialog.java b/src/com/android/settings/network/telephony/TelephonyPreferenceDialog.java deleted file mode 100644 index 7dbef0c9de5..00000000000 --- a/src/com/android/settings/network/telephony/TelephonyPreferenceDialog.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (C) 2022 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.settings.network.telephony; - -import android.content.Context; -import android.util.AttributeSet; -import com.android.settingslib.CustomDialogPreferenceCompat; - -/** - * This is DialogPreference for supporting connectivity features. - */ -public class TelephonyPreferenceDialog extends CustomDialogPreferenceCompat { - - public TelephonyPreferenceDialog(Context context, AttributeSet attrs, int defStyleAttr, - int defStyleRes) { - super(context, attrs, defStyleAttr, defStyleRes); - } - - public TelephonyPreferenceDialog(Context context, AttributeSet attrs, int defStyleAttr) { - super(context, attrs, defStyleAttr); - } - - public TelephonyPreferenceDialog(Context context, AttributeSet attrs) { - super(context, attrs); - } - - public TelephonyPreferenceDialog(Context context) { - super(context); - } -}