Loading src/java/com/android/internal/telephony/dataconnection/DcTracker.java +26 −29 Original line number Original line Diff line number Diff line Loading @@ -599,7 +599,7 @@ public class DcTracker extends Handler { private ArrayList<DataProfile> mLastDataProfileList = new ArrayList<>(); private ArrayList<DataProfile> mLastDataProfileList = new ArrayList<>(); /** RAT name ===> (downstream, upstream) bandwidth values from carrier config. */ /** RAT name ===> (downstream, upstream) bandwidth values from carrier config. */ private final ConcurrentHashMap<String, Pair<Integer, Integer>> mBandwidths = private ConcurrentHashMap<String, Pair<Integer, Integer>> mBandwidths = new ConcurrentHashMap<>(); new ConcurrentHashMap<>(); /** /** Loading Loading @@ -3806,8 +3806,7 @@ public class DcTracker extends Handler { * @param useLte For NR NSA, whether to use LTE value for upstream or not * @param useLte For NR NSA, whether to use LTE value for upstream or not */ */ private void updateLinkBandwidths(String[] bandwidths, boolean useLte) { private void updateLinkBandwidths(String[] bandwidths, boolean useLte) { synchronized (mBandwidths) { ConcurrentHashMap<String, Pair<Integer, Integer>> temp = new ConcurrentHashMap<>(); mBandwidths.clear(); for (String config : bandwidths) { for (String config : bandwidths) { int downstream = 14; int downstream = 14; int upstream = 14; int upstream = 14; Loading @@ -3821,25 +3820,23 @@ public class DcTracker extends Handler { } catch (NumberFormatException ignored) { } catch (NumberFormatException ignored) { } } } } mBandwidths.put(kv[0], new Pair<>(downstream, upstream)); temp.put(kv[0], new Pair<>(downstream, upstream)); } } } } if (useLte) { if (useLte) { Pair<Integer, Integer> ltePair = mBandwidths.get(DctConstants.RAT_NAME_LTE); Pair<Integer, Integer> ltePair = temp.get(DctConstants.RAT_NAME_LTE); if (ltePair != null) { if (ltePair != null) { if (mBandwidths.containsKey(DctConstants.RAT_NAME_NR_NSA)) { if (temp.containsKey(DctConstants.RAT_NAME_NR_NSA)) { mBandwidths.put(DctConstants.RAT_NAME_NR_NSA, new Pair<>( temp.put(DctConstants.RAT_NAME_NR_NSA, new Pair<>( mBandwidths.get(DctConstants.RAT_NAME_NR_NSA).first, temp.get(DctConstants.RAT_NAME_NR_NSA).first, ltePair.second)); ltePair.second)); } if (mBandwidths.containsKey(DctConstants.RAT_NAME_NR_NSA_MMWAVE)) { mBandwidths.put(DctConstants.RAT_NAME_NR_NSA_MMWAVE, new Pair<>( mBandwidths.get(DctConstants.RAT_NAME_NR_NSA_MMWAVE).first, ltePair.second)); } } if (temp.containsKey(DctConstants.RAT_NAME_NR_NSA_MMWAVE)) { temp.put(DctConstants.RAT_NAME_NR_NSA_MMWAVE, new Pair<>( temp.get(DctConstants.RAT_NAME_NR_NSA_MMWAVE).first, ltePair.second)); } } } } } } mBandwidths = temp; for (DataConnection dc : mDataConnections.values()) { for (DataConnection dc : mDataConnections.values()) { dc.sendMessage(DataConnection.EVENT_CARRIER_CONFIG_LINK_BANDWIDTHS_CHANGED); dc.sendMessage(DataConnection.EVENT_CARRIER_CONFIG_LINK_BANDWIDTHS_CHANGED); } } Loading Loading
src/java/com/android/internal/telephony/dataconnection/DcTracker.java +26 −29 Original line number Original line Diff line number Diff line Loading @@ -599,7 +599,7 @@ public class DcTracker extends Handler { private ArrayList<DataProfile> mLastDataProfileList = new ArrayList<>(); private ArrayList<DataProfile> mLastDataProfileList = new ArrayList<>(); /** RAT name ===> (downstream, upstream) bandwidth values from carrier config. */ /** RAT name ===> (downstream, upstream) bandwidth values from carrier config. */ private final ConcurrentHashMap<String, Pair<Integer, Integer>> mBandwidths = private ConcurrentHashMap<String, Pair<Integer, Integer>> mBandwidths = new ConcurrentHashMap<>(); new ConcurrentHashMap<>(); /** /** Loading Loading @@ -3806,8 +3806,7 @@ public class DcTracker extends Handler { * @param useLte For NR NSA, whether to use LTE value for upstream or not * @param useLte For NR NSA, whether to use LTE value for upstream or not */ */ private void updateLinkBandwidths(String[] bandwidths, boolean useLte) { private void updateLinkBandwidths(String[] bandwidths, boolean useLte) { synchronized (mBandwidths) { ConcurrentHashMap<String, Pair<Integer, Integer>> temp = new ConcurrentHashMap<>(); mBandwidths.clear(); for (String config : bandwidths) { for (String config : bandwidths) { int downstream = 14; int downstream = 14; int upstream = 14; int upstream = 14; Loading @@ -3821,25 +3820,23 @@ public class DcTracker extends Handler { } catch (NumberFormatException ignored) { } catch (NumberFormatException ignored) { } } } } mBandwidths.put(kv[0], new Pair<>(downstream, upstream)); temp.put(kv[0], new Pair<>(downstream, upstream)); } } } } if (useLte) { if (useLte) { Pair<Integer, Integer> ltePair = mBandwidths.get(DctConstants.RAT_NAME_LTE); Pair<Integer, Integer> ltePair = temp.get(DctConstants.RAT_NAME_LTE); if (ltePair != null) { if (ltePair != null) { if (mBandwidths.containsKey(DctConstants.RAT_NAME_NR_NSA)) { if (temp.containsKey(DctConstants.RAT_NAME_NR_NSA)) { mBandwidths.put(DctConstants.RAT_NAME_NR_NSA, new Pair<>( temp.put(DctConstants.RAT_NAME_NR_NSA, new Pair<>( mBandwidths.get(DctConstants.RAT_NAME_NR_NSA).first, temp.get(DctConstants.RAT_NAME_NR_NSA).first, ltePair.second)); ltePair.second)); } if (mBandwidths.containsKey(DctConstants.RAT_NAME_NR_NSA_MMWAVE)) { mBandwidths.put(DctConstants.RAT_NAME_NR_NSA_MMWAVE, new Pair<>( mBandwidths.get(DctConstants.RAT_NAME_NR_NSA_MMWAVE).first, ltePair.second)); } } if (temp.containsKey(DctConstants.RAT_NAME_NR_NSA_MMWAVE)) { temp.put(DctConstants.RAT_NAME_NR_NSA_MMWAVE, new Pair<>( temp.get(DctConstants.RAT_NAME_NR_NSA_MMWAVE).first, ltePair.second)); } } } } } } mBandwidths = temp; for (DataConnection dc : mDataConnections.values()) { for (DataConnection dc : mDataConnections.values()) { dc.sendMessage(DataConnection.EVENT_CARRIER_CONFIG_LINK_BANDWIDTHS_CHANGED); dc.sendMessage(DataConnection.EVENT_CARRIER_CONFIG_LINK_BANDWIDTHS_CHANGED); } } Loading