Merge "NAS setting migration" into sc-dev

This commit is contained in:
Chloris Kuo
2021-04-22 00:23:25 +00:00
committed by Android (Google) Code Review
3 changed files with 9 additions and 13 deletions

View File

@@ -77,11 +77,7 @@ public class NotificationAssistantPreferenceController extends TogglePreferenceC
protected void setNotificationAssistantGranted(ComponentName cn) {
if (Settings.Secure.getIntForUser(mContext.getContentResolver(),
Settings.Secure.NAS_SETTINGS_UPDATED, 0, mUserId) == 0) {
for (int profileId : mUserManager.getProfileIds(mUserId, false)) {
Settings.Secure.putIntForUser(mContext.getContentResolver(),
Settings.Secure.NAS_SETTINGS_UPDATED, 1, profileId);
}
mNotificationBackend.resetDefaultNotificationAssistant(cn != null);
mNotificationBackend.setNASMigrationDoneAndResetDefault(mUserId, cn != null);
}
mNotificationBackend.setNotificationAssistantGranted(cn);
}

View File

@@ -570,9 +570,9 @@ public class NotificationBackend {
}
}
public void resetDefaultNotificationAssistant(boolean loadFromConfig) {
public void setNASMigrationDoneAndResetDefault(int userId, boolean loadFromConfig) {
try {
sINM.resetDefaultNotificationAssistant(loadFromConfig);
sINM.setNASMigrationDoneAndResetDefault(userId, loadFromConfig);
} catch (Exception e) {
Log.w(TAG, "Error calling NoMan", e);
}