diff options
author | TK MUN <tk.mun@samsung.com> | 2011-05-18 18:30:48 +0900 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2011-05-25 10:32:06 -0700 |
commit | 94260caf2fb3f5dbf6e17b29a269b46ea05f8680 (patch) | |
tree | 16afdf2b64061a927de7b0c0c49c7a250fa0a068 | |
parent | c9cd2387b6938a6fbefc731d2177902266f2a130 (diff) | |
download | base-94260caf2fb3f5dbf6e17b29a269b46ea05f8680.tar.gz |
Allow control over search order for tethering upstream interface selection
Change-Id: If02c9b2bb61b68ebafafadc23ba17a332bc8004f
Signed-off-by: TK MUN <tk.mun@samsung.com>
-rwxr-xr-x | core/res/res/values/config.xml | 1 | ||||
-rw-r--r-- | services/java/com/android/server/connectivity/Tethering.java | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml index 4433b649f6c9..f3cc2bb3f3ce 100755 --- a/core/res/res/values/config.xml +++ b/core/res/res/values/config.xml @@ -125,6 +125,7 @@ <!-- Regex array of allowable upstream ifaces for tethering - for example if you want tethering on a new interface called "foo2" add <item>"foo\\d"</item> to the array --> + <!-- Interfaces will be prioritized according to the order listed --> <string-array translatable="false" name="config_tether_upstream_regexs"> </string-array> diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java index 1ec9b5116172..a4301285d142 100644 --- a/services/java/com/android/server/connectivity/Tethering.java +++ b/services/java/com/android/server/connectivity/Tethering.java @@ -1170,8 +1170,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub { return null; } - for (String iface : ifaces) { - for (String regex : mUpstreamIfaceRegexs) { + for (String regex : mUpstreamIfaceRegexs) { + for (String iface : ifaces) { if (iface.matches(regex)) { // verify it is active InterfaceConfiguration ifcg = null; |