Finalize strings for enterprise privacy

A few more final string tweaks for the enterprise privacy page.

Bug: 32692748
Test: m RunSettingsRoboTests

Change-Id: Icf91a1188febb303fb1a9e9a5259a06c3b2324da
This commit is contained in:
Bartosz Fabianowski
2017-03-21 11:19:38 +01:00
parent 7896f10920
commit e39e8350a1
6 changed files with 25 additions and 51 deletions

View File

@@ -8227,13 +8227,13 @@
<!-- Label indicating that the admin installed one or more apps on the device. -->
<string name="enterprise_privacy_enterprise_installed_packages">Apps installed</string>
<!-- Label indicating that the admin granted one or more apps access to the device's location. [CHAR LIMIT=NONE] -->
<string name="enterprise_privacy_location_access">Apps allowed to access your location</string>
<string name="enterprise_privacy_location_access">Location permissions</string>
<!-- Label indicating that the admin granted one or more apps access to the microphone. [CHAR LIMIT=NONE] -->
<string name="enterprise_privacy_microphone_access">Apps allowed to access your microphone</string>
<string name="enterprise_privacy_microphone_access">Microphone permissions</string>
<!-- Label indicating that the admin granted one or more apps access to the camera. [CHAR LIMIT=NONE] -->
<string name="enterprise_privacy_camera_access">Apps allowed to access your camera</string>
<string name="enterprise_privacy_camera_access">Camera permissions</string>
<!-- Label indicating that the admin set one or more apps as defaults for common actions (e.g. open browser, send e-mail). [CHAR LIMIT=NONE] -->
<string name="enterprise_privacy_enterprise_set_default_apps">Default apps set</string>
<string name="enterprise_privacy_enterprise_set_default_apps">Default apps</string>
<!-- Label explaining that the current input method was set by the admin. [CHAR LIMIT=NONE] -->
<string name="enterprise_privacy_input_method">Default keyboard</string>
<!-- Summary indicating the input method set by the admin. [CHAR LIMIT=NONE] -->
@@ -8247,30 +8247,21 @@
<!-- Label explaining that a global HTTP proxy was set by the admin. [CHAR LIMIT=NONE] -->
<string name="enterprise_privacy_global_http_proxy">Global HTTP proxy set</string>
<!-- Label explaining that the admin installed trusted CA certificates for the current user. [CHAR LIMIT=NONE] -->
<plurals name="enterprise_privacy_ca_certs_user">
<item quantity="one">Trusted CA certificate installed</item>
<item quantity="other">Trusted CA certificates installed</item>
</plurals>
<string name="enterprise_privacy_ca_certs_user">Trusted credentials</string>
<!-- Label explaining that the admin installed trusted CA certificates for the personal profile. [CHAR LIMIT=NONE] -->
<plurals name="enterprise_privacy_ca_certs_personal">
<item quantity="one">Trusted CA certificate installed in your personal profile</item>
<item quantity="other">Trusted CA certificates installed in your personal profile</item>
</plurals>
<string name="enterprise_privacy_ca_certs_personal">Trusted credentials in your personal profile</string>
<!-- Summary indicating the number of trusted CA certificates installed by the admin. [CHAR LIMIT=NONE] -->
<plurals name="enterprise_privacy_number_ca_certs">
<item quantity="one"><xliff:g id="count">%d</xliff:g> certificate</item>
<item quantity="other"><xliff:g id="count">%d</xliff:g> certificates</item>
<item quantity="one"><xliff:g id="count">%d</xliff:g> CA certificate</item>
<item quantity="other"><xliff:g id="count">%d</xliff:g> CA certificates</item>
</plurals>
<!-- Summary indicating the number of trusted CA certificates installed by the admin. [CHAR LIMIT=NONE] -->
<plurals name="enterprise_privacy_number_ca_certs_actionable">
<item quantity="one"><xliff:g id="count">%d</xliff:g> certificate. Tap to view.</item>
<item quantity="other"><xliff:g id="count">%d</xliff:g> certificates. Tap to view.</item>
<item quantity="one"><xliff:g id="count">%d</xliff:g> CA certificate. Tap to view.</item>
<item quantity="other"><xliff:g id="count">%d</xliff:g> CA certificates. Tap to view.</item>
</plurals>
<!-- Label explaining that the admin installed trusted CA certificates for the work profile. [CHAR LIMIT=NONE] -->
<plurals name="enterprise_privacy_ca_certs_work">
<item quantity="one">Trusted CA Certificate installed in your work profile</item>
<item quantity="other">Trusted CA Certificates installed in your work profile</item>
</plurals>
<string name="enterprise_privacy_ca_certs_work">Trusted credentials in your work profile</string>
<!-- Label explaining that the admin can lock the device and change the user's password. [CHAR LIMIT=NONE] -->
<string name="enterprise_privacy_lock_device">Admin can lock the device and reset password</string>
<!-- Label explaining that the admin can wipe the device remotely. [CHAR LIMIT=NONE] -->

View File

@@ -94,6 +94,7 @@
settings:multiLine="true"/>
<com.android.settings.DividerPreference
android:key="ca_certs_managed_profile"
android:title="@string/enterprise_privacy_ca_certs_work"
settings:multiLine="true"/>
</PreferenceCategory>

View File

