From 4b2d4ae984e8de35c5105c7d25681266159c67d8 Mon Sep 17 00:00:00 2001 From: Jonas Larsson Date: Thu, 21 Mar 2024 09:48:36 -0700 Subject: [PATCH] Guard CellularSecurityPreferenceController with FEATURE_TELEPHONY TelephonyManager is only available if Packagemanager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY) returns true. If false we should return UNSUPPORTED_ON_DEVICE. Bug: 330726177 Test: m & manual Change-Id: I1c2a1cb1f61b58f448ef207b2391dd9c262f6848 --- .../network/CellularSecurityPreferenceController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/network/CellularSecurityPreferenceController.java b/src/com/android/settings/network/CellularSecurityPreferenceController.java index 237e7040fca..f43805ef83a 100644 --- a/src/com/android/settings/network/CellularSecurityPreferenceController.java +++ b/src/com/android/settings/network/CellularSecurityPreferenceController.java @@ -19,6 +19,7 @@ package com.android.settings.network; import android.app.settings.SettingsEnums; import android.content.Context; import android.content.Intent; +import android.content.pm.PackageManager; import android.os.Build; import android.os.Bundle; import android.safetycenter.SafetyCenterManager; @@ -65,7 +66,8 @@ public class CellularSecurityPreferenceController extends BasePreferenceControll @Override public int getAvailabilityStatus() { - if (!Flags.enableIdentifierDisclosureTransparencyUnsolEvents() + if (!mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEPHONY) + || !Flags.enableIdentifierDisclosureTransparencyUnsolEvents() || !Flags.enableModemCipherTransparencyUnsolEvents() || !Flags.enableIdentifierDisclosureTransparency() || !Flags.enableModemCipherTransparency()) {