Handle NLS metadata when provided as strings

Test: atest
Bug: 181175697
Change-Id: I40d935ffb7c1fb9f978160d28297da84412501fb
This commit is contained in:
Julia Reynolds
2021-05-07 14:30:59 -04:00
parent bf5dd80d4f
commit 2fe3273f3a
2 changed files with 23 additions and 7 deletions

View File

@@ -152,7 +152,7 @@ public class TypeFilterPreferenceControllerTest {
public void updateState_enabled_metaData_disableFilter_notThisField() {
mSi.metaData = new Bundle();
mSi.metaData.putCharSequence(NotificationListenerService.META_DATA_DISABLED_FILTER_TYPES,
"1,2");
"1,alerting");
when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true);
when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter());
CheckBoxPreference pref = new CheckBoxPreference(mContext);
@@ -165,7 +165,7 @@ public class TypeFilterPreferenceControllerTest {
public void updateState_enabled_metaData_disableFilter_thisField_stateIsChecked() {
mSi.metaData = new Bundle();
mSi.metaData.putCharSequence(NotificationListenerService.META_DATA_DISABLED_FILTER_TYPES,
"1,2,32");
"conversations,2,32");
when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true);
when(mNm.getListenerFilter(mCn, 0)).thenReturn(
new NotificationListenerFilter(32, new ArraySet<>()));