Refresh support screen more often
Support screen is now refreshed in the onResume. This will prevent the situation where you open the support tab and then you cross a hours of operation boundary and the button is not updated. Test: make RunSettingsRoboTests Bug: 33272736 Change-Id: I9312b3b6f711eda91d5d60b3ff30e5ac12bf89c1
This commit is contained in:
@@ -119,6 +119,7 @@ public final class SupportFragment extends InstrumentedFragment implements View.
|
||||
.build(),
|
||||
mNetworkCallback);
|
||||
mSupportItemAdapter.setHasInternet(hasInternet());
|
||||
mSupportItemAdapter.refreshData();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -192,7 +192,7 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
||||
* Create data for the adapter. If there is already data in the adapter, they will be
|
||||
* destroyed and recreated.
|
||||
*/
|
||||
private void refreshData() {
|
||||
void refreshData() {
|
||||
mSupportData.clear();
|
||||
addEscalationCards();
|
||||
addMoreHelpItems();
|
||||
@@ -601,7 +601,8 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
||||
/**
|
||||
* Data for a single support item.
|
||||
*/
|
||||
private static class SupportData {
|
||||
@VisibleForTesting
|
||||
static class SupportData {
|
||||
|
||||
final Intent intent;
|
||||
final int metricsEvent;
|
||||
@@ -688,7 +689,8 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
||||
/**
|
||||
* Data model for escalation cards.
|
||||
*/
|
||||
private static class EscalationData extends SupportData {
|
||||
@VisibleForTesting
|
||||
static class EscalationData extends SupportData {
|
||||
|
||||
@StringRes
|
||||
final int text1;
|
||||
@@ -813,4 +815,9 @@ public final class SupportItemAdapter extends RecyclerView.Adapter<SupportItemAd
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
List<SupportData> getSupportData() {
|
||||
return mSupportData;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user