Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e8e4e06 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11135477 from ec38ce08 to 24Q1-release

Change-Id: I26761bb7b478e0ec196203a744a975d1dc2dea95
parents d6563b83 ec38ce08
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -406,6 +406,10 @@ public class DataNetwork extends StateMachine {
    /** Data network tear down due to preferred data switched to another phone. */
    public static final int TEAR_DOWN_REASON_PREFERRED_DATA_SWITCHED = 30;

    //********************************************************************************************//
    // WHENEVER ADD A NEW TEAR DOWN REASON, PLEASE UPDATE DataDeactivateReasonEnum in enums.proto //
    //********************************************************************************************//

    @IntDef(prefix = {"BANDWIDTH_SOURCE_"},
            value = {
                    BANDWIDTH_SOURCE_UNKNOWN,
+15 −15
Original line number Diff line number Diff line
@@ -1907,10 +1907,10 @@ public class SubscriptionManagerService extends ISub.Stub {
                    + "permission. Returning empty list here.");
            return Collections.emptyList();
        }
        if (isForAllProfiles && !hasPermissions(Manifest.permission.INTERACT_ACROSS_PROFILES)) {
        if (isForAllProfiles && !hasAcrossAllUsersPermission()) {
            //TODO(b/308809058 to determine whether the permission enforcement is needed)
            loge("getActiveSubscriptionInfoList: "
                    + callingPackage + " has no INTERACT_ACROSS_PROFILES permission.");
                    + callingPackage + " has no appropriate permission.");
        }
        return getSubscriptionInfoStreamAsUser(isForAllProfiles
                ? UserHandle.ALL : BINDER_WRAPPER.getCallingUserHandle())
@@ -1951,15 +1951,22 @@ public class SubscriptionManagerService extends ISub.Stub {
            throw new SecurityException("Need READ_PHONE_STATE, READ_PRIVILEGED_PHONE_STATE, or "
                    + "carrier privilege");
        }
        if (isForAllProfiles && !hasPermissions(Manifest.permission.INTERACT_ACROSS_PROFILES)) {
        if (isForAllProfiles && !hasAcrossAllUsersPermission()) {
            //TODO(b/308809058 to determine whether the permission enforcement is needed)
            loge("getActiveSubInfoCount: "
                    + callingPackage + " has no INTERACT_ACROSS_PROFILES permission.");
                    + callingPackage + " has no appropriate permission.");
        }
        return getActiveSubIdListAsUser(false, isForAllProfiles
                ? UserHandle.ALL : BINDER_WRAPPER.getCallingUserHandle()).length;
    }

    /**@return {@code true} if the caller is permitted to see all subscriptions. */
    private boolean hasAcrossAllUsersPermission() {
        return hasPermissions(Manifest.permission.INTERACT_ACROSS_USERS,
                Manifest.permission.INTERACT_ACROSS_USERS_FULL,
                Manifest.permission.INTERACT_ACROSS_PROFILES);
    }

    /**
     * @return the maximum number of subscriptions this device will support at any one time.
     */
@@ -3900,16 +3907,6 @@ public class SubscriptionManagerService extends ISub.Stub {
        }
    }

    /**
     * @return All active subscriptions.
     */
    @NonNull
    private List<SubscriptionInfoInternal> getActiveSubscriptionInfoListAllUser() {
        return mSubscriptionDatabaseManager.getAllSubscriptions().stream()
                .filter(SubscriptionInfoInternal::isActive)
                .collect(Collectors.toList());
    }

    /**
     * Get subscriptions accessible to the caller user.
     *
@@ -4152,7 +4149,10 @@ public class SubscriptionManagerService extends ISub.Stub {
     */
    @VisibleForTesting
    public void updateGroupDisabled() {
        List<SubscriptionInfoInternal> activeSubscriptions = getActiveSubscriptionInfoListAllUser();
        List<SubscriptionInfoInternal> activeSubscriptions = mSubscriptionDatabaseManager
                .getAllSubscriptions().stream()
                .filter(SubscriptionInfoInternal::isActive)
                .collect(Collectors.toList());
        for (SubscriptionInfo oppSubInfo : getOpportunisticSubscriptions(
                mContext.getOpPackageName(), mContext.getFeatureId())) {
            boolean groupDisabled = activeSubscriptions.stream()