From 012c5858c9db39de55cd0f18ec4339ffc6788aaa Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Fri, 3 Jul 2020 04:33:45 +0800 Subject: [PATCH] Fix mvno data field summary not update issue With current code logic, whenever user changing mvno type, it only updates mvno data field text, but the summary is not get updated. For example, there is an apn configured as mvno type 'GID' and mvno data 'FF', and user changes mvno type to: 1. 'none' then save, the APN is saved with mvno type 'none' and mvno data 'FF' while it is better to save mvno data as empty value. 2. 'imsi', although the APN can be saved with mvno type 'imsi' and mvno data 'mcc + mnc + x', the UI still display mvno data field as 'FF' unchanged(until user edit mvno data then save) while the mvno data text is already changed to 'mcc + mnc + x'. It is better to also update mvno data summary as 'mcc + mnc + x' With current patch, either adding new apn or edit exist apn, the mvno data field summary is always consistent with latest mvno data field text, which won't make user feel confused. Test: Build and manual test on device. Change-Id: Ica72e246296c20a6d20283b315e6e6c46e80ac08 Signed-off-by: Wei Huang Signed-off-by: Honggang Luo Signed-off-by: Chao Yuan --- src/com/android/settings/network/ApnEditor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/android/settings/network/ApnEditor.java b/src/com/android/settings/network/ApnEditor.java index ac23b21f4ca..111ee8b988e 100644 --- a/src/com/android/settings/network/ApnEditor.java +++ b/src/com/android/settings/network/ApnEditor.java @@ -754,6 +754,9 @@ public class ApnEditor extends SettingsPreferenceFragment telephonyManager = telephonyManagerForSubId; } mMvnoMatchData.setText(telephonyManager.getGroupIdLevel1()); + } else { + // mvno type 'none' case. At this time, mvnoIndex should be 0. + mMvnoMatchData.setText(""); } } @@ -805,6 +808,7 @@ public class ApnEditor extends SettingsPreferenceFragment } mMvnoType.setValue((String) newValue); mMvnoType.setSummary(mvno); + mMvnoMatchData.setSummary(checkNull(mMvnoMatchData.getText())); } else if (KEY_PASSWORD.equals(key)) { mPassword.setSummary(starify(newValue != null ? String.valueOf(newValue) : "")); } else if (KEY_CARRIER_ENABLED.equals(key)) {