Locale selection settings do not hide warning dialog.
1. If there is more than one user on the device and a user tries to modify the locale which is shared across all users we are showing a warning dialog. When the user selects OK we are changing the locale and going to the previous screen. This is achieved by removing the locale selection fragment from the backstack. The problem was that the dialog was not dismissed upon OK in the dialog which resulted in saving the dialog's state and an attempt to restore it on the wrong fragment which has no idea about this dialog, this returning a null dialog resulting in a crash. This change removes the dialog on OK selection. bug:7265186 Change-Id: I336ab54f5281c7a9ae24f1c25769daac46477ebd
This commit is contained in:
@@ -17,9 +17,7 @@
|
|||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.Context;
|
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.UserManager;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment;
|
import com.android.settings.SettingsPreferenceFragment.SettingsDialogFragment;
|
||||||
@@ -83,6 +81,7 @@ public class LocalePicker extends com.android.internal.app.LocalePicker
|
|||||||
R.string.global_locale_change_title,
|
R.string.global_locale_change_title,
|
||||||
new Runnable() {
|
new Runnable() {
|
||||||
public void run() {
|
public void run() {
|
||||||
|
removeDialog(dialogId);
|
||||||
getActivity().onBackPressed();
|
getActivity().onBackPressed();
|
||||||
LocalePicker.updateLocale(mTargetLocale);
|
LocalePicker.updateLocale(mTargetLocale);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user