From df8d299ecc0f5394c9c37df2f6980f9a7a11ff6c Mon Sep 17 00:00:00 2001 From: Motomu Utsumi Date: Thu, 1 Sep 2022 17:08:27 +0900 Subject: [PATCH] Add native_dump to the Dependencies This is a preparation for the upcoming CL that will add the test for BpfNetMaps#dump. Bug: 217624062 Test: dumpsys connectivity trafficcontroller, atest BpfNetMapsTest Change-Id: I79aa6f6153dc94f806411c642d72f4801915a588 --- service/src/com/android/server/BpfNetMaps.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/service/src/com/android/server/BpfNetMaps.java b/service/src/com/android/server/BpfNetMaps.java index bfa0808984..758c013418 100644 --- a/service/src/com/android/server/BpfNetMaps.java +++ b/service/src/com/android/server/BpfNetMaps.java @@ -294,6 +294,13 @@ public class BpfNetMaps { return ConnectivityStatsLog.buildStatsEvent(NETWORK_BPF_MAP_INFO, cookieTagMapSize, uidOwnerMapSize, uidPermissionMapSize); } + + /** + * Call native_dump + */ + public void nativeDump(final FileDescriptor fd, final boolean verbose) { + native_dump(fd, verbose); + } } /** Constructor used after T that doesn't need to use netd anymore. */ @@ -920,7 +927,7 @@ public class BpfNetMaps { EOPNOTSUPP, "dumpsys connectivity trafficcontroller dump not available on pre-T" + " devices, use dumpsys netd trafficcontroller instead."); } - native_dump(fd, verbose); + mDeps.nativeDump(fd, verbose); } private static native void native_init(boolean startSkDestroyListener); @@ -936,6 +943,6 @@ public class BpfNetMaps { private native int native_updateUidLockdownRule(int uid, boolean add); private native int native_swapActiveStatsMap(); private native void native_setPermissionForUids(int permissions, int[] uids); - private native void native_dump(FileDescriptor fd, boolean verbose); + private static native void native_dump(FileDescriptor fd, boolean verbose); private static native int native_synchronizeKernelRCU(); }