summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2020-04-25 06:35:01 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-04-25 06:35:01 +0000
commitca8f7238840cea9624fe19110c7f6f267c176cbf (patch)
tree9f05abe6ab4347c3dfa5780dd574555c43ce0f1d
parent3f36cda2533694a82332e79f560399824ff7b8ae (diff)
parent0c36412a414dc1afb11c08dc634e8516662765b8 (diff)
Add a VERSION constant to the NetworkStack shims. am: 0c36412a41
Change-Id: I505df43551a38d872d6ea032e1f3ae50a4cb6b2f
-rw-r--r--apishim/29/com/android/networkstack/apishim/api29/ConstantsShim.java11
-rw-r--r--apishim/30/com/android/networkstack/apishim/ConstantsShim.java11
2 files changed, 22 insertions, 0 deletions
diff --git a/apishim/29/com/android/networkstack/apishim/api29/ConstantsShim.java b/apishim/29/com/android/networkstack/apishim/api29/ConstantsShim.java
index 762a8b8..eb914d6 100644
--- a/apishim/29/com/android/networkstack/apishim/api29/ConstantsShim.java
+++ b/apishim/29/com/android/networkstack/apishim/api29/ConstantsShim.java
@@ -16,10 +16,21 @@
package com.android.networkstack.apishim.api29;
+import androidx.annotation.VisibleForTesting;
+
/**
* Utility class for defining and importing constants from the Android platform.
*/
public class ConstantsShim {
+ /**
+ * Constant that callers can use to determine what version of the shim they are using.
+ * Must be the same as the version of the shims.
+ * This should only be used by test code. Production code that uses the shims should be using
+ * the shimmed objects and methods themselves.
+ */
+ @VisibleForTesting
+ public static final int VERSION = 29;
+
// Constants defined in android.net.ConnectivityDiagnosticsManager.
public static final int DETECTION_METHOD_DNS_EVENTS = 1;
public static final int DETECTION_METHOD_TCP_METRICS = 2;
diff --git a/apishim/30/com/android/networkstack/apishim/ConstantsShim.java b/apishim/30/com/android/networkstack/apishim/ConstantsShim.java
index f040f76..38a1640 100644
--- a/apishim/30/com/android/networkstack/apishim/ConstantsShim.java
+++ b/apishim/30/com/android/networkstack/apishim/ConstantsShim.java
@@ -19,10 +19,21 @@ package com.android.networkstack.apishim;
import static android.net.ConnectivityDiagnosticsManager.ConnectivityReport;
import static android.net.ConnectivityDiagnosticsManager.DataStallReport;
+import androidx.annotation.VisibleForTesting;
+
/**
* Utility class for defining and importing constants from the Android platform.
*/
public class ConstantsShim extends com.android.networkstack.apishim.api29.ConstantsShim {
+ /**
+ * Constant that callers can use to determine what version of the shim they are using.
+ * Must be the same as the version of the shims.
+ * This should only be used by test code. Production code that uses the shims should be using
+ * the shimmed objects and methods themselves.
+ */
+ @VisibleForTesting
+ public static final int VERSION = 30;
+
public static final int DETECTION_METHOD_DNS_EVENTS =
DataStallReport.DETECTION_METHOD_DNS_EVENTS;
public static final int DETECTION_METHOD_TCP_METRICS =