diff options
author | Robert Greenwalt <robdroid@android.com> | 2010-06-15 12:19:37 -0700 |
---|---|---|
committer | Robert Greenwalt <robdroid@android.com> | 2010-06-16 11:04:37 -0700 |
commit | 14f2ef4c9da27a3d58d65dc9f684c5f764ee279a (patch) | |
tree | bef6430bbf98a5734add49dead51039c2489917c /core/java | |
parent | ce718947db0d305a8cf015c29e68907d42e1b6cd (diff) | |
download | frameworks_base-14f2ef4c9da27a3d58d65dc9f684c5f764ee279a.zip frameworks_base-14f2ef4c9da27a3d58d65dc9f684c5f764ee279a.tar.gz frameworks_base-14f2ef4c9da27a3d58d65dc9f684c5f764ee279a.tar.bz2 |
Move the net transition wakelock to ConnService.
When the default network goes down we lose the wake-on-incoming-data capability
until the new net is brought up and apps rebuild their connections. We fixed this
in Wifi, but it's a general connectivity issue, not a wifi issue so moving the
mechanism to connecitivty so other networks can use it.
bug:2734419
Change-Id: I39b5d825eb6b548bd9bb8f179b89254f4db53147
Diffstat (limited to 'core/java')
-rw-r--r-- | core/java/android/net/ConnectivityManager.java | 17 | ||||
-rw-r--r-- | core/java/android/net/IConnectivityManager.aidl | 2 | ||||
-rw-r--r-- | core/java/android/net/NetworkStateTracker.java | 7 |
3 files changed, 19 insertions, 7 deletions
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index 280ded6..6335296 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -524,5 +524,20 @@ public class ConnectivityManager } catch (RemoteException e) { 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; + } + } } diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl index b05c2ed..5a14cc9 100644 --- a/core/java/android/net/IConnectivityManager.aidl +++ b/core/java/android/net/IConnectivityManager.aidl @@ -72,4 +72,6 @@ interface IConnectivityManager String[] getTetherableUsbRegexs(); String[] getTetherableWifiRegexs(); + + void requestNetworkTransitionWakelock(in String forWhom); } diff --git a/core/java/android/net/NetworkStateTracker.java b/core/java/android/net/NetworkStateTracker.java index d5bcfcd..cd8e7f1 100644 --- a/core/java/android/net/NetworkStateTracker.java +++ b/core/java/android/net/NetworkStateTracker.java @@ -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 @@ -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(); /** |