Loading Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ java_defaults { "netlink-client", "networkstack-client", "net-utils-framework-common", // See note on statsprotos when adding/updating proto build rules "datastallprotosnano", "statsprotos", "captiveportal-lib", Loading Loading @@ -293,6 +294,8 @@ android_app { required: ["NetworkPermissionConfig"], } // When adding or modifying protos, the jarjar rules and possibly proguard rules need // to be updated: proto libraries may pull additional static libraries. java_library_static { name: "statsprotos", proto: { Loading jarjar-rules-shared.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ rule com.android.net.module.util.** com.android.networkstack.util.@1 rule com.android.internal.util.** android.net.networkstack.util.@1 rule com.google.protobuf.** com.android.networkstack.protobuf.@1 # Classes from net-utils-framework-common rule com.android.net.module.util.** com.android.networkstack.util.@1 Loading jni/network_stack_utils_jni.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ #include <string> #include <nativehelper/JNIHelp.h> #include <nativehelper/JNIHelpCompat.h> #include <android/log.h> namespace android { Loading proguard.flags +7 −0 Original line number Diff line number Diff line Loading @@ -7,3 +7,10 @@ static final int CMD_*; static final int EVENT_*; } # The lite proto runtime uses reflection to access fields based on the names in # the schema, keep all the fields. # This replicates the base proguard rule used by the build by default # (proguard_basic_keeps.flags), but needs to be specified here because the # com.google.protobuf package is jarjared to the below package. -keepclassmembers class * extends com.android.networkstack.protobuf.MessageLite { <fields>; } src/com/android/networkstack/metrics/IpProvisioningMetrics.java +10 −1 Original line number Diff line number Diff line Loading @@ -120,12 +120,21 @@ public class IpProvisioningMetrics { transSuccess ? HostnameTransResult.HTR_SUCCESS : HostnameTransResult.HTR_FAILURE); } private static DhcpErrorCode dhcpErrorFromNumberSafe(int number) { // See DhcpErrorCode.errorCodeWithOption // TODO: add a DhcpErrorCode method to extract the code; // or replace legacy error codes with the new metrics. final DhcpErrorCode error = DhcpErrorCode.forNumber(number & 0xFFFF0000); if (error == null) return DhcpErrorCode.ET_UNKNOWN; return error; } /** * write the DHCP error code into DhcpSession. */ public void addDhcpErrorCode(final int errorCode) { if (mDhcpSessionBuilder.getErrorCodeCount() >= MAX_DHCP_ERROR_COUNT) return; mDhcpSessionBuilder.addErrorCode(DhcpErrorCode.forNumber(errorCode)); mDhcpSessionBuilder.addErrorCode(dhcpErrorFromNumberSafe(errorCode)); } /** Loading Loading
Android.bp +3 −0 Original line number Diff line number Diff line Loading @@ -91,6 +91,7 @@ java_defaults { "netlink-client", "networkstack-client", "net-utils-framework-common", // See note on statsprotos when adding/updating proto build rules "datastallprotosnano", "statsprotos", "captiveportal-lib", Loading Loading @@ -293,6 +294,8 @@ android_app { required: ["NetworkPermissionConfig"], } // When adding or modifying protos, the jarjar rules and possibly proguard rules need // to be updated: proto libraries may pull additional static libraries. java_library_static { name: "statsprotos", proto: { Loading
jarjar-rules-shared.txt +1 −0 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ rule com.android.net.module.util.** com.android.networkstack.util.@1 rule com.android.internal.util.** android.net.networkstack.util.@1 rule com.google.protobuf.** com.android.networkstack.protobuf.@1 # Classes from net-utils-framework-common rule com.android.net.module.util.** com.android.networkstack.util.@1 Loading
jni/network_stack_utils_jni.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ #include <string> #include <nativehelper/JNIHelp.h> #include <nativehelper/JNIHelpCompat.h> #include <android/log.h> namespace android { Loading
proguard.flags +7 −0 Original line number Diff line number Diff line Loading @@ -7,3 +7,10 @@ static final int CMD_*; static final int EVENT_*; } # The lite proto runtime uses reflection to access fields based on the names in # the schema, keep all the fields. # This replicates the base proguard rule used by the build by default # (proguard_basic_keeps.flags), but needs to be specified here because the # com.google.protobuf package is jarjared to the below package. -keepclassmembers class * extends com.android.networkstack.protobuf.MessageLite { <fields>; }
src/com/android/networkstack/metrics/IpProvisioningMetrics.java +10 −1 Original line number Diff line number Diff line Loading @@ -120,12 +120,21 @@ public class IpProvisioningMetrics { transSuccess ? HostnameTransResult.HTR_SUCCESS : HostnameTransResult.HTR_FAILURE); } private static DhcpErrorCode dhcpErrorFromNumberSafe(int number) { // See DhcpErrorCode.errorCodeWithOption // TODO: add a DhcpErrorCode method to extract the code; // or replace legacy error codes with the new metrics. final DhcpErrorCode error = DhcpErrorCode.forNumber(number & 0xFFFF0000); if (error == null) return DhcpErrorCode.ET_UNKNOWN; return error; } /** * write the DHCP error code into DhcpSession. */ public void addDhcpErrorCode(final int errorCode) { if (mDhcpSessionBuilder.getErrorCodeCount() >= MAX_DHCP_ERROR_COUNT) return; mDhcpSessionBuilder.addErrorCode(DhcpErrorCode.forNumber(errorCode)); mDhcpSessionBuilder.addErrorCode(dhcpErrorFromNumberSafe(errorCode)); } /** Loading