Loading packages/NetworkStack/AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,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> Loading packages/NetworkStack/src/android/net/util/NetworkStackUtils.java +16 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.net.util; import android.annotation.NonNull; import android.annotation.Nullable; import android.util.SparseArray; import java.io.FileDescriptor; Loading Loading @@ -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; } } Loading
packages/NetworkStack/AndroidManifest.xml +1 −1 Original line number Diff line number Diff line Loading @@ -30,7 +30,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> Loading
packages/NetworkStack/src/android/net/util/NetworkStackUtils.java +16 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package android.net.util; import android.annotation.NonNull; import android.annotation.Nullable; import android.util.SparseArray; import java.io.FileDescriptor; Loading Loading @@ -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; } }