Fix current tab is changed when rotating device
Even if SIM slot 2 is selected in SIM card lock settings, the current tab is changed to SIM slot 1 when rotating the device. To fix this issue, the current tab should be restored after rotating the device. Fixes: 63690125 Test: manual - go to Settings > Security > SIM card lock and rotate device Change-Id: I874d4d06019e21dd7b65951a3aefb75ff5ea298b
This commit is contained in:
committed by
Yoshinori Hirano
parent
aa8a972ea3
commit
4ca4bd31c3
@@ -80,6 +80,7 @@ public class IccLockSettings extends SettingsPreferenceFragment
|
||||
private static final String DIALOG_PIN = "dialogPin";
|
||||
private static final String DIALOG_ERROR = "dialogError";
|
||||
private static final String ENABLE_TO_STATE = "enableState";
|
||||
private static final String CURRENT_TAB = "currentTab";
|
||||
|
||||
// Save and restore inputted PIN code when configuration changed
|
||||
// (ex. portrait<-->landscape) during change PIN code
|
||||
@@ -235,6 +236,10 @@ public class IccLockSettings extends SettingsPreferenceFragment
|
||||
|
||||
mPhone = (sir == null) ? null
|
||||
: PhoneFactory.getPhone(SubscriptionManager.getPhoneId(sir.getSubscriptionId()));
|
||||
|
||||
if (savedInstanceState != null && savedInstanceState.containsKey(CURRENT_TAB)) {
|
||||
mTabHost.setCurrentTabByTag(savedInstanceState.getString(CURRENT_TAB));
|
||||
}
|
||||
return view;
|
||||
} else {
|
||||
mPhone = PhoneFactory.getDefaultPhone();
|
||||
@@ -326,6 +331,10 @@ public class IccLockSettings extends SettingsPreferenceFragment
|
||||
} else {
|
||||
super.onSaveInstanceState(out);
|
||||
}
|
||||
|
||||
if (mTabHost != null) {
|
||||
out.putString(CURRENT_TAB, mTabHost.getCurrentTabTag());
|
||||
}
|
||||
}
|
||||
|
||||
private void showPinDialog() {
|
||||
|
Reference in New Issue
Block a user