summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Aishwarya Mallampati <amallampati@google.com> 2022-11-01 17:04:35 +0000
committer Aishwarya Mallampati <amallampati@google.com> 2023-05-25 18:34:56 +0000
commitfc32ff6c0bbbeeb7dd6c4e0af1f77ce8f19bcbd1 (patch)
tree713e19e18167b4a82651a4a6f26622e123b9148a
parent18db5856cc413949e2d91b3392e5aa32190881ab (diff)
DO NOT MERGE Grant carrier privileges if package has carrier config access.
TelephonyManager#hasCarrierPrivileges internally uses SubscriptionManager#canManageSubscription to decide whether to grant carrier privilege status to an app or not. SubscriptionManager#canManageSubscription returns true if caller APK's certificate matches with one of the mNativeAccessRules or mCarrierConfigAccessRules. This over-grants carrier privilege status to apps that only has mNativeAccessRules. Carrier privilege status should be granted to the caller APK only if it's certificate matches with one of mCarrierConfigAccessRules. Replaced SubscriptionManager#canManageSubscription with PhoneInterfaceManager#hasCarrierConfigAccess which returns true only if caller APK certificates matches with one of mCarrierConfigAccessRules of the given subscription. Bug: 226593252 Test: Manual Testing as explained in b/226593252#comment51 atest CtsTelephonyTestCases Flashed build on raven-userdebug and performed basic funtionality tests Change-Id: I662064529d2a9348f395fe3b541366de8bc2fe7d
-rw-r--r--telephony/java/android/telephony/SubscriptionInfo.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/SubscriptionInfo.java b/telephony/java/android/telephony/SubscriptionInfo.java
index 2d50e08ab922..4719d7374b1b 100644
--- a/telephony/java/android/telephony/SubscriptionInfo.java
+++ b/telephony/java/android/telephony/SubscriptionInfo.java
@@ -18,6 +18,7 @@ package android.telephony;
import static android.text.TextUtils.formatSimple;
+import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
@@ -697,6 +698,15 @@ public class SubscriptionInfo implements Parcelable {
}
/**
+ * @hide
+ * @return mCarrierConfigAccessRules associated with this subscription.
+ */
+ public @NonNull List<UiccAccessRule> getCarrierConfigAccessRules() {
+ return mCarrierConfigAccessRules == null ? Collections.emptyList() :
+ Arrays.asList(mCarrierConfigAccessRules);
+ }
+
+ /**
* Returns the card string of the SIM card which contains the subscription.
*
* Starting with API level 29 Security Patch 2021-04-05, returns the card string if the calling