[Settings] code refactor - rename isSubscriptionCanBeDisplayed

canSubscriptionBeDisplayed is more readable.

Reasonale:
When cherry-picking ag/12886476 into Android R branch (ag/13209427), a comment from code reviewer suggested this change.
Since ag/12886476 has been merged for a while, another patch for it is perferred option when comparing with reverting that CL and resubmit it.

Bug: 175830728
Change-Id: Ie91eb82504fd7cff6671803a2bc2560139690952
Test: build pass
Merged-In: Ie91eb82504fd7cff6671803a2bc2560139690952
This commit is contained in:
Bonian Chen
2020-12-17 01:59:56 +00:00
parent 150eb72a81
commit c2232020c4
2 changed files with 5 additions and 5 deletions

View File

@@ -170,7 +170,7 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
// Avoid from showing subscription(SIM)s which has been marked as hidden
// For example, only one subscription will be shown when there're multiple
// subscriptions with same group UUID.
if (!isSubscriptionCanBeDisplayed(mContext, subId)) {
if (!canSubscriptionBeDisplayed(mContext, subId)) {
continue;
}
activeSubIds.add(subId);
@@ -308,7 +308,7 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
// For example, only one subscription will be shown when there're multiple
// subscriptions with same group UUID.
.filter(subInfo ->
isSubscriptionCanBeDisplayed(mContext, subInfo.getSubscriptionId()))
canSubscriptionBeDisplayed(mContext, subInfo.getSubscriptionId()))
.count() >= 2;
}
@@ -349,7 +349,7 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
}
@VisibleForTesting
boolean isSubscriptionCanBeDisplayed(Context context, int subId) {
boolean canSubscriptionBeDisplayed(Context context, int subId) {
return (SubscriptionUtil.getAvailableSubscription(context,
ProxySubscriptionManager.getInstance(context), subId) != null);
}