Loading src/com/android/settings/network/CellularSecurityPreferenceController.java +10 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.safetycenter.SafetyCenterManager; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; Loading @@ -38,6 +39,8 @@ import com.android.settings.core.BasePreferenceController; import com.android.settings.core.SubSettingLauncher; import com.android.settings.network.telephony.CellularSecuritySettingsFragment; import java.util.List; /** * {@link BasePreferenceController} for accessing Cellular Security settings from Network & * Internet Settings menu. Loading Loading @@ -78,6 +81,13 @@ public class CellularSecurityPreferenceController extends BasePreferenceControll mTelephonyManager = mContext.getSystemService(TelephonyManager.class); } // Check there are valid SIM cards which can be displayed to the user, otherwise this // settings should not be shown. List<SubscriptionInfo> availableSubs = SubscriptionUtil.getAvailableSubscriptions(mContext); if (availableSubs.isEmpty()) { return CONDITIONALLY_UNAVAILABLE; } boolean isNullCipherDisablementAvailable = false; boolean areCellSecNotificationsAvailable = false; try { Loading src/com/android/settings/network/telephony/CellularSecurityEncryptionDividerController.java +11 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.settings.network.telephony; import android.content.Context; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; import android.util.Log; Loading @@ -25,6 +26,9 @@ import androidx.annotation.NonNull; import com.android.internal.telephony.flags.FeatureFlags; import com.android.internal.telephony.flags.FeatureFlagsImpl; import com.android.settings.core.BasePreferenceController; import com.android.settings.network.SubscriptionUtil; import java.util.List; /** * {@link BasePreferenceController} for visibility of Encryption divider on Cellular Security Loading Loading @@ -58,6 +62,13 @@ public class CellularSecurityEncryptionDividerController extends mTelephonyManager = mContext.getSystemService(TelephonyManager.class); } // Check there are valid SIM cards which can be displayed to the user, otherwise this // settings should not be shown. List<SubscriptionInfo> availableSubs = SubscriptionUtil.getAvailableSubscriptions(mContext); if (availableSubs.isEmpty()) { return CONDITIONALLY_UNAVAILABLE; } try { mTelephonyManager.isNullCipherAndIntegrityPreferenceEnabled(); } catch (UnsupportedOperationException e) { Loading src/com/android/settings/network/telephony/CellularSecurityNotificationsDividerController.java +10 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings.network.telephony; import android.content.Context; import android.os.Build; import android.safetycenter.SafetyCenterManager; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; import android.util.Log; Loading @@ -27,6 +28,9 @@ import androidx.annotation.VisibleForTesting; import com.android.internal.telephony.flags.Flags; import com.android.settings.core.BasePreferenceController; import com.android.settings.network.SubscriptionUtil; import java.util.List; /** * {@link BasePreferenceController} for visibility of Notifications divider on Cellular Security Loading Loading @@ -69,6 +73,12 @@ public class CellularSecurityNotificationsDividerController extends Log.w(LOG_TAG, "Telephony manager not yet initialized"); mTelephonyManager = mContext.getSystemService(TelephonyManager.class); } // Check there are valid SIM cards which can be displayed to the user, otherwise this // settings should not be shown. List<SubscriptionInfo> availableSubs = SubscriptionUtil.getAvailableSubscriptions(mContext); if (availableSubs.isEmpty()) { return CONDITIONALLY_UNAVAILABLE; } // Checking for hardware support, i.e. IRadio AIDL version must be >= 2.2 try { // Must call both APIs, as we can't use the combined toggle if both aren't available Loading src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceController.java +11 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings.network.telephony; import android.content.Context; import android.os.Build; import android.safetycenter.SafetyCenterManager; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; import android.util.Log; Loading @@ -26,6 +27,9 @@ import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import com.android.internal.telephony.flags.Flags; import com.android.settings.network.SubscriptionUtil; import java.util.List; /** * {@link TelephonyTogglePreferenceController} for accessing Cellular Security settings through Loading Loading @@ -75,6 +79,13 @@ public class CellularSecurityNotificationsPreferenceController extends return UNSUPPORTED_ON_DEVICE; } // Check there are valid SIM cards which can be displayed to the user, otherwise this // setting should not be shown. List<SubscriptionInfo> availableSubs = SubscriptionUtil.getAvailableSubscriptions(mContext); if (availableSubs.isEmpty()) { return CONDITIONALLY_UNAVAILABLE; } // Checking for hardware support, i.e. IRadio AIDL version must be >= 2.2 try { areNotificationsEnabled(); Loading Loading
src/com/android/settings/network/CellularSecurityPreferenceController.java +10 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.safetycenter.SafetyCenterManager; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; import android.text.TextUtils; import android.util.Log; Loading @@ -38,6 +39,8 @@ import com.android.settings.core.BasePreferenceController; import com.android.settings.core.SubSettingLauncher; import com.android.settings.network.telephony.CellularSecuritySettingsFragment; import java.util.List; /** * {@link BasePreferenceController} for accessing Cellular Security settings from Network & * Internet Settings menu. Loading Loading @@ -78,6 +81,13 @@ public class CellularSecurityPreferenceController extends BasePreferenceControll mTelephonyManager = mContext.getSystemService(TelephonyManager.class); } // Check there are valid SIM cards which can be displayed to the user, otherwise this // settings should not be shown. List<SubscriptionInfo> availableSubs = SubscriptionUtil.getAvailableSubscriptions(mContext); if (availableSubs.isEmpty()) { return CONDITIONALLY_UNAVAILABLE; } boolean isNullCipherDisablementAvailable = false; boolean areCellSecNotificationsAvailable = false; try { Loading
src/com/android/settings/network/telephony/CellularSecurityEncryptionDividerController.java +11 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.settings.network.telephony; import android.content.Context; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; import android.util.Log; Loading @@ -25,6 +26,9 @@ import androidx.annotation.NonNull; import com.android.internal.telephony.flags.FeatureFlags; import com.android.internal.telephony.flags.FeatureFlagsImpl; import com.android.settings.core.BasePreferenceController; import com.android.settings.network.SubscriptionUtil; import java.util.List; /** * {@link BasePreferenceController} for visibility of Encryption divider on Cellular Security Loading Loading @@ -58,6 +62,13 @@ public class CellularSecurityEncryptionDividerController extends mTelephonyManager = mContext.getSystemService(TelephonyManager.class); } // Check there are valid SIM cards which can be displayed to the user, otherwise this // settings should not be shown. List<SubscriptionInfo> availableSubs = SubscriptionUtil.getAvailableSubscriptions(mContext); if (availableSubs.isEmpty()) { return CONDITIONALLY_UNAVAILABLE; } try { mTelephonyManager.isNullCipherAndIntegrityPreferenceEnabled(); } catch (UnsupportedOperationException e) { Loading
src/com/android/settings/network/telephony/CellularSecurityNotificationsDividerController.java +10 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings.network.telephony; import android.content.Context; import android.os.Build; import android.safetycenter.SafetyCenterManager; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; import android.util.Log; Loading @@ -27,6 +28,9 @@ import androidx.annotation.VisibleForTesting; import com.android.internal.telephony.flags.Flags; import com.android.settings.core.BasePreferenceController; import com.android.settings.network.SubscriptionUtil; import java.util.List; /** * {@link BasePreferenceController} for visibility of Notifications divider on Cellular Security Loading Loading @@ -69,6 +73,12 @@ public class CellularSecurityNotificationsDividerController extends Log.w(LOG_TAG, "Telephony manager not yet initialized"); mTelephonyManager = mContext.getSystemService(TelephonyManager.class); } // Check there are valid SIM cards which can be displayed to the user, otherwise this // settings should not be shown. List<SubscriptionInfo> availableSubs = SubscriptionUtil.getAvailableSubscriptions(mContext); if (availableSubs.isEmpty()) { return CONDITIONALLY_UNAVAILABLE; } // Checking for hardware support, i.e. IRadio AIDL version must be >= 2.2 try { // Must call both APIs, as we can't use the combined toggle if both aren't available Loading
src/com/android/settings/network/telephony/CellularSecurityNotificationsPreferenceController.java +11 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.settings.network.telephony; import android.content.Context; import android.os.Build; import android.safetycenter.SafetyCenterManager; import android.telephony.SubscriptionInfo; import android.telephony.TelephonyManager; import android.util.Log; Loading @@ -26,6 +27,9 @@ import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import com.android.internal.telephony.flags.Flags; import com.android.settings.network.SubscriptionUtil; import java.util.List; /** * {@link TelephonyTogglePreferenceController} for accessing Cellular Security settings through Loading Loading @@ -75,6 +79,13 @@ public class CellularSecurityNotificationsPreferenceController extends return UNSUPPORTED_ON_DEVICE; } // Check there are valid SIM cards which can be displayed to the user, otherwise this // setting should not be shown. List<SubscriptionInfo> availableSubs = SubscriptionUtil.getAvailableSubscriptions(mContext); if (availableSubs.isEmpty()) { return CONDITIONALLY_UNAVAILABLE; } // Checking for hardware support, i.e. IRadio AIDL version must be >= 2.2 try { areNotificationsEnabled(); Loading