Merge "Request support rules to refresh when account changes." into nyc-mr1-dev

This commit is contained in:
TreeHugger Robot
2016-07-13 01:13:01 +00:00
committed by Android (Google) Code Review
2 changed files with 7 additions and 1 deletions

View File

@@ -89,7 +89,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
} else { } else {
mSelectedCountry = mSupportFeatureProvider.getCurrentCountryCodeIfHasConfig(PHONE); mSelectedCountry = mSupportFeatureProvider.getCurrentCountryCodeIfHasConfig(PHONE);
} }
setAccount(mSupportFeatureProvider.getSupportEligibleAccount(mActivity)); mAccount = mSupportFeatureProvider.getSupportEligibleAccount(mActivity);
refreshData(); refreshData();
} }
@@ -155,6 +155,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
public void setAccount(Account account) { public void setAccount(Account account) {
if (!Objects.equals(mAccount, account)) { if (!Objects.equals(mAccount, account)) {
mAccount = account; mAccount = account;
mSupportFeatureProvider.refreshOperationRules();
refreshData(); refreshData();
} }
} }

View File

@@ -51,6 +51,11 @@ public interface SupportFeatureProvider {
*/ */
boolean isSupportTypeEnabled(Context context, @SupportType int type); boolean isSupportTypeEnabled(Context context, @SupportType int type);
/**
* Refreshes all operation rules.
*/
void refreshOperationRules();
/** /**
* Whether or not a support type is in operation 24/7. If country is null, use * Whether or not a support type is in operation 24/7. If country is null, use
* current country. * current country.