diff options
author | Erik Kline <ek@google.com> | 2015-07-13 16:37:51 +0900 |
---|---|---|
committer | Prerepa Viswanadham <dham@google.com> | 2015-07-18 17:28:52 +0000 |
commit | 9d598e115f306e4f0860638c5647a959ac1320c5 (patch) | |
tree | 296d2ee8a80db3b9f8ed5e85948b2a990af6ad8a /services/core/java/com/android/server/ConnectivityService.java | |
parent | c3f21f3b8b01508f5dc01b2e5fa4c3d652bb67bb (diff) | |
download | frameworks_base-9d598e115f306e4f0860638c5647a959ac1320c5.zip frameworks_base-9d598e115f306e4f0860638c5647a959ac1320c5.tar.gz frameworks_base-9d598e115f306e4f0860638c5647a959ac1320c5.tar.bz2 |
Pass signal strength thresholds inside a Bundle
Bug: 21407651
Change-Id: I2c80e89441e2eb15a246cb1fa9347f886cefa80f
Diffstat (limited to 'services/core/java/com/android/server/ConnectivityService.java')
-rw-r--r-- | services/core/java/com/android/server/ConnectivityService.java | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/services/core/java/com/android/server/ConnectivityService.java b/services/core/java/com/android/server/ConnectivityService.java index 49d35b8..1fe1741 100644 --- a/services/core/java/com/android/server/ConnectivityService.java +++ b/services/core/java/com/android/server/ConnectivityService.java @@ -3611,7 +3611,7 @@ public class ConnectivityService extends IConnectivityManager.Stub } } - private int[] getSignalStrengthThresholds(NetworkAgentInfo nai) { + private ArrayList<Integer> getSignalStrengthThresholds(NetworkAgentInfo nai) { final SortedSet<Integer> thresholds = new TreeSet(); synchronized (nai) { for (NetworkRequestInfo nri : mNetworkRequests.values()) { @@ -3621,22 +3621,15 @@ public class ConnectivityService extends IConnectivityManager.Stub } } } - // We can't just do something like: - // return thresholds.toArray(new int[thresholds.size()]); - // because autoboxing does not work for primitive arrays. - final int[] out = new int[thresholds.size()]; - int pos = 0; - for (Integer threshold : thresholds) { - out[pos] = threshold; - pos++; - } - return out; + return new ArrayList<Integer>(thresholds); } private void updateSignalStrengthThresholds(NetworkAgentInfo nai) { + Bundle thresholds = new Bundle(); + thresholds.putIntegerArrayList("thresholds", getSignalStrengthThresholds(nai)); nai.asyncChannel.sendMessage( android.net.NetworkAgent.CMD_SET_SIGNAL_STRENGTH_THRESHOLDS, - 0, 0, getSignalStrengthThresholds(nai)); + 0, 0, thresholds); } @Override |