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
This commit is contained in:
Robert Greenwalt
2010-06-15 12:19:37 -07:00
parent 7f132d9680
commit 93dc104209
3 changed files with 87 additions and 5 deletions

View File

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

View File

@@ -72,4 +72,6 @@ interface IConnectivityManager
String[] getTetherableUsbRegexs();
String[] getTetherableWifiRegexs();
void requestNetworkTransitionWakelock(in String forWhom);
}