Home Controls: Add conditional copy for setting.

Add conditional copy for when allow trivial devices setting is disabled.
Add guidance on how to enable it.

Bug: 227344249
Test: Manual and unit test
Change-Id: I0f2f6dc933804ee6ba15dc180dc717d2a5b729a5
This commit is contained in:
Aaron Liu
2022-03-29 17:27:17 +00:00
parent 5fd1f8fe4e
commit c138118d48
3 changed files with 6 additions and 1 deletions

View File

@@ -13461,6 +13461,8 @@
<string name="lockscreen_trivial_controls_setting_toggle">Control from locked device</string>
<!-- Trivial Device controls summary [CHAR LIMIT=NONE] -->
<string name="lockscreen_trivial_controls_summary">Control external devices without unlocking your phone or tablet if allowed by the device controls app</string>
<!-- Trivial Device disabled controls summary [CHAR LIMIT=NONE] -->
<string name="lockscreen_trivial_disabled_controls_summary">To use, first turn on \u0022Show device controls\u0022</string>
<!-- Lockscreen double-line clock summary [CHAR LIMIT=NONE] -->
<string name="lockscreen_double_line_clock_summary">Show double-line clock when available</string>
<!-- Lockscreen double-line clock toggle [CHAR LIMIT=60] -->

View File

@@ -50,6 +50,9 @@ public class ControlsTrivialPrivacyPreferenceController extends TogglePreference
@Override
public CharSequence getSummary() {
if (getAvailabilityStatus() == DISABLED_DEPENDENT_SETTING) {
return mContext.getText(R.string.lockscreen_trivial_disabled_controls_summary);
}
return mContext.getText(R.string.lockscreen_trivial_controls_summary);
}

View File

@@ -109,7 +109,7 @@ public class ControlsTrivialPrivacyPreferenceControllerTest {
Settings.Secure.putInt(mContentResolver, DEPENDENCY_SETTING_KEY, 0);
assertThat(mController.getSummary().toString()).isEqualTo(
mContext.getText(R.string.lockscreen_trivial_controls_summary));
mContext.getText(R.string.lockscreen_trivial_disabled_controls_summary));
}
@Test