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

Commit 4c7c5de9 authored by Xiangyu/Malcolm Chen's avatar Xiangyu/Malcolm Chen Committed by android-build-merger
Browse files

Merge "Clean up shouldHideSubscription API" am: b85117c4

am: a25c06ae

Change-Id: Id5b28134d2d7a29bbc10cf563a7536438cb7acdd
parents 49d0dfd5 a25c06ae
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -2301,17 +2301,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.
     */
@@ -2321,7 +2322,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());
        }