Merge "DO NOT MERGE Fixing the failing tests" into pi-car-dev
diff --git a/src/com/android/car/settings/datausage/AppDataUsageFragment.java b/src/com/android/car/settings/datausage/AppDataUsageFragment.java
index b613e68..2c756e2 100644
--- a/src/com/android/car/settings/datausage/AppDataUsageFragment.java
+++ b/src/com/android/car/settings/datausage/AppDataUsageFragment.java
@@ -97,14 +97,13 @@
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
- Bundle bundle = getBundleForNetworkStats();
+ mBundle = getBundleForNetworkStats();
LoaderManager loaderManager = LoaderManager.getInstance(this);
- mAppsNetworkStatsManager.startLoading(loaderManager, bundle);
+ mAppsNetworkStatsManager.startLoading(loaderManager, mBundle);
}
- @VisibleForTesting
- Bundle getBundleForNetworkStats() {
+ private Bundle getBundleForNetworkStats() {
long historyStart = System.currentTimeMillis();
long historyEnd = historyStart + 1;
@@ -139,4 +138,9 @@
return SummaryForAllUidLoader.buildArgs(mNetworkTemplate, start, end);
}
+
+ @VisibleForTesting(otherwise = VisibleForTesting.NONE)
+ Bundle getBundle() {
+ return mBundle;
+ }
}
diff --git a/tests/robotests/src/com/android/car/settings/datausage/AppDataUsageFragmentTest.java b/tests/robotests/src/com/android/car/settings/datausage/AppDataUsageFragmentTest.java
index e4cf647..c94cfa8 100644
--- a/tests/robotests/src/com/android/car/settings/datausage/AppDataUsageFragmentTest.java
+++ b/tests/robotests/src/com/android/car/settings/datausage/AppDataUsageFragmentTest.java
@@ -85,7 +85,7 @@
public void onActivityCreated_policyIsNull_startAndEndDateShouldHaveFourWeeksDifference() {
mFragmentController.create();
- Bundle bundle = mFragment.getBundleForNetworkStats();
+ Bundle bundle = mFragment.getBundle();
long start = bundle.getLong(KEY_START);
long end = bundle.getLong(KEY_END);
long timeDiff = end - start;
@@ -102,7 +102,7 @@
ShadowNetworkPolicyManager.setCycleIterator(iterator);
mFragmentController.create();
- Bundle bundle = mFragment.getBundleForNetworkStats();
+ Bundle bundle = mFragment.getBundle();
long start = bundle.getLong(KEY_START);
long end = bundle.getLong(KEY_END);
long timeDiff = end - start;
@@ -130,7 +130,7 @@
ShadowNetworkPolicyManager.setCycleIterator(iterator);
mFragmentController.create();
- Bundle bundle = mFragment.getBundleForNetworkStats();
+ Bundle bundle = mFragment.getBundle();
long start = bundle.getLong(KEY_START);
long end = bundle.getLong(KEY_END);