Loading core/java/android/net/ConnectivityManager.java +16 −1 Original line number Diff line number Diff line Loading @@ -525,4 +525,19 @@ public class ConnectivityManager return TETHER_ERROR_SERVICE_UNAVAIL; } } /** * Ensure the device stays awake until we connect with the next network * @param forWhome The name of the network going down for logging purposes * @return {@code true} on success, {@code false} on failure * {@hide} */ public boolean requestNetworkTransitionWakelock(String forWhom) { try { mService.requestNetworkTransitionWakelock(forWhom); return true; } catch (RemoteException e) { return false; } } } core/java/android/net/IConnectivityManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -72,4 +72,6 @@ interface IConnectivityManager String[] getTetherableUsbRegexs(); String[] getTetherableWifiRegexs(); void requestNetworkTransitionWakelock(in String forWhom); } core/java/android/net/NetworkStateTracker.java +1 −6 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public interface NetworkStateTracker { public static final int EVENT_ROAMING_CHANGED = 5; public static final int EVENT_NETWORK_SUBTYPE_CHANGED = 6; public static final int EVENT_RESTORE_DEFAULT_NETWORK = 7; public static final int EVENT_CLEAR_NET_TRANSITION_WAKELOCK = 8; /** * Fetch NetworkInfo for the network Loading Loading @@ -95,12 +96,6 @@ public interface NetworkStateTracker { */ public boolean isTeardownRequested(); /** * Release the wakelock, if any, that may be held while handling a * disconnect operation. */ public void releaseWakeLock(); public void startMonitoring(); /** Loading core/res/AndroidManifest.xml +7 −0 Original line number Diff line number Diff line Loading @@ -344,6 +344,13 @@ android:description="@string/permdesc_accountManagerService" android:label="@string/permlab_accountManagerService" /> <!-- Allows an internal user to use privaledged ConnectivityManager APIs. @hide --> <permission android:name="android.permission.CONNECTIVITY_INTERNAL" android:permissionGroup="android.permission-group.NETWORK" android:protectionLevel="signatureOrSystem" /> <!-- ================================== --> <!-- Permissions for accessing accounts --> <!-- ================================== --> Loading core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,9 @@ <item>"0,1"</item> </string-array> <!-- The maximum duration (in milliseconds) we expect a network transition to take --> <integer name="config_networkTransitionTimeout">60000</integer> <!-- List of regexpressions describing the interface (if any) that represent tetherable USB interfaces. If the device doesn't want to support tething over USB this should be empty. An example would be "usb.*" --> Loading Loading
core/java/android/net/ConnectivityManager.java +16 −1 Original line number Diff line number Diff line Loading @@ -525,4 +525,19 @@ public class ConnectivityManager return TETHER_ERROR_SERVICE_UNAVAIL; } } /** * Ensure the device stays awake until we connect with the next network * @param forWhome The name of the network going down for logging purposes * @return {@code true} on success, {@code false} on failure * {@hide} */ public boolean requestNetworkTransitionWakelock(String forWhom) { try { mService.requestNetworkTransitionWakelock(forWhom); return true; } catch (RemoteException e) { return false; } } }
core/java/android/net/IConnectivityManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -72,4 +72,6 @@ interface IConnectivityManager String[] getTetherableUsbRegexs(); String[] getTetherableWifiRegexs(); void requestNetworkTransitionWakelock(in String forWhom); }
core/java/android/net/NetworkStateTracker.java +1 −6 Original line number Diff line number Diff line Loading @@ -38,6 +38,7 @@ public interface NetworkStateTracker { public static final int EVENT_ROAMING_CHANGED = 5; public static final int EVENT_NETWORK_SUBTYPE_CHANGED = 6; public static final int EVENT_RESTORE_DEFAULT_NETWORK = 7; public static final int EVENT_CLEAR_NET_TRANSITION_WAKELOCK = 8; /** * Fetch NetworkInfo for the network Loading Loading @@ -95,12 +96,6 @@ public interface NetworkStateTracker { */ public boolean isTeardownRequested(); /** * Release the wakelock, if any, that may be held while handling a * disconnect operation. */ public void releaseWakeLock(); public void startMonitoring(); /** Loading
core/res/AndroidManifest.xml +7 −0 Original line number Diff line number Diff line Loading @@ -344,6 +344,13 @@ android:description="@string/permdesc_accountManagerService" android:label="@string/permlab_accountManagerService" /> <!-- Allows an internal user to use privaledged ConnectivityManager APIs. @hide --> <permission android:name="android.permission.CONNECTIVITY_INTERNAL" android:permissionGroup="android.permission-group.NETWORK" android:protectionLevel="signatureOrSystem" /> <!-- ================================== --> <!-- Permissions for accessing accounts --> <!-- ================================== --> Loading
core/res/res/values/config.xml +3 −0 Original line number Diff line number Diff line Loading @@ -98,6 +98,9 @@ <item>"0,1"</item> </string-array> <!-- The maximum duration (in milliseconds) we expect a network transition to take --> <integer name="config_networkTransitionTimeout">60000</integer> <!-- List of regexpressions describing the interface (if any) that represent tetherable USB interfaces. If the device doesn't want to support tething over USB this should be empty. An example would be "usb.*" --> Loading