Use | not ,
To match similar APIs Test: Settings unit Bug: 181175697 Change-Id: I2ef56528da7a3d5b2c96be8ecfad1a3d6590bbe4
This commit is contained in:
@@ -40,7 +40,7 @@ public abstract class TypeFilterPreferenceController extends BasePreferenceContr
|
|||||||
PreferenceControllerMixin, Preference.OnPreferenceChangeListener {
|
PreferenceControllerMixin, Preference.OnPreferenceChangeListener {
|
||||||
|
|
||||||
private static final String TAG = "TypeFilterPrefCntlr";
|
private static final String TAG = "TypeFilterPrefCntlr";
|
||||||
private static final String XML_SEPARATOR = ",";
|
private static final String FLAG_SEPARATOR = "\\|";
|
||||||
|
|
||||||
private ComponentName mCn;
|
private ComponentName mCn;
|
||||||
private int mUserId;
|
private int mUserId;
|
||||||
@@ -132,7 +132,7 @@ public abstract class TypeFilterPreferenceController extends BasePreferenceContr
|
|||||||
NotificationListenerService.META_DATA_DISABLED_FILTER_TYPES).toString();
|
NotificationListenerService.META_DATA_DISABLED_FILTER_TYPES).toString();
|
||||||
if (typeList != null) {
|
if (typeList != null) {
|
||||||
int types = 0;
|
int types = 0;
|
||||||
String[] typeStrings = typeList.split(XML_SEPARATOR);
|
String[] typeStrings = typeList.split(FLAG_SEPARATOR);
|
||||||
for (int i = 0; i < typeStrings.length; i++) {
|
for (int i = 0; i < typeStrings.length; i++) {
|
||||||
final String typeString = typeStrings[i];
|
final String typeString = typeStrings[i];
|
||||||
if (TextUtils.isEmpty(typeString)) {
|
if (TextUtils.isEmpty(typeString)) {
|
||||||
|
@@ -152,7 +152,7 @@ public class TypeFilterPreferenceControllerTest {
|
|||||||
public void updateState_enabled_metaData_disableFilter_notThisField() {
|
public void updateState_enabled_metaData_disableFilter_notThisField() {
|
||||||
mSi.metaData = new Bundle();
|
mSi.metaData = new Bundle();
|
||||||
mSi.metaData.putCharSequence(NotificationListenerService.META_DATA_DISABLED_FILTER_TYPES,
|
mSi.metaData.putCharSequence(NotificationListenerService.META_DATA_DISABLED_FILTER_TYPES,
|
||||||
"1,alerting");
|
"1|alerting");
|
||||||
when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true);
|
when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true);
|
||||||
when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter());
|
when(mNm.getListenerFilter(mCn, 0)).thenReturn(new NotificationListenerFilter());
|
||||||
CheckBoxPreference pref = new CheckBoxPreference(mContext);
|
CheckBoxPreference pref = new CheckBoxPreference(mContext);
|
||||||
@@ -165,7 +165,7 @@ public class TypeFilterPreferenceControllerTest {
|
|||||||
public void updateState_enabled_metaData_disableFilter_thisField_stateIsChecked() {
|
public void updateState_enabled_metaData_disableFilter_thisField_stateIsChecked() {
|
||||||
mSi.metaData = new Bundle();
|
mSi.metaData = new Bundle();
|
||||||
mSi.metaData.putCharSequence(NotificationListenerService.META_DATA_DISABLED_FILTER_TYPES,
|
mSi.metaData.putCharSequence(NotificationListenerService.META_DATA_DISABLED_FILTER_TYPES,
|
||||||
"conversations,2,32");
|
"conversations|2|32");
|
||||||
when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true);
|
when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true);
|
||||||
when(mNm.getListenerFilter(mCn, 0)).thenReturn(
|
when(mNm.getListenerFilter(mCn, 0)).thenReturn(
|
||||||
new NotificationListenerFilter(32, new ArraySet<>()));
|
new NotificationListenerFilter(32, new ArraySet<>()));
|
||||||
@@ -189,7 +189,7 @@ public class TypeFilterPreferenceControllerTest {
|
|||||||
public void updateState_disabled_metaData_disableFilter_thisField_stateIsNotChecked() {
|
public void updateState_disabled_metaData_disableFilter_thisField_stateIsNotChecked() {
|
||||||
mSi.metaData = new Bundle();
|
mSi.metaData = new Bundle();
|
||||||
mSi.metaData.putCharSequence(NotificationListenerService.META_DATA_DISABLED_FILTER_TYPES,
|
mSi.metaData.putCharSequence(NotificationListenerService.META_DATA_DISABLED_FILTER_TYPES,
|
||||||
"1,2,32");
|
"1|2|32");
|
||||||
when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true);
|
when(mNm.isNotificationListenerAccessGranted(mCn)).thenReturn(true);
|
||||||
NotificationListenerFilter before = new NotificationListenerFilter(4, new ArraySet<>());
|
NotificationListenerFilter before = new NotificationListenerFilter(4, new ArraySet<>());
|
||||||
when(mNm.getListenerFilter(mCn, 0)).thenReturn(before);
|
when(mNm.getListenerFilter(mCn, 0)).thenReturn(before);
|
||||||
|
Reference in New Issue
Block a user