Revert logging changes for empty netbpfload prog
Recent ConnectivityService does not use the empty netbpfload program
used for the logging in these changes. Revert changes that were added
temporarily for merge conflict purposes.
This reverts commit 1c351b2c4aed13b6169cbb107f7a1488637dbdd5.
This reverts commit 4bf2d4e8cd077d012d01ede5e5dfba222f4ee939.
This reverts commit 295746d2bfb84f82c2528b1315b62f9224f57474.
Change-Id: Ifec055938b4a1f684299662c1661a8ae13b0aedb
diff --git a/service/src/com/android/server/ConnectivityService.java b/service/src/com/android/server/ConnectivityService.java
index 5186203..3dee305 100755
--- a/service/src/com/android/server/ConnectivityService.java
+++ b/service/src/com/android/server/ConnectivityService.java
@@ -109,7 +109,6 @@
import static android.os.Process.INVALID_UID;
import static android.os.Process.VPN_UID;
import static android.system.OsConstants.ETH_P_ALL;
-import static android.system.OsConstants.F_OK;
import static android.system.OsConstants.IPPROTO_TCP;
import static android.system.OsConstants.IPPROTO_UDP;
@@ -279,7 +278,6 @@
import android.stats.connectivity.ValidatedState;
import android.sysprop.NetworkProperties;
import android.system.ErrnoException;
-import android.system.Os;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
@@ -393,7 +391,6 @@
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import java.util.Objects;
-import java.util.Random;
import java.util.Set;
import java.util.SortedSet;
import java.util.StringJoiner;
@@ -1845,35 +1842,6 @@
new PermissionMonitor(mContext, mNetd, mBpfNetMaps, mHandlerThread);
mHandlerThread.start();
mHandler = new InternalHandler(mHandlerThread.getLooper());
- // Temporary hack to report netbpfload result.
- // TODO: remove in 2024-09 when netbpfload starts loading mainline bpf programs.
- if (!mDeps.isAtLeastV()) {
- mHandler.postDelayed(() -> {
- // Test Log.wtf reporting pipeline. Ignore this Log.wtf if it shows up in the logs.
- final Random r = new Random();
- if (Build.TYPE.equals("user") && r.nextInt(1000) == 0) {
- Log.wtf(TAG, "NOT A FAILURE, PLEASE IGNORE! Ensure netbpfload result reported");
- }
- // Did netbpfload create the map?
- try {
- Os.access("/sys/fs/bpf/net_shared/map_gentle_test", F_OK);
- } catch (ErrnoException e) {
- Log.wtf(TAG, "netbpfload did not create map", e);
- }
- // Did netbpfload create the program?
- try {
- Os.access("/sys/fs/bpf/net_shared/prog_gentle_skfilter_accept", F_OK);
- } catch (ErrnoException e) {
- Log.wtf(TAG, "netbpfload did not create program", e);
- }
- // Did netbpfload run to completion?
- try {
- Os.access("/sys/fs/bpf/netd_shared/mainline_done", F_OK);
- } catch (ErrnoException e) {
- Log.wtf(TAG, "netbpfload did not run to completion", e);
- }
- }, 30_000 /* delayMillis */);
- }
mTrackerHandler = new NetworkStateTrackerHandler(mHandlerThread.getLooper());
mConnectivityDiagnosticsHandler =
new ConnectivityDiagnosticsHandler(mHandlerThread.getLooper());