Restrict SMS in multishare.

This commit is contained in:
Alex Hart
2021-01-23 17:39:35 -04:00
committed by Greyson Parrelli
parent 68381f8b64
commit b49e4004ab
4 changed files with 91 additions and 8 deletions

View File

@@ -63,6 +63,7 @@ public class ContactsCursorLoader extends CursorLoader {
public static final int FLAG_SELF = 1 << 4;
public static final int FLAG_BLOCK = 1 << 5;
public static final int FLAG_HIDE_GROUPS_V1 = 1 << 5;
public static final int FLAG_HIDE_NEW = 1 << 6;
public static final int FLAG_ALL = FLAG_PUSH | FLAG_SMS | FLAG_ACTIVE_GROUPS | FLAG_INACTIVE_GROUPS | FLAG_SELF;
}
@@ -135,8 +136,11 @@ public class ContactsCursorLoader extends CursorLoader {
addContactsSection(cursorList);
addGroupsSection(cursorList);
addNewNumberSection(cursorList);
addUsernameSearchSection(cursorList);
if (!hideNewNumberOrUsername(mode)) {
addNewNumberSection(cursorList);
addUsernameSearchSection(cursorList);
}
return cursorList;
}
@@ -429,6 +433,10 @@ public class ContactsCursorLoader extends CursorLoader {
return flagSet(mode, DisplayMode.FLAG_HIDE_GROUPS_V1);
}
private static boolean hideNewNumberOrUsername(int mode) {
return flagSet(mode, DisplayMode.FLAG_HIDE_NEW);
}
private static boolean flagSet(int mode, int flag) {
return (mode & flag) > 0;
}