Remove the xml entry when the system language is removed

Bug: 301395074
Test: atest SettingsRoboTests:com.android.settings.localepicker
Change-Id: Ic771cd5146ab954c3da65748bf87cd14d30770b4
This commit is contained in:
Allen Su
2023-12-26 08:58:11 +00:00
parent 3b300cbf9f
commit d8695cbf9b
7 changed files with 66 additions and 18 deletions

View File

@@ -62,6 +62,17 @@ public class LocaleNotificationDataManager {
editor.apply();
}
/**
* Removes one entry with the corresponding locale from the {@link SharedPreferences}.
*
* @param locale A locale which the application sets to
*/
public void removeNotificationInfo(String locale) {
SharedPreferences.Editor editor = getSharedPreferences(mContext).edit();
editor.remove(locale);
editor.apply();
}
/**
* Gets the {@link NotificationInfo} with the associated locale from the
* {@link SharedPreferences}.