From f3095002811d1930b5c7f459dd28f075eb86811a Mon Sep 17 00:00:00 2001 From: yomna Date: Tue, 8 Oct 2024 20:35:40 +0000 Subject: [PATCH] Handle IllegalStateExceptions in CellularSecurityPreferenceController Bug: b/354833801, b/369941495, b/371447524, b/371689932 Flag: EXEMPT bug fix Test: m Change-Id: Ic21021016dcfe7fcc9cf2314117ab0e3cc84757e --- .../network/CellularSecurityPreferenceController.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/network/CellularSecurityPreferenceController.java b/src/com/android/settings/network/CellularSecurityPreferenceController.java index f43805ef83a..0b0c2a7e948 100644 --- a/src/com/android/settings/network/CellularSecurityPreferenceController.java +++ b/src/com/android/settings/network/CellularSecurityPreferenceController.java @@ -88,10 +88,10 @@ public class CellularSecurityPreferenceController extends BasePreferenceControll } catch (UnsupportedOperationException e) { Log.i(LOG_TAG, "Null cipher enablement is unsupported, hiding divider: " + e.getMessage()); - } catch (Exception e) { + } catch (IllegalStateException e) { Log.e(LOG_TAG, "Failed isNullCipherAndIntegrityEnabled. Setting availability to " - + "CONDITIONALLY_UNAVAILABLE. Exception: " + + "UNSUPPORTED_ON_DEVICE. Exception: " + e.getMessage()); } @@ -104,6 +104,12 @@ public class CellularSecurityPreferenceController extends BasePreferenceControll } catch (UnsupportedOperationException e) { Log.i(LOG_TAG, "Cellular security notifications are unsupported, hiding divider: " + e.getMessage()); + } catch (IllegalStateException e) { + Log.e(LOG_TAG, + "Failed isNullCipherNotificationsEnabled, " + + "isCellularIdentifierDisclosureNotificationsEnabled. " + + "Setting availability to UNSUPPORTED_ON_DEVICE. Exception: " + + e.getMessage()); } if (isNullCipherDisablementAvailable || areCellSecNotificationsAvailable) {