Add app level settings for classification and summarization

Test: AdjustmentKeyPreferenceControllerTest
Flag: android.app.nm_summarization
Flag: android.app.notification_classification_ui
Flag: android.app.nm_summarization_ui
Bug: 377697346
Bug: 390412878
Change-Id: I85b67b5c0376ee4cd962e26bf178aae6fa712212
This commit is contained in:
Julia Reynolds
2025-02-03 10:52:53 -05:00
parent c32021846e
commit 55441003d3
6 changed files with 293 additions and 2 deletions

View File

@@ -54,6 +54,7 @@ import android.text.format.DateUtils;
import android.util.IconDrawableFactory;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
import com.android.internal.util.CollectionUtils;
@@ -436,7 +437,7 @@ public class NotificationBackend {
}
}
public List<String> getAssistantAdjustments(String pkg) {
public List<String> getAllowedAssistantAdjustments(String pkg) {
try {
return sINM.getAllowedAssistantAdjustments(pkg);
} catch (Exception e) {
@@ -769,6 +770,23 @@ public class NotificationBackend {
}
}
public @NonNull String[] getAdjustmentDeniedPackages(String key) {
try {
return sINM.getAdjustmentDeniedPackages(key);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
return new String[]{};
}
}
public @NonNull void setAdjustmentSupportedForPackage(String key, String pkg, boolean enabled) {
try {
sINM.setAdjustmentSupportedForPackage(key, pkg, enabled);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
}
}
@VisibleForTesting
void setNm(INotificationManager inm) {
sINM = inm;