Update strings for summary tip.
1. Strings for the tip preference 2. Strings for the tip dialog Change-Id: I59c371328ec735a0b22f707d440f3be85cf59c77 Fixes: 79171948 Test: Manual & RunSettingsRoboTests
This commit is contained in:
@@ -199,7 +199,7 @@ public class BatteryTipDialogFragmentTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOnCreateDialog_summaryTipWithEstimation_fireDialogWithEstimation() {
|
||||
public void testOnCreateDialog_summaryTip_fireDialog() {
|
||||
doReturn(AVERAGE_TIME_MS).when(mSummaryTip).getAverageTimeMs();
|
||||
mDialogFragment = BatteryTipDialogFragment.newInstance(mSummaryTip, METRICS_KEY);
|
||||
|
||||
@@ -209,20 +209,8 @@ public class BatteryTipDialogFragmentTest {
|
||||
ShadowAlertDialog shadowDialog = shadowOf(dialog);
|
||||
|
||||
assertThat(shadowDialog.getMessage()).isEqualTo(
|
||||
"Based on your usage, your battery usually lasts about 1 hr when fully charged"
|
||||
+ ".\n\nIf you need to extend your battery life, turn on Battery Saver.");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testOnCreateDialog_summaryTipWithoutEstimation_fireDialogWithoutEstimation() {
|
||||
mDialogFragment = BatteryTipDialogFragment.newInstance(mSummaryTip, METRICS_KEY);
|
||||
|
||||
FragmentTestUtil.startFragment(mDialogFragment);
|
||||
|
||||
final AlertDialog dialog = (AlertDialog) ShadowDialog.getLatestDialog();
|
||||
ShadowAlertDialog shadowDialog = shadowOf(dialog);
|
||||
|
||||
assertThat(shadowDialog.getMessage()).isEqualTo(
|
||||
"If you need to extend your battery life, turn on Battery Saver");
|
||||
"Your apps are using a normal amount of battery. If apps use too much battery, "
|
||||
+ "your phone will suggest actions you can take.\n\nYou can always turn"
|
||||
+ " on Battery Saver if you’re running low on battery.");
|
||||
}
|
||||
}
|
||||
|
@@ -37,6 +37,7 @@ import android.support.v7.preference.PreferenceScreen;
|
||||
import android.text.format.DateUtils;
|
||||
|
||||
import com.android.internal.logging.nano.MetricsProto;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.SettingsActivity;
|
||||
import com.android.settings.core.InstrumentedPreferenceFragment;
|
||||
import com.android.settings.fuelgauge.batterytip.tips.BatteryTip;
|
||||
@@ -181,7 +182,9 @@ public class BatteryTipPreferenceControllerTest {
|
||||
assertThat(preferenceGroup.getPreferenceCount()).isEqualTo(1);
|
||||
|
||||
final Preference preference = preferenceGroup.getPreference(0);
|
||||
assertThat(preference.getTitle()).isEqualTo("Battery is in good shape");
|
||||
assertThat(preference.getSummary()).isEqualTo("Apps are running normally");
|
||||
assertThat(preference.getTitle()).isEqualTo(
|
||||
mContext.getString(R.string.battery_tip_summary_title));
|
||||
assertThat(preference.getSummary()).isEqualTo(
|
||||
mContext.getString(R.string.battery_tip_summary_summary));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user