@@ -40,9 +40,9 @@ public class CaCertsCurrentUserPreferenceController extends PreferenceController
preference.setVisible(false);
return;
}
preference.setTitle(mContext.getResources().getQuantityString(
mFeatureProvider.isInCompMode() ? R.plurals.enterprise_privacy_ca_certs_personal :
R.plurals.enterprise_privacy_ca_certs_user, certs));
preference.setTitle(mFeatureProvider.isInCompMode()
? R.string.enterprise_privacy_ca_certs_personal
: R.string.enterprise_privacy_ca_certs_user);
preference.setSummary(mContext.getResources().getQuantityString(
R.plurals.enterprise_privacy_number_ca_certs, certs, certs));
preference.setVisible(true);

View File

@@ -40,8 +40,6 @@ public class CaCertsManagedProfilePreferenceController extends PreferenceControl
preference.setVisible(false);
return;
}
preference.setTitle(mContext.getResources().getQuantityString(
R.plurals.enterprise_privacy_ca_certs_work, certs));
preference.setSummary(mContext.getResources().getQuantityString(
R.plurals.enterprise_privacy_number_ca_certs, certs, certs));
preference.setVisible(true);

View File

@@ -43,10 +43,8 @@ import static org.mockito.Mockito.when;
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
public final class CaCertsCurrentUserPreferenceControllerTest {
private final String INSTALLED_CERTS_USER_1 = "cert installed";
private final String INSTALLED_CERTS_USER_10 = "certs installed";
private final String INSTALLED_CERTS_PERSONAL_1 = "cert installed in personal profile";
private final String INSTALLED_CERTS_PERSONAL_10 = "certs installed in personal profile";
private final String INSTALLED_CERTS_USER = "trusted credentials";
private final String INSTALLED_CERTS_PERSONAL = "trusted credentials in personal profile";
private final String NUMBER_INSTALLED_CERTS_1 = "1 cert";
private final String NUMBER_INSTALLED_CERTS_10 = "10 certs";
@@ -63,16 +61,10 @@ public final class CaCertsCurrentUserPreferenceControllerTest {
mFeatureFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
mController = new CaCertsCurrentUserPreferenceController(mContext);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_ca_certs_user,
1)).thenReturn(INSTALLED_CERTS_USER_1);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_ca_certs_user,
10)).thenReturn(INSTALLED_CERTS_USER_10);
when(mContext.getResources().getQuantityString(
R.plurals.enterprise_privacy_ca_certs_personal, 1))
.thenReturn(INSTALLED_CERTS_PERSONAL_1);
when(mContext.getResources().getQuantityString(
R.plurals.enterprise_privacy_ca_certs_personal, 10))
.thenReturn(INSTALLED_CERTS_PERSONAL_10);
when(mContext.getString(R.string.enterprise_privacy_ca_certs_user))
.thenReturn(INSTALLED_CERTS_USER);
when(mContext.getString(R.string.enterprise_privacy_ca_certs_personal))
.thenReturn(INSTALLED_CERTS_PERSONAL);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_number_ca_certs,
1, 1)).thenReturn(NUMBER_INSTALLED_CERTS_1);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_number_ca_certs,
@@ -95,7 +87,7 @@ public final class CaCertsCurrentUserPreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInCurrentUser()).thenReturn(1);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_USER_1);
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_USER);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_1);
preference.setVisible(false);
@@ -103,7 +95,7 @@ public final class CaCertsCurrentUserPreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInCurrentUser()).thenReturn(10);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_USER_10);
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_USER);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_10);
when(mFeatureFactory.enterprisePrivacyFeatureProvider.isInCompMode()).thenReturn(true);
@@ -117,7 +109,7 @@ public final class CaCertsCurrentUserPreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInCurrentUser()).thenReturn(1);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_PERSONAL_1);
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_PERSONAL);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_1);
preference.setVisible(false);
@@ -125,7 +117,7 @@ public final class CaCertsCurrentUserPreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInCurrentUser()).thenReturn(10);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_PERSONAL_10);
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_PERSONAL);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_10);
}

View File

@@ -43,8 +43,6 @@ import static org.mockito.Mockito.when;
@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
public final class CaCertsManagedProfilePreferenceControllerTest {
private final String INSTALLED_CERTS_1 = "cert installed";
private final String INSTALLED_CERTS_10 = "certs installed";
private final String NUMBER_INSTALLED_CERTS_1 = "1 cert";
private final String NUMBER_INSTALLED_CERTS_10 = "10 certs";
@@ -61,10 +59,6 @@ public final class CaCertsManagedProfilePreferenceControllerTest {
mFeatureFactory = (FakeFeatureFactory) FakeFeatureFactory.getFactory(mContext);
mController = new CaCertsManagedProfilePreferenceController(mContext);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_ca_certs_work,
1)).thenReturn(INSTALLED_CERTS_1);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_ca_certs_work,
10)).thenReturn(INSTALLED_CERTS_10);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_number_ca_certs,
1, 1)).thenReturn(NUMBER_INSTALLED_CERTS_1);
when(mContext.getResources().getQuantityString(R.plurals.enterprise_privacy_number_ca_certs,
@@ -85,7 +79,6 @@ public final class CaCertsManagedProfilePreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInManagedProfile()).thenReturn(1);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_1);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_1);
preference.setVisible(false);
@@ -93,7 +86,6 @@ public final class CaCertsManagedProfilePreferenceControllerTest {
.getNumberOfOwnerInstalledCaCertsInManagedProfile()).thenReturn(10);
mController.updateState(preference);
assertThat(preference.isVisible()).isTrue();
assertThat(preference.getTitle()).isEqualTo(INSTALLED_CERTS_10);
assertThat(preference.getSummary()).isEqualTo(NUMBER_INSTALLED_CERTS_10);
}