Show "0 B used" when no data usage this cycle
When the latest cycle has no data usage, currently it shows all time usage without cycle info, which could confuse user. Change to "0 B used used xxx - xxx" to fix this issue. Fix: 292346951 Test: manual - on Mobile Settings Test: unit tests Change-Id: Ic06fd63a3bc049d70538d0a3cd1fa3d62dbd71d7
This commit is contained in:
@@ -107,7 +107,7 @@ class DataUsagePreferenceController(context: Context, key: String) :
|
||||
|
||||
private fun getDataUsageSummary(): String? {
|
||||
val repository = createNetworkCycleDataRepository() ?: return null
|
||||
repository.loadFirstCycle()?.takeIf { it.usage > 0 }?.let { usageData ->
|
||||
repository.loadFirstCycle()?.let { usageData ->
|
||||
return mContext.getString(
|
||||
R.string.data_usage_template,
|
||||
usageData.formatUsage(mContext),
|
||||
|
||||
Reference in New Issue
Block a user