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
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 @@
} 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;
+ }
+ }
}