Merge "Fix MMS Config issues in Debug menu"

This commit is contained in:
Treehugger Robot
2019-06-21 22:09:41 +00:00
committed by Gerrit Code Review
3 changed files with 22 additions and 2 deletions
@@ -90,6 +90,8 @@ public class MmsConfig {
sKeyTypeMap.put(CarrierConfigValuesLoader.CONFIG_HTTP_PARAMS, KEY_TYPE_STRING);
sKeyTypeMap.put(CarrierConfigValuesLoader.CONFIG_EMAIL_GATEWAY_NUMBER, KEY_TYPE_STRING);
sKeyTypeMap.put(CarrierConfigValuesLoader.CONFIG_NAI_SUFFIX, KEY_TYPE_STRING);
sKeyTypeMap.put(CarrierConfigValuesLoader.CONFIG_UA_PROF_URL, KEY_TYPE_STRING);
sKeyTypeMap.put(CarrierConfigValuesLoader.CONFIG_USER_AGENT, KEY_TYPE_STRING);
}
// A map that stores all MmsConfigs, one per active subscription. For pre-LMSim, this will
@@ -39,6 +39,7 @@ import com.android.messaging.util.PhoneUtils;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
/**
@@ -103,6 +104,13 @@ public class DebugMmsConfigFragment extends Fragment {
mInflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
mMmsConfig = MmsConfig.get(subId);
mKeys = new ArrayList<>(mMmsConfig.keySet());
Iterator<String> it = mKeys.iterator();
while (it.hasNext()) {
// Remove a config if the MmsConfig.sKeyTypeMap doesn't have it.
if (MmsConfig.getKeyType(it.next()) == null) {
it.remove();
}
}
Collections.sort(mKeys);
}
@@ -125,7 +133,7 @@ public class DebugMmsConfigFragment extends Fragment {
@Override
public void onValueChanged(String key, String keyType, String value) {
mMmsConfig.update(key, value, keyType);
mMmsConfig.update(keyType, key, value);
notifyDataSetChanged();
}