Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6e5d86f7 authored by Joel Scherpelz's avatar Joel Scherpelz Committed by Erik Kline
Browse files

Partially revert "Add blocking and retrying wrappers for INetd uses."

Direct access to Netd from the bluetooth process is disallowed by
SELinux policy. This change reverts to the old behavior where IpManager
interacts with NetdService indirectly via NetworkManagementService.

Test: as follows:
    - built (sailfish)
    - flashed
    - booted
    - established bluetooth tethering to another device, ping'd 8.8.8.8
Bug: 36492299

This partially reverts commit af39244a.

Change-Id: Icf20b1e24abf7dd3123760f8637928bde7afe06b
parent 54d488d4
Loading
Loading
Loading
Loading
+6 −11
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@ import android.content.Context;
import android.net.apf.ApfCapabilities;
import android.net.apf.ApfFilter;
import android.net.DhcpResults;
import android.net.INetd;
import android.net.InterfaceConfiguration;
import android.net.LinkAddress;
import android.net.LinkProperties;
@@ -35,12 +34,10 @@ import android.net.dhcp.DhcpClient;
import android.net.metrics.IpConnectivityLog;
import android.net.metrics.IpManagerEvent;
import android.net.util.MultinetworkPolicyTracker;
import android.net.util.NetdService;
import android.os.INetworkManagementService;
import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.ServiceSpecificException;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.LocalLog;
@@ -1030,16 +1027,14 @@ public class IpManager extends StateMachine {

    private boolean startIPv6() {
        // Set privacy extensions.
        final String PREFER_TEMPADDRS = "2";
        try {
            NetdService.run((INetd netd) -> {
                netd.setProcSysNet(
                        INetd.IPV6, INetd.CONF, mInterfaceName, "use_tempaddr",
                        PREFER_TEMPADDRS);
            });
            mNwService.setInterfaceIpv6PrivacyExtensions(mInterfaceName, true);
            mNwService.enableIpv6(mInterfaceName);
        } catch (IllegalStateException|RemoteException|ServiceSpecificException e) {
            logError("Unable to change interface settings: %s", e);
        } catch (RemoteException re) {
            logError("Unable to change interface settings: %s", re);
            return false;
        } catch (IllegalStateException ie) {
            logError("Unable to change interface settings: %s", ie);
            return false;
        }