Update copy for battery estimate related features

Many features are using the enhanced estimates but the copy for them
has gotten out of sync. This CL moves shared strings between Settings
and SysUI to SettingsLib and also updates features that use the
strings to have consistent behavior/text.

Test: Robotests
Bug: 65656091
Bug: 66909350
Bug: 67469159
Change-Id: Ie5ef1ed65429ca9805cff374f1439e5d61eb6591
This commit is contained in:
Salvador Martinez
2018-01-19 16:33:35 -08:00
parent d7557125c6
commit 408dc41228
18 changed files with 185 additions and 400 deletions

View File

@@ -58,6 +58,7 @@ import com.android.settingslib.applications.AppUtils;
import com.android.settingslib.applications.ApplicationsState;
import com.android.settingslib.core.AbstractPreferenceController;
import com.android.settingslib.utils.StringUtil;
import java.util.ArrayList;
import java.util.List;
@@ -284,10 +285,10 @@ public class AdvancedPowerUsageDetail extends DashboardFragment implements
final int powerMah = bundle.getInt(EXTRA_POWER_USAGE_AMOUNT);
mForegroundPreference.setSummary(
TextUtils.expandTemplate(getText(R.string.battery_used_for),
Utils.formatElapsedTime(context, foregroundTimeMs, false)));
StringUtil.formatElapsedTime(context, foregroundTimeMs, false)));
mBackgroundPreference.setSummary(
TextUtils.expandTemplate(getText(R.string.battery_active_for),
Utils.formatElapsedTime(context, backgroundTimeMs, false)));
StringUtil.formatElapsedTime(context, backgroundTimeMs, false)));
mPowerUsagePreference.setSummary(
getString(R.string.battery_detail_power_percentage, usagePercent, powerMah));
}