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

Commit 52bea6b2 authored by Xiangyu/Malcolm Chen's avatar Xiangyu/Malcolm Chen Committed by Android (Google) Code Review
Browse files

Merge "Clean up shouldHideSubscription API"

parents 223e05f3 b2cb5ebf
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -2268,17 +2268,18 @@ public class SubscriptionController extends ISub.Stub {
        return allSubs;
    }

    private boolean isInvisibleSubscription(int subId) {
    private boolean isSubscriptionVisible(int subId) {
        for (SubscriptionInfo info : mCacheOpportunisticSubInfoList) {
            if (info.getSubscriptionId() == subId) {
                return SubscriptionManager.isInvisibleSubscription(info);
                // If group UUID is null, it's stand alone opportunistic profile. So it's visible.
                // otherwise, it's bundled opportunistic profile, and is not visible.
                return info.getGroupUuid() == null;
            }
        }

        return false;
        return true;
    }


    /**
     * @return the list of subId's that are active, is never null but the length maybe 0.
     */
@@ -2288,7 +2289,7 @@ public class SubscriptionController extends ISub.Stub {

        if (visibleOnly) {
            // Grouped opportunistic subscriptions should be hidden.
            allSubs = allSubs.stream().filter(subId -> !isInvisibleSubscription(subId))
            allSubs = allSubs.stream().filter(subId -> isSubscriptionVisible(subId))
                    .collect(Collectors.toList());
        }