diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2015-09-09 00:18:39 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-09-09 00:18:39 +0000 |
commit | 017223acda5bfe16cb87d0a33d72dd28d2fccd3b (patch) | |
tree | 2c3a27bd6a43f048a5f3474896e8b7a0a113474b /core | |
parent | 52429b4a8b9be501f52df62e77c3e4bbb5bf0c3f (diff) | |
parent | b9884663124b609a5cb093fc4a8a8a3b9a8d308d (diff) | |
download | frameworks_base-017223acda5bfe16cb87d0a33d72dd28d2fccd3b.zip frameworks_base-017223acda5bfe16cb87d0a33d72dd28d2fccd3b.tar.gz frameworks_base-017223acda5bfe16cb87d0a33d72dd28d2fccd3b.tar.bz2 |
Merge changes from topic 'packet-keepalive-fixes' into mnc-dr-dev
* changes:
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.java | 2 | ||||
-rw-r--r-- | core/java/android/net/NetworkFactory.java | 6 | ||||
-rw-r--r-- | core/res/AndroidManifest.xml | 5 |
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 c8bb675..b8b6444 100644 --- a/core/res/AndroidManifest.xml +++ b/core/res/AndroidManifest.xml @@ -1056,6 +1056,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" |