Finalize strings for enterprise privacy
A few more final string tweaks for the enterprise privacy page.
Bug: 32692748
Test: m RunSettingsRoboTests
Change-Id: Icf91a1188febb303fb1a9e9a5259a06c3b2324da
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2520722..4a85b8f 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -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] -->
diff --git a/res/xml/enterprise_privacy_settings.xml b/res/xml/enterprise_privacy_settings.xml
index 68403c5..1a08cda 100644
--- a/res/xml/enterprise_privacy_settings.xml
+++ b/res/xml/enterprise_privacy_settings.xml
@@ -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>
diff --git a/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceController.java b/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceController.java
index c8ea551..1895e09 100644
--- a/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceController.java
+++ b/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceController.java
@@ -40,9 +40,9 @@
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);
diff --git a/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceController.java b/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceController.java
index 33224ae..cc0d4f6 100644
--- a/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceController.java
+++ b/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceController.java
@@ -40,8 +40,6 @@
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);
diff --git a/tests/robotests/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceControllerTest.java
index 3cd63bb..c8ffa7e 100644
--- a/tests/robotests/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/CaCertsCurrentUserPreferenceControllerTest.java
@@ -43,10 +43,8 @@
@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 @@
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 @@
.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 @@
.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 @@
.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 @@
.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);
}
diff --git a/tests/robotests/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceControllerTest.java b/tests/robotests/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceControllerTest.java
index c66128b..693cfae 100644
--- a/tests/robotests/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/CaCertsManagedProfilePreferenceControllerTest.java
@@ -43,8 +43,6 @@
@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 @@
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 @@
.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 @@
.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);
}