Loading services/core/java/com/android/server/ConnectivityService.java +1 −4 Original line number Diff line number Diff line Loading @@ -3130,10 +3130,7 @@ public class ConnectivityService extends IConnectivityManager.Stub Settings.Global.TETHER_SUPPORTED, defaultVal) != 0) && !mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING); return tetherEnabledInSettings && mUserManager.isAdminUser() && ((mTethering.getTetherableUsbRegexs().length != 0 || mTethering.getTetherableWifiRegexs().length != 0 || mTethering.getTetherableBluetoothRegexs().length != 0) && mTethering.getUpstreamIfaceTypes().length != 0); mTethering.hasTetherableConfiguration(); } @Override Loading services/core/java/com/android/server/connectivity/Tethering.java +12 −12 Original line number Diff line number Diff line Loading @@ -205,7 +205,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering return (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); } void updateConfiguration() { private void updateConfiguration() { mConfig = new TetheringConfiguration(mContext); } Loading Loading @@ -817,6 +817,17 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering return mConfig; } public boolean hasTetherableConfiguration() { final TetheringConfiguration cfg = mConfig; final boolean hasDownstreamConfiguration = (cfg.tetherableUsbRegexs.length != 0) || (cfg.tetherableWifiRegexs.length != 0) || (cfg.tetherableBluetoothRegexs.length != 0); final boolean hasUpstreamConfiguration = !cfg.preferredUpstreamIfaceTypes.isEmpty(); return hasDownstreamConfiguration && hasUpstreamConfiguration; } // TODO - update callers to use getTetheringConfiguration(), // which has only final members. public String[] getTetherableUsbRegexs() { Loading Loading @@ -864,17 +875,6 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering return ConnectivityManager.TETHER_ERROR_NO_ERROR; } public int[] getUpstreamIfaceTypes() { updateConfiguration(); // TODO - remove? final Collection<Integer> upstreams = mConfig.preferredUpstreamIfaceTypes; final int[] values = new int[upstreams.size()]; int i = 0; for (Integer u : upstreams) { values[i++] = u.intValue(); } return values; } // TODO review API - maybe return ArrayList<String> here and below? public String[] getTetheredIfaces() { ArrayList<String> list = new ArrayList<String>(); Loading Loading
services/core/java/com/android/server/ConnectivityService.java +1 −4 Original line number Diff line number Diff line Loading @@ -3130,10 +3130,7 @@ public class ConnectivityService extends IConnectivityManager.Stub Settings.Global.TETHER_SUPPORTED, defaultVal) != 0) && !mUserManager.hasUserRestriction(UserManager.DISALLOW_CONFIG_TETHERING); return tetherEnabledInSettings && mUserManager.isAdminUser() && ((mTethering.getTetherableUsbRegexs().length != 0 || mTethering.getTetherableWifiRegexs().length != 0 || mTethering.getTetherableBluetoothRegexs().length != 0) && mTethering.getUpstreamIfaceTypes().length != 0); mTethering.hasTetherableConfiguration(); } @Override Loading
services/core/java/com/android/server/connectivity/Tethering.java +12 −12 Original line number Diff line number Diff line Loading @@ -205,7 +205,7 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering return (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); } void updateConfiguration() { private void updateConfiguration() { mConfig = new TetheringConfiguration(mContext); } Loading Loading @@ -817,6 +817,17 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering return mConfig; } public boolean hasTetherableConfiguration() { final TetheringConfiguration cfg = mConfig; final boolean hasDownstreamConfiguration = (cfg.tetherableUsbRegexs.length != 0) || (cfg.tetherableWifiRegexs.length != 0) || (cfg.tetherableBluetoothRegexs.length != 0); final boolean hasUpstreamConfiguration = !cfg.preferredUpstreamIfaceTypes.isEmpty(); return hasDownstreamConfiguration && hasUpstreamConfiguration; } // TODO - update callers to use getTetheringConfiguration(), // which has only final members. public String[] getTetherableUsbRegexs() { Loading Loading @@ -864,17 +875,6 @@ public class Tethering extends BaseNetworkObserver implements IControlsTethering return ConnectivityManager.TETHER_ERROR_NO_ERROR; } public int[] getUpstreamIfaceTypes() { updateConfiguration(); // TODO - remove? final Collection<Integer> upstreams = mConfig.preferredUpstreamIfaceTypes; final int[] values = new int[upstreams.size()]; int i = 0; for (Integer u : upstreams) { values[i++] = u.intValue(); } return values; } // TODO review API - maybe return ArrayList<String> here and below? public String[] getTetheredIfaces() { ArrayList<String> list = new ArrayList<String>(); Loading