summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2015-09-09 00:26:53 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-09 00:26:53 +0000
commit0bc356687e022fa1ae611c4ebeb0e0622810d7e4 (patch)
tree5555d8ca836c8522959c00aa3e5ebac3a671f4f0 /core
parent975ceef616aac6de561c4a4e1d82a636f5cf37e3 (diff)
parent017223acda5bfe16cb87d0a33d72dd28d2fccd3b (diff)
downloadframeworks_base-0bc356687e022fa1ae611c4ebeb0e0622810d7e4.zip
frameworks_base-0bc356687e022fa1ae611c4ebeb0e0622810d7e4.tar.gz
frameworks_base-0bc356687e022fa1ae611c4ebeb0e0622810d7e4.tar.bz2
am 017223ac: Merge changes from topic \'packet-keepalive-fixes\' into mnc-dr-dev
* commit '017223acda5bfe16cb87d0a33d72dd28d2fccd3b': Require the new PACKET_KEEPALIVE_OFFLOAD permission. Add an error code for generic hardware error. Fix bugs and crashes in PacketKeepalive API. Add tests for the PacketKeepalive API. Add a PACKET_KEEPALIVE_OFFLOAD permission. Use a CountDownLatch instead of sleep() in NetworkFactory tests. Get rid of shortSleep() in ConnectivityServiceTest. Make ConnectivityServiceTest a bit more readable.
Diffstat (limited to 'core')
-rw-r--r--core/java/android/net/ConnectivityManager.java2
-rw-r--r--core/java/android/net/NetworkFactory.java6
-rw-r--r--core/res/AndroidManifest.xml5
3 files changed, 11 insertions, 2 deletions
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java
index 4055836..9a2a241 100644
--- a/core/java/android/net/ConnectivityManager.java
+++ b/core/java/android/net/ConnectivityManager.java
@@ -1243,6 +1243,8 @@ public class ConnectivityManager {
/** The hardware does not support this request. */
public static final int ERROR_HARDWARE_UNSUPPORTED = -30;
+ /** The hardware returned an error. */
+ public static final int ERROR_HARDWARE_ERROR = -31;
public static final int NATT_PORT = 4500;
diff --git a/core/java/android/net/NetworkFactory.java b/core/java/android/net/NetworkFactory.java
index 5f46c73..cab88b9 100644
--- a/core/java/android/net/NetworkFactory.java
+++ b/core/java/android/net/NetworkFactory.java
@@ -169,7 +169,8 @@ public class NetworkFactory extends Handler {
}
}
- private void handleAddRequest(NetworkRequest request, int score) {
+ @VisibleForTesting
+ protected void handleAddRequest(NetworkRequest request, int score) {
NetworkRequestInfo n = mNetworkRequests.get(request.requestId);
if (n == null) {
if (DBG) log("got request " + request + " with score " + score);
@@ -184,7 +185,8 @@ public class NetworkFactory extends Handler {
evalRequest(n);
}
- private void handleRemoveRequest(NetworkRequest request) {
+ @VisibleForTesting
+ protected void handleRemoveRequest(NetworkRequest request) {
NetworkRequestInfo n = mNetworkRequests.get(request.requestId);
if (n != null) {
mNetworkRequests.remove(request.requestId);
diff --git a/core/res/AndroidManifest.xml b/core/res/AndroidManifest.xml
index 02fb8f4..5f4dd31 100644
--- a/core/res/AndroidManifest.xml
+++ b/core/res/AndroidManifest.xml
@@ -1063,6 +1063,11 @@
<permission android:name="android.permission.CONNECTIVITY_INTERNAL"
android:protectionLevel="signature|privileged" />
+ <!-- Allows a system application to access hardware packet offload capabilities.
+ @hide -->
+ <permission android:name="android.permission.PACKET_KEEPALIVE_OFFLOAD"
+ android:protectionLevel="signature|privileged" />
+
<!-- @SystemApi
@hide -->
<permission android:name="android.permission.RECEIVE_DATA_ACTIVITY_CHANGE"