diff options
author | Chiachang Wang <chiachangwang@google.com> | 2019-03-31 22:25:35 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-03-31 22:25:35 -0700 |
commit | 8e0423adec4977468c1bd8f4065d5a776ad06c9f (patch) | |
tree | 874ccc4b1b802cffc0235f7e6f96710ea377c22a | |
parent | 7399a23929906c664a8991f4cbf831c263961881 (diff) | |
parent | 839d975cdd656933e9e32f57301353b5eafa6914 (diff) |
Merge "Provide link to android experimental flags API" am: 9876efdabe am: a94479c120
am: 8724b66c2d
Change-Id: I4045d54066cf1c8270bb6eca030daf0193721723
-rw-r--r-- | AndroidManifest.xml | 2 | ||||
-rw-r--r-- | src/android/net/util/NetworkStackUtils.java | 16 |
2 files changed, 17 insertions, 1 deletions
diff --git a/AndroidManifest.xml b/AndroidManifest.xml index 8d8e222..dd5c9f5 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -34,7 +34,7 @@ <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS" /> <uses-permission android:name="android.permission.WAKE_LOCK" /> <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" /> - + <uses-permission android:name="android.permission.READ_DEVICE_CONFIG" /> <!-- Signature permission defined in NetworkStackStub --> <uses-permission android:name="android.permission.MAINLINE_NETWORK_STACK" /> <application> diff --git a/src/android/net/util/NetworkStackUtils.java b/src/android/net/util/NetworkStackUtils.java index fedb8d1..670563c 100644 --- a/src/android/net/util/NetworkStackUtils.java +++ b/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; + } } |