Merge "Fix Content Capture service starting after restriction" into tm-qpr-dev
diff --git a/res/values-en-rAU/strings.xml b/res/values-en-rAU/strings.xml
index d8c5e17..de5c66b 100644
--- a/res/values-en-rAU/strings.xml
+++ b/res/values-en-rAU/strings.xml
@@ -735,28 +735,22 @@
<string name="fingerprint_unlock_set_unlock_password" msgid="5614333047430835971">"Fingerprint + Password"</string>
<string name="fingerprint_unlock_skip_fingerprint" msgid="7631242444064287891">"Continue without fingerprint"</string>
<string name="fingerprint_unlock_title" product="default" msgid="4978686534505944042">"You can unlock your phone using your fingerprint. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for fingerprint_unlock_title (8674718459462612186) -->
- <skip />
- <!-- no translation found for fingerprint_unlock_title (3224468142599659740) -->
- <skip />
+ <string name="fingerprint_unlock_title" product="tablet" msgid="8674718459462612186">"You can unlock your tablet using your fingerprint. For security, this option requires a backup screen lock."</string>
+ <string name="fingerprint_unlock_title" product="device" msgid="3224468142599659740">"You can unlock your device using your fingerprint. For security, this option requires a backup screen lock."</string>
<string name="face_unlock_set_unlock_pattern" msgid="3117316407679805330">"Face Unlock + pattern"</string>
<string name="face_unlock_set_unlock_pin" msgid="5300188327595503657">"Face Unlock + PIN"</string>
<string name="face_unlock_set_unlock_password" msgid="8395722611524617956">"Face Unlock + password"</string>
<string name="face_unlock_skip_face" msgid="189695556498300008">"Continue without Face Unlock"</string>
<string name="face_unlock_title" product="default" msgid="7344830351598247267">"You can unlock your phone using your face. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for face_unlock_title (5695698036499155727) -->
- <skip />
- <!-- no translation found for face_unlock_title (6768108756755361161) -->
- <skip />
+ <string name="face_unlock_title" product="tablet" msgid="5695698036499155727">"You can unlock your tablet using your face. For security, this option requires a backup screen lock."</string>
+ <string name="face_unlock_title" product="device" msgid="6768108756755361161">"You can unlock your device using your face. For security, this option requires a backup screen lock."</string>
<string name="biometrics_unlock_set_unlock_pattern" msgid="8084495264354847044">"Pattern • Face • Fingerprint"</string>
<string name="biometrics_unlock_set_unlock_pin" msgid="5912980580857825894">"PIN • Face • Fingerprint"</string>
<string name="biometrics_unlock_set_unlock_password" msgid="4612217647465743624">"Password • Face • Fingerprint"</string>
<string name="biometrics_unlock_skip_biometrics" msgid="7785643433551409223">"Continue without face or fingerprint"</string>
<string name="biometrics_unlock_title" product="default" msgid="616524056055233041">"You can unlock your phone using your face or fingerprint. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for biometrics_unlock_title (5808626401936488028) -->
- <skip />
- <!-- no translation found for biometrics_unlock_title (4912499343509046929) -->
- <skip />
+ <string name="biometrics_unlock_title" product="tablet" msgid="5808626401936488028">"You can unlock your tablet using your face or fingerprint. For security, this option requires a backup screen lock."</string>
+ <string name="biometrics_unlock_title" product="device" msgid="4912499343509046929">"You can unlock your device using your face or fingerprint. For security, this option requires a backup screen lock."</string>
<string name="unlock_set_unlock_disabled_summary" msgid="4022867760387966129">"Disabled by admin, encryption policy or credential storage"</string>
<string name="unlock_set_unlock_mode_off" msgid="4632139864722236359">"None"</string>
<string name="unlock_set_unlock_mode_none" msgid="5596049938457028214">"Swipe"</string>
diff --git a/res/values-en-rCA/strings.xml b/res/values-en-rCA/strings.xml
index 74d6cf9..f065c97 100644
--- a/res/values-en-rCA/strings.xml
+++ b/res/values-en-rCA/strings.xml
@@ -735,28 +735,22 @@
<string name="fingerprint_unlock_set_unlock_password" msgid="5614333047430835971">"Fingerprint + Password"</string>
<string name="fingerprint_unlock_skip_fingerprint" msgid="7631242444064287891">"Continue without fingerprint"</string>
<string name="fingerprint_unlock_title" product="default" msgid="4978686534505944042">"You can unlock your phone using your fingerprint. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for fingerprint_unlock_title (8674718459462612186) -->
- <skip />
- <!-- no translation found for fingerprint_unlock_title (3224468142599659740) -->
- <skip />
+ <string name="fingerprint_unlock_title" product="tablet" msgid="8674718459462612186">"You can unlock your tablet using your fingerprint. For security, this option requires a backup screen lock."</string>
+ <string name="fingerprint_unlock_title" product="device" msgid="3224468142599659740">"You can unlock your device using your fingerprint. For security, this option requires a backup screen lock."</string>
<string name="face_unlock_set_unlock_pattern" msgid="3117316407679805330">"Face Unlock + Pattern"</string>
<string name="face_unlock_set_unlock_pin" msgid="5300188327595503657">"Face Unlock + PIN"</string>
<string name="face_unlock_set_unlock_password" msgid="8395722611524617956">"Face Unlock + Password"</string>
<string name="face_unlock_skip_face" msgid="189695556498300008">"Continue without Face Unlock"</string>
<string name="face_unlock_title" product="default" msgid="7344830351598247267">"You can unlock your phone using your face. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for face_unlock_title (5695698036499155727) -->
- <skip />
- <!-- no translation found for face_unlock_title (6768108756755361161) -->
- <skip />
+ <string name="face_unlock_title" product="tablet" msgid="5695698036499155727">"You can unlock your tablet using your face. For security, this option requires a backup screen lock."</string>
+ <string name="face_unlock_title" product="device" msgid="6768108756755361161">"You can unlock your device using your face. For security, this option requires a backup screen lock."</string>
<string name="biometrics_unlock_set_unlock_pattern" msgid="8084495264354847044">"Pattern • Face • Fingerprint"</string>
<string name="biometrics_unlock_set_unlock_pin" msgid="5912980580857825894">"PIN • Face • Fingerprint"</string>
<string name="biometrics_unlock_set_unlock_password" msgid="4612217647465743624">"Password • Face • Fingerprint"</string>
<string name="biometrics_unlock_skip_biometrics" msgid="7785643433551409223">"Continue without face or fingerprint"</string>
<string name="biometrics_unlock_title" product="default" msgid="616524056055233041">"You can unlock your phone using your face or fingerprint. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for biometrics_unlock_title (5808626401936488028) -->
- <skip />
- <!-- no translation found for biometrics_unlock_title (4912499343509046929) -->
- <skip />
+ <string name="biometrics_unlock_title" product="tablet" msgid="5808626401936488028">"You can unlock your tablet using your face or fingerprint. For security, this option requires a backup screen lock."</string>
+ <string name="biometrics_unlock_title" product="device" msgid="4912499343509046929">"You can unlock your device using your face or fingerprint. For security, this option requires a backup screen lock."</string>
<string name="unlock_set_unlock_disabled_summary" msgid="4022867760387966129">"Disabled by admin, encryption policy, or credential storage"</string>
<string name="unlock_set_unlock_mode_off" msgid="4632139864722236359">"None"</string>
<string name="unlock_set_unlock_mode_none" msgid="5596049938457028214">"Swipe"</string>
diff --git a/res/values-en-rGB/strings.xml b/res/values-en-rGB/strings.xml
index 8df5bc6..f6dd53f 100644
--- a/res/values-en-rGB/strings.xml
+++ b/res/values-en-rGB/strings.xml
@@ -735,28 +735,22 @@
<string name="fingerprint_unlock_set_unlock_password" msgid="5614333047430835971">"Fingerprint + Password"</string>
<string name="fingerprint_unlock_skip_fingerprint" msgid="7631242444064287891">"Continue without fingerprint"</string>
<string name="fingerprint_unlock_title" product="default" msgid="4978686534505944042">"You can unlock your phone using your fingerprint. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for fingerprint_unlock_title (8674718459462612186) -->
- <skip />
- <!-- no translation found for fingerprint_unlock_title (3224468142599659740) -->
- <skip />
+ <string name="fingerprint_unlock_title" product="tablet" msgid="8674718459462612186">"You can unlock your tablet using your fingerprint. For security, this option requires a backup screen lock."</string>
+ <string name="fingerprint_unlock_title" product="device" msgid="3224468142599659740">"You can unlock your device using your fingerprint. For security, this option requires a backup screen lock."</string>
<string name="face_unlock_set_unlock_pattern" msgid="3117316407679805330">"Face Unlock + pattern"</string>
<string name="face_unlock_set_unlock_pin" msgid="5300188327595503657">"Face Unlock + PIN"</string>
<string name="face_unlock_set_unlock_password" msgid="8395722611524617956">"Face Unlock + password"</string>
<string name="face_unlock_skip_face" msgid="189695556498300008">"Continue without Face Unlock"</string>
<string name="face_unlock_title" product="default" msgid="7344830351598247267">"You can unlock your phone using your face. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for face_unlock_title (5695698036499155727) -->
- <skip />
- <!-- no translation found for face_unlock_title (6768108756755361161) -->
- <skip />
+ <string name="face_unlock_title" product="tablet" msgid="5695698036499155727">"You can unlock your tablet using your face. For security, this option requires a backup screen lock."</string>
+ <string name="face_unlock_title" product="device" msgid="6768108756755361161">"You can unlock your device using your face. For security, this option requires a backup screen lock."</string>
<string name="biometrics_unlock_set_unlock_pattern" msgid="8084495264354847044">"Pattern • Face • Fingerprint"</string>
<string name="biometrics_unlock_set_unlock_pin" msgid="5912980580857825894">"PIN • Face • Fingerprint"</string>
<string name="biometrics_unlock_set_unlock_password" msgid="4612217647465743624">"Password • Face • Fingerprint"</string>
<string name="biometrics_unlock_skip_biometrics" msgid="7785643433551409223">"Continue without face or fingerprint"</string>
<string name="biometrics_unlock_title" product="default" msgid="616524056055233041">"You can unlock your phone using your face or fingerprint. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for biometrics_unlock_title (5808626401936488028) -->
- <skip />
- <!-- no translation found for biometrics_unlock_title (4912499343509046929) -->
- <skip />
+ <string name="biometrics_unlock_title" product="tablet" msgid="5808626401936488028">"You can unlock your tablet using your face or fingerprint. For security, this option requires a backup screen lock."</string>
+ <string name="biometrics_unlock_title" product="device" msgid="4912499343509046929">"You can unlock your device using your face or fingerprint. For security, this option requires a backup screen lock."</string>
<string name="unlock_set_unlock_disabled_summary" msgid="4022867760387966129">"Disabled by admin, encryption policy or credential storage"</string>
<string name="unlock_set_unlock_mode_off" msgid="4632139864722236359">"None"</string>
<string name="unlock_set_unlock_mode_none" msgid="5596049938457028214">"Swipe"</string>
diff --git a/res/values-en-rIN/strings.xml b/res/values-en-rIN/strings.xml
index b78bfbe..88a727c 100644
--- a/res/values-en-rIN/strings.xml
+++ b/res/values-en-rIN/strings.xml
@@ -735,28 +735,22 @@
<string name="fingerprint_unlock_set_unlock_password" msgid="5614333047430835971">"Fingerprint + Password"</string>
<string name="fingerprint_unlock_skip_fingerprint" msgid="7631242444064287891">"Continue without fingerprint"</string>
<string name="fingerprint_unlock_title" product="default" msgid="4978686534505944042">"You can unlock your phone using your fingerprint. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for fingerprint_unlock_title (8674718459462612186) -->
- <skip />
- <!-- no translation found for fingerprint_unlock_title (3224468142599659740) -->
- <skip />
+ <string name="fingerprint_unlock_title" product="tablet" msgid="8674718459462612186">"You can unlock your tablet using your fingerprint. For security, this option requires a backup screen lock."</string>
+ <string name="fingerprint_unlock_title" product="device" msgid="3224468142599659740">"You can unlock your device using your fingerprint. For security, this option requires a backup screen lock."</string>
<string name="face_unlock_set_unlock_pattern" msgid="3117316407679805330">"Face Unlock + pattern"</string>
<string name="face_unlock_set_unlock_pin" msgid="5300188327595503657">"Face Unlock + PIN"</string>
<string name="face_unlock_set_unlock_password" msgid="8395722611524617956">"Face Unlock + password"</string>
<string name="face_unlock_skip_face" msgid="189695556498300008">"Continue without Face Unlock"</string>
<string name="face_unlock_title" product="default" msgid="7344830351598247267">"You can unlock your phone using your face. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for face_unlock_title (5695698036499155727) -->
- <skip />
- <!-- no translation found for face_unlock_title (6768108756755361161) -->
- <skip />
+ <string name="face_unlock_title" product="tablet" msgid="5695698036499155727">"You can unlock your tablet using your face. For security, this option requires a backup screen lock."</string>
+ <string name="face_unlock_title" product="device" msgid="6768108756755361161">"You can unlock your device using your face. For security, this option requires a backup screen lock."</string>
<string name="biometrics_unlock_set_unlock_pattern" msgid="8084495264354847044">"Pattern • Face • Fingerprint"</string>
<string name="biometrics_unlock_set_unlock_pin" msgid="5912980580857825894">"PIN • Face • Fingerprint"</string>
<string name="biometrics_unlock_set_unlock_password" msgid="4612217647465743624">"Password • Face • Fingerprint"</string>
<string name="biometrics_unlock_skip_biometrics" msgid="7785643433551409223">"Continue without face or fingerprint"</string>
<string name="biometrics_unlock_title" product="default" msgid="616524056055233041">"You can unlock your phone using your face or fingerprint. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for biometrics_unlock_title (5808626401936488028) -->
- <skip />
- <!-- no translation found for biometrics_unlock_title (4912499343509046929) -->
- <skip />
+ <string name="biometrics_unlock_title" product="tablet" msgid="5808626401936488028">"You can unlock your tablet using your face or fingerprint. For security, this option requires a backup screen lock."</string>
+ <string name="biometrics_unlock_title" product="device" msgid="4912499343509046929">"You can unlock your device using your face or fingerprint. For security, this option requires a backup screen lock."</string>
<string name="unlock_set_unlock_disabled_summary" msgid="4022867760387966129">"Disabled by admin, encryption policy or credential storage"</string>
<string name="unlock_set_unlock_mode_off" msgid="4632139864722236359">"None"</string>
<string name="unlock_set_unlock_mode_none" msgid="5596049938457028214">"Swipe"</string>
diff --git a/res/values-en-rXC/strings.xml b/res/values-en-rXC/strings.xml
index d1d15bc..6915c9b 100644
--- a/res/values-en-rXC/strings.xml
+++ b/res/values-en-rXC/strings.xml
@@ -735,28 +735,22 @@
<string name="fingerprint_unlock_set_unlock_password" msgid="5614333047430835971">"Fingerprint + Password"</string>
<string name="fingerprint_unlock_skip_fingerprint" msgid="7631242444064287891">"Continue without fingerprint"</string>
<string name="fingerprint_unlock_title" product="default" msgid="4978686534505944042">"You can unlock your phone using your fingerprint. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for fingerprint_unlock_title (8674718459462612186) -->
- <skip />
- <!-- no translation found for fingerprint_unlock_title (3224468142599659740) -->
- <skip />
+ <string name="fingerprint_unlock_title" product="tablet" msgid="8674718459462612186">"You can unlock your tablet using your fingerprint. For security, this option requires a backup screen lock."</string>
+ <string name="fingerprint_unlock_title" product="device" msgid="3224468142599659740">"You can unlock your device using your fingerprint. For security, this option requires a backup screen lock."</string>
<string name="face_unlock_set_unlock_pattern" msgid="3117316407679805330">"Face Unlock + Pattern"</string>
<string name="face_unlock_set_unlock_pin" msgid="5300188327595503657">"Face Unlock + PIN"</string>
<string name="face_unlock_set_unlock_password" msgid="8395722611524617956">"Face Unlock + Password"</string>
<string name="face_unlock_skip_face" msgid="189695556498300008">"Continue without Face Unlock"</string>
<string name="face_unlock_title" product="default" msgid="7344830351598247267">"You can unlock your phone using your face. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for face_unlock_title (5695698036499155727) -->
- <skip />
- <!-- no translation found for face_unlock_title (6768108756755361161) -->
- <skip />
+ <string name="face_unlock_title" product="tablet" msgid="5695698036499155727">"You can unlock your tablet using your face. For security, this option requires a backup screen lock."</string>
+ <string name="face_unlock_title" product="device" msgid="6768108756755361161">"You can unlock your device using your face. For security, this option requires a backup screen lock."</string>
<string name="biometrics_unlock_set_unlock_pattern" msgid="8084495264354847044">"Pattern • Face • Fingerprint"</string>
<string name="biometrics_unlock_set_unlock_pin" msgid="5912980580857825894">"PIN • Face • Fingerprint"</string>
<string name="biometrics_unlock_set_unlock_password" msgid="4612217647465743624">"Password • Face • Fingerprint"</string>
<string name="biometrics_unlock_skip_biometrics" msgid="7785643433551409223">"Continue without face or fingerprint"</string>
<string name="biometrics_unlock_title" product="default" msgid="616524056055233041">"You can unlock your phone using your face or fingerprint. For security, this option requires a backup screen lock."</string>
- <!-- no translation found for biometrics_unlock_title (5808626401936488028) -->
- <skip />
- <!-- no translation found for biometrics_unlock_title (4912499343509046929) -->
- <skip />
+ <string name="biometrics_unlock_title" product="tablet" msgid="5808626401936488028">"You can unlock your tablet using your face or fingerprint. For security, this option requires a backup screen lock."</string>
+ <string name="biometrics_unlock_title" product="device" msgid="4912499343509046929">"You can unlock your device using your face or fingerprint. For security, this option requires a backup screen lock."</string>
<string name="unlock_set_unlock_disabled_summary" msgid="4022867760387966129">"Disabled by admin, encryption policy, or credential storage"</string>
<string name="unlock_set_unlock_mode_off" msgid="4632139864722236359">"None"</string>
<string name="unlock_set_unlock_mode_none" msgid="5596049938457028214">"Swipe"</string>
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 28b35b3..4839b68 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -9923,7 +9923,7 @@
<string name="loading_notification_apps">Loading apps\u2026</string>
<!-- [CHAR LIMIT=NONE] Text appearing when app notifications are off -->
- <string name="app_notifications_off_desc">At your request, Android is blocking this app\'s notifications from appearing on this device</string>
+ <string name="app_notifications_off_desc">You haven\'t allowed notifications from this app</string>
<!-- [CHAR LIMIT=NONE] Text appearing when channel notifications are off -->
<string name="channel_notifications_off_desc">At your request, Android is blocking this category of notifications from appearing on this device</string>
diff --git a/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java b/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java
index f1e7ac0..d96aa6b 100644
--- a/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java
+++ b/src/com/android/settings/applications/defaultapps/DefaultAutofillPicker.java
@@ -243,7 +243,7 @@
}
final CharSequence appName = appInfo.loadLabel();
final String message = getContext().getString(
- R.string.autofill_confirmation_message, appName);
+ R.string.autofill_confirmation_message, Html.escapeHtml(appName));
return Html.fromHtml(message);
}
diff --git a/src/com/android/settings/communal/CommunalPreferenceController.java b/src/com/android/settings/communal/CommunalPreferenceController.java
index e16dcc3..5cfedc4 100644
--- a/src/com/android/settings/communal/CommunalPreferenceController.java
+++ b/src/com/android/settings/communal/CommunalPreferenceController.java
@@ -17,6 +17,7 @@
package com.android.settings.communal;
import android.content.Context;
+import android.os.UserManager;
import com.android.settings.R;
import com.android.settings.core.BasePreferenceController;
@@ -31,7 +32,14 @@
@Override
public int getAvailabilityStatus() {
- return mContext.getResources().getBoolean(R.bool.config_show_communal_settings)
+ // TODO(b/257333623): Allow the communal user to be non-SystemUser user in HSUM.
+ return (mContext.getResources().getBoolean(R.bool.config_show_communal_settings)
+ && isSystemUser())
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
}
+
+ private boolean isSystemUser() {
+ final UserManager userManager = mContext.getSystemService(UserManager.class);
+ return userManager != null && userManager.isSystemUser();
+ }
}
diff --git a/tests/unit/src/com/android/settings/communal/CommunalPreferenceControllerTest.java b/tests/unit/src/com/android/settings/communal/CommunalPreferenceControllerTest.java
new file mode 100644
index 0000000..e8421d0
--- /dev/null
+++ b/tests/unit/src/com/android/settings/communal/CommunalPreferenceControllerTest.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.android.settings.communal;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.os.UserManager;
+
+import androidx.test.core.app.ApplicationProvider;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+
+import com.android.settings.testutils.ResourcesUtils;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+
+@RunWith(AndroidJUnit4.class)
+public class CommunalPreferenceControllerTest {
+ @Mock
+ private UserManager mUserManager;
+
+ private Resources mResources;
+ private CommunalPreferenceController mController;
+
+ private static final String PREF_KEY = "test_key";
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ final Context context = spy(ApplicationProvider.getApplicationContext());
+ mResources = spy(context.getResources());
+
+ mController = new CommunalPreferenceController(context, PREF_KEY);
+
+ when(context.getResources()).thenReturn(mResources);
+ when(context.getSystemService(UserManager.class)).thenReturn(mUserManager);
+ }
+
+ @Test
+ public void isAvailable_communalEnabled_shouldBeTrueForSystemUser() {
+ setCommunalEnabled(true);
+ when(mUserManager.isSystemUser()).thenReturn(true);
+ assertTrue(mController.isAvailable());
+ }
+
+ @Test
+ public void isAvailable_communalEnabled_shouldBeFalseForNonSystemUser() {
+ setCommunalEnabled(true);
+ when(mUserManager.isSystemUser()).thenReturn(false);
+ assertFalse(mController.isAvailable());
+ }
+
+ @Test
+ public void isAvailable_communalDisabled_shouldBeFalseForSystemUser() {
+ setCommunalEnabled(false);
+ when(mUserManager.isSystemUser()).thenReturn(true);
+ assertFalse(mController.isAvailable());
+ }
+
+ private void setCommunalEnabled(boolean enabled) {
+ final int boolId = ResourcesUtils.getResourcesId(
+ ApplicationProvider.getApplicationContext(), "bool",
+ "config_show_communal_settings");
+ when(mResources.getBoolean(boolId)).thenReturn(enabled);
+ }
+}