Add initial settings for summarization

Test: SummarizationGlobalPreferenceControllerTest
Test: SummarizationPreferenceControllerTest
Flag: android.app.nm_summarization
Bug: 390415383
Change-Id: I773d69c707ae5f902860196fb44821ede15261f5
This commit is contained in:
Julia Reynolds
2025-01-23 16:55:12 -05:00
parent 271fb3ea63
commit 50e720b03b
9 changed files with 446 additions and 4 deletions

View File

@@ -687,6 +687,37 @@ public class NotificationBackend {
}
}
public boolean isNotificationSummarizationSupported() {
try {
return !sINM.getUnsupportedAdjustmentTypes().contains(Adjustment.KEY_SUMMARIZATION);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
}
return false;
}
public boolean isNotificationSummarizationEnabled(Context context) {
try {
return sINM.getAllowedAssistantAdjustments(context.getPackageName())
.contains(Adjustment.KEY_SUMMARIZATION);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
}
return false;
}
public void setNotificationSummarizationEnabled(boolean enabled) {
try {
if (enabled) {
sINM.allowAssistantAdjustment(Adjustment.KEY_SUMMARIZATION);
} else {
sINM.disallowAssistantAdjustment(Adjustment.KEY_SUMMARIZATION);
}
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
}
}
public boolean isBundleTypeApproved(@Adjustment.Types int type) {
try {
int[] approved = sINM.getAllowedAdjustmentKeyTypes();