Added builder for SubscriptionInfo
Added the builder for SubscriptionInfo, and make all members final. This can prevent other clients accidentally modifying the same copy of SubscriptionInfo. Also moved getAllAccessRules into getAccessRules. Bug: 239607619 Bug: 247140269 Test: Manual + atest SubscriptionInfoTest Change-Id: If2973d78579cc0d0d3c6720d22a4b49a04a2b813
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -3106,7 +3106,7 @@ public class SubscriptionManager {
|
|||||||
@SystemApi
|
@SystemApi
|
||||||
public boolean canManageSubscription(@NonNull SubscriptionInfo info,
|
public boolean canManageSubscription(@NonNull SubscriptionInfo info,
|
||||||
@NonNull String packageName) {
|
@NonNull String packageName) {
|
||||||
if (info == null || info.getAllAccessRules() == null || packageName == null) {
|
if (info == null || info.getAccessRules() == null || packageName == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
PackageManager packageManager = mContext.getPackageManager();
|
PackageManager packageManager = mContext.getPackageManager();
|
||||||
@@ -3118,7 +3118,7 @@ public class SubscriptionManager {
|
|||||||
logd("Unknown package: " + packageName);
|
logd("Unknown package: " + packageName);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (UiccAccessRule rule : info.getAllAccessRules()) {
|
for (UiccAccessRule rule : info.getAccessRules()) {
|
||||||
if (rule.getCarrierPrivilegeStatus(packageInfo)
|
if (rule.getCarrierPrivilegeStatus(packageInfo)
|
||||||
== TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {
|
== TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user