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

Commit 984b4b44 authored by Sagar Regmi's avatar Sagar Regmi Committed by Linux Build Service Account
Browse files

connectivity: updated logic for running clatd

Enable/disable Android XLAT feature based on a persist property.
Disabling this property allows the modem to take over the XLAT
functionality.

Change-Id: Iae830e7d74e08161ed8ab1ff0ea50c5b2cb97079
CRs-Fixed: 816784
parent ee66ed50
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.os.Handler;
import android.os.Message;
import android.os.INetworkManagementService;
import android.os.RemoteException;
import android.os.SystemProperties;
import android.util.Slog;

import com.android.server.net.BaseNetworkObserver;
@@ -90,7 +91,12 @@ public class Nat464Xlat extends BaseNetworkObserver {
                (nai.linkProperties != null) ? nai.linkProperties.hasIPv4Address() : false;
        // Only support clat on mobile and wifi for now, because these are the only IPv6-only
        // networks we can connect to.
        return connected && !hasIPv4Address && (netType == TYPE_MOBILE || netType == TYPE_WIFI);
        boolean doXlat = SystemProperties.getBoolean("persist.net.doxlat",true);
        if(!doXlat) {
            Slog.i(TAG, "Android Xlat is disabled");
        }
        return connected && !hasIPv4Address && (((netType == TYPE_MOBILE) && doXlat )
                                              || netType == TYPE_WIFI);
    }

    /**