Conversation Blocklist

Add KEY_NOT_CONVERSATION into default allowed adjustments list and add
DeviceConfig to enable it

Bug: 173106605, 178151392
Test: tested on device
Change-Id: I9a34fc3aadadde785bfce2bdf2ff35b0cc0b0ec6
This commit is contained in:
Chloris Kuo
2021-01-26 15:31:13 -08:00
parent 92958994a7
commit 6fe1741d37
2 changed files with 14 additions and 1 deletions

View File

@@ -62,6 +62,11 @@ public final class SystemUiDeviceConfigFlags {
*/
public static final String ENABLE_NAS_FEEDBACK = "enable_nas_feedback";
/**
* Whether the Notification Assistant can label a notification not a conversation
*/
public static final String ENABLE_NAS_NOT_CONVERSATION = "enable_nas_not_conversation";
// Flags related to screenshot intelligence
/**

View File

@@ -377,7 +377,8 @@ public class NotificationManagerService extends SystemService {
static final String[] DEFAULT_ALLOWED_ADJUSTMENTS = new String[] {
Adjustment.KEY_CONTEXTUAL_ACTIONS,
Adjustment.KEY_TEXT_REPLIES};
Adjustment.KEY_TEXT_REPLIES,
Adjustment.KEY_NOT_CONVERSATION};
static final String[] NON_BLOCKABLE_DEFAULT_ROLES = new String[] {
RoleManager.ROLE_DIALER,
@@ -2313,6 +2314,13 @@ public class NotificationManagerService extends SystemService {
} else if ("false".equals(value)) {
mAssistants.disallowAdjustmentType(Adjustment.KEY_RANKING_SCORE);
}
} else if (SystemUiDeviceConfigFlags.ENABLE_NAS_NOT_CONVERSATION.equals(name)) {
String value = properties.getString(name, null);
if ("true".equals(value)) {
mAssistants.allowAdjustmentType(Adjustment.KEY_NOT_CONVERSATION);
} else if ("false".equals(value)) {
mAssistants.disallowAdjustmentType(Adjustment.KEY_NOT_CONVERSATION);
}
}
}
};