From e027ed6d2499d52e446a742aa4af08cb44caa0b3 Mon Sep 17 00:00:00 2001 From: Chiachang Wang Date: Mon, 1 Apr 2019 09:56:05 +0800 Subject: [PATCH] Provide link to android experimental flags API Add function to link to android experiemental flags API Bug: 120013793 Test: Build and atest NetworkStackTests Change-Id: I14b9a6f06f841a9d63e8c1954907447a9e7eb8a5 --- packages/NetworkStack/AndroidManifest.xml | 2 +- .../src/android/net/util/NetworkStackUtils.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/NetworkStack/AndroidManifest.xml b/packages/NetworkStack/AndroidManifest.xml index 9b60dc3e952af..df886ea908df7 100644 --- a/packages/NetworkStack/AndroidManifest.xml +++ b/packages/NetworkStack/AndroidManifest.xml @@ -30,7 +30,7 @@ - + diff --git a/packages/NetworkStack/src/android/net/util/NetworkStackUtils.java b/packages/NetworkStack/src/android/net/util/NetworkStackUtils.java index fedb8d1101973..670563cf391e8 100644 --- a/packages/NetworkStack/src/android/net/util/NetworkStackUtils.java +++ b/packages/NetworkStack/src/android/net/util/NetworkStackUtils.java @@ -17,6 +17,7 @@ package android.net.util; import android.annotation.NonNull; +import android.annotation.Nullable; import android.util.SparseArray; import java.io.FileDescriptor; @@ -81,4 +82,19 @@ public class NetworkStackUtils { } return false; } + + /** + * Look up the value of a property for a particular namespace from {@link DeviceConfig}. + * @param namespace The namespace containing the property to look up. + * @param name The name of the property to look up. + * @param defaultValue The value to return if the property does not exist or has no non-null + * value. + * @return the corresponding value, or defaultValue if none exists. + */ + @Nullable + public static String getDeviceConfigProperty(@NonNull String namespace, @NonNull String name, + @Nullable String defaultValue) { + // TODO: Link to DeviceConfig API once it is ready. + return defaultValue; + } }