Loading core/java/android/net/ConnectivityManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -1098,6 +1098,7 @@ public class ConnectivityManager { * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.LOCAL_MAC_ADDRESS) public String getCaptivePortalServerUrl() { try { return mService.getCaptivePortalServerUrl(); Loading Loading @@ -2061,10 +2062,11 @@ public class ConnectivityManager { * {@hide} */ @SystemApi @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public boolean isTetheringSupported() { try { return mService.isTetheringSupported(); String pkgName = mContext.getOpPackageName(); return mService.isTetheringSupported(pkgName); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2094,6 +2096,7 @@ public class ConnectivityManager { * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int type, boolean showProvisioningUi, final OnStartTetheringCallback callback) { startTethering(type, showProvisioningUi, callback, null); Loading core/java/android/net/IConnectivityManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ interface IConnectivityManager int getLastTetherError(String iface); boolean isTetheringSupported(); boolean isTetheringSupported(String callerPkg); void startTethering(int type, in ResultReceiver receiver, boolean showProvisioningUi, String callerPkg); Loading services/core/java/com/android/server/ConnectivityService.java +8 −3 Original line number Diff line number Diff line Loading @@ -2973,12 +2973,16 @@ public class ConnectivityService extends IConnectivityManager.Stub return mTethering.getTetheredDhcpRanges(); } @Override public boolean isTetheringSupported(String callerPkg) { ConnectivityManager.enforceTetherChangePermission(mContext, callerPkg); return isTetheringSupported(); } // if ro.tether.denied = true we default to no tethering // gservices could set the secure setting to 1 though to enable it on a build where it // had previously been turned off. @Override public boolean isTetheringSupported() { enforceTetherAccessPermission(); private boolean isTetheringSupported() { int defaultVal = encodeBool(!mSystemProperties.get("ro.tether.denied").equals("true")); boolean tetherSupported = toBool(Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.TETHER_SUPPORTED, defaultVal)); Loading Loading @@ -5380,6 +5384,7 @@ public class ConnectivityService extends IConnectivityManager.Stub @Override public String getCaptivePortalServerUrl() { enforceConnectivityInternalPermission(); return NetworkMonitor.getCaptivePortalServerHttpUrl(mContext); } Loading Loading
core/java/android/net/ConnectivityManager.java +5 −2 Original line number Diff line number Diff line Loading @@ -1098,6 +1098,7 @@ public class ConnectivityManager { * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.LOCAL_MAC_ADDRESS) public String getCaptivePortalServerUrl() { try { return mService.getCaptivePortalServerUrl(); Loading Loading @@ -2061,10 +2062,11 @@ public class ConnectivityManager { * {@hide} */ @SystemApi @RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE) @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public boolean isTetheringSupported() { try { return mService.isTetheringSupported(); String pkgName = mContext.getOpPackageName(); return mService.isTetheringSupported(pkgName); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading Loading @@ -2094,6 +2096,7 @@ public class ConnectivityManager { * @hide */ @SystemApi @RequiresPermission(android.Manifest.permission.TETHER_PRIVILEGED) public void startTethering(int type, boolean showProvisioningUi, final OnStartTetheringCallback callback) { startTethering(type, showProvisioningUi, callback, null); Loading
core/java/android/net/IConnectivityManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -75,7 +75,7 @@ interface IConnectivityManager int getLastTetherError(String iface); boolean isTetheringSupported(); boolean isTetheringSupported(String callerPkg); void startTethering(int type, in ResultReceiver receiver, boolean showProvisioningUi, String callerPkg); Loading
services/core/java/com/android/server/ConnectivityService.java +8 −3 Original line number Diff line number Diff line Loading @@ -2973,12 +2973,16 @@ public class ConnectivityService extends IConnectivityManager.Stub return mTethering.getTetheredDhcpRanges(); } @Override public boolean isTetheringSupported(String callerPkg) { ConnectivityManager.enforceTetherChangePermission(mContext, callerPkg); return isTetheringSupported(); } // if ro.tether.denied = true we default to no tethering // gservices could set the secure setting to 1 though to enable it on a build where it // had previously been turned off. @Override public boolean isTetheringSupported() { enforceTetherAccessPermission(); private boolean isTetheringSupported() { int defaultVal = encodeBool(!mSystemProperties.get("ro.tether.denied").equals("true")); boolean tetherSupported = toBool(Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.TETHER_SUPPORTED, defaultVal)); Loading Loading @@ -5380,6 +5384,7 @@ public class ConnectivityService extends IConnectivityManager.Stub @Override public String getCaptivePortalServerUrl() { enforceConnectivityInternalPermission(); return NetworkMonitor.getCaptivePortalServerHttpUrl(mContext); } Loading