NAS Setting Migration

Change NAS setting to a toggle setting and move the settings to
Notifications/General

Bug: 173106358
Test: tested manually on device, make RunSettingsRoboTests
Change-Id: I1ba1214511dceea6faf5fb39692d920e761b33d8
This commit is contained in:
Chloris Kuo
2021-03-19 07:00:45 -07:00
parent 473fffa318
commit 2c955bbae2
11 changed files with 315 additions and 75 deletions

View File

@@ -19,7 +19,6 @@ import static android.app.NotificationManager.IMPORTANCE_NONE;
import static android.app.NotificationManager.IMPORTANCE_UNSPECIFIED;
import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_CACHED;
import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_DYNAMIC;
import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED;
import static android.content.pm.LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED_BY_ANY_LAUNCHER;
import android.app.INotificationManager;
@@ -50,7 +49,6 @@ import android.service.notification.NotificationListenerFilter;
import android.text.format.DateUtils;
import android.util.IconDrawableFactory;
import android.util.Log;
import android.util.Slog;
import androidx.annotation.VisibleForTesting;
@@ -563,6 +561,23 @@ public class NotificationBackend {
}
}
public ComponentName getDefaultNotificationAssistant() {
try {
return sINM.getDefaultNotificationAssistant();
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
return null;
}
}
public void resetDefaultNotificationAssistant(boolean loadFromConfig) {
try {
sINM.resetDefaultNotificationAssistant(loadFromConfig);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
}
}
public boolean setNotificationAssistantGranted(ComponentName cn) {
try {
sINM.setNotificationAssistantAccessGranted(cn, true);