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

Commit 7214cf63 authored by Harout Hedeshian's avatar Harout Hedeshian Committed by Steve Kondik
Browse files

base: IPV6 tethering support



Added two APIs addUpstreamV6Interface and removeUpstreamV6Interface,
required to pass the interfaces to use to the Router Advertisement
Proxy.
Added a dun entry to the networkAttributes value in
res/values/config.xml.
This is to allow tethering to work with the dunRequired property.
Added dun to allowable tether upstream type.
Enabled debug flags for debug logging inside framework components.
Regardless of MOBILE_TYPE_DUN APN being available, if dun_required
flag is not set, fall back to HIPRI as a preferred APN for the
embedded data call.
Debug logging was enabled by default which was causing security
vulnerabilities. This patch disables debug logging.

CRs-fixed: 555006
Change-Id: Idb0971449473554bcd749d478563db7ba351d55d
Acked-by: default avatarSubash Abhinov Kasiviswanathan <subashab@qti.qualcomm.com>
(cherry picked from commit 43bac130e4bab1c12792d29042f85c6a10372553)
(cherry picked from commit be8491aa9d82177c200eab1af713244a7bbbdcfc)
parent cb903dc6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -187,6 +187,7 @@
        <item>"mobile,0,0,0,-1,true"</item>
        <item>"mobile_mms,2,0,2,60000,true"</item>
        <item>"mobile_supl,3,0,2,60000,true"</item>
        <item>"mobile_dun,4,0,2,60000,true"</item>
        <item>"mobile_hipri,5,0,3,60000,true"</item>
        <item>"mobile_fota,10,0,2,60000,true"</item>
        <item>"mobile_ims,11,0,2,60000,true"</item>
@@ -302,6 +303,7 @@
    <integer-array translatable="false" name="config_tether_upstream_types">
        <item>0</item>
        <item>1</item>
        <item>4</item>
        <item>5</item>
        <item>7</item>
        <item>9</item>
+4 −4
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

package com.android.server;

import static android.Manifest.permission.ACCESS_NETWORK_STATE;
import static android.Manifest.permission.CONNECTIVITY_INTERNAL;
import static android.Manifest.permission.DUMP;
import static android.Manifest.permission.SHUTDOWN;
@@ -59,6 +60,7 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemClock;
import android.os.SystemProperties;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import android.util.Slog;
@@ -141,7 +143,7 @@ public class NetworkManagementService extends INetworkManagementService.Stub
        public static final int DnsProxyQueryResult       = 222;
        public static final int ClatdStatusResult         = 223;
        public static final int GetMarkResult             = 225;
        public static final int V6RtrAdvResult            = 226;
        public static final int V6RtrAdvResult            = 227;

        public static final int InterfaceChange           = 600;
        public static final int BandwidthControl          = 601;
@@ -596,11 +598,9 @@ public class NetworkManagementService extends INetworkManagementService.Stub
        Slog.d(TAG, "removeUpstreamInterface(" + iface + ")");

        try {
            final Command cmd = new Command("tether", "interface", "add_upstream");
            final Command cmd = new Command("tether", "interface", "remove_upstream");
            cmd.appendArg(iface);
            mConnector.execute(cmd);

            mConnector.execute(cmd);
        } catch (NativeDaemonConnectorException e) {
            throw new IllegalStateException("Cannot remove upstream interface");
        }
+11 −7
Original line number Diff line number Diff line
@@ -692,12 +692,16 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
                        mUpstreamIfaceTypes.add(HIPRI_TYPE);
                    }
                }
            }
                /* if DUN is still available, make that a priority */
                if (mUpstreamIfaceTypes.contains(DUN_TYPE)) {
                    mPreferredUpstreamMobileApn = ConnectivityManager.TYPE_MOBILE_DUN;
                } else {
                    mPreferredUpstreamMobileApn = ConnectivityManager.TYPE_MOBILE_HIPRI;
                }
            } else {
                /* dun_required is not set, fall back to HIPRI in that case */
                mPreferredUpstreamMobileApn = ConnectivityManager.TYPE_MOBILE_HIPRI;
            }
        }
    }

@@ -1313,8 +1317,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
                Log.d(TAG, "adding v6 interface " + iface);
                try {
                    service.addUpstreamV6Interface(iface);
                } catch (Exception e) {
                    Log.e(TAG, "Unable to append v6 upstream interface", e);
                } catch (RemoteException e) {
                    Log.e(TAG, "Unable to append v6 upstream interface");
                }
            }

@@ -1325,8 +1329,8 @@ public class Tethering extends INetworkManagementEventObserver.Stub {
                Log.d(TAG, "removing v6 interface " + iface);
                try {
                    service.removeUpstreamV6Interface(iface);
                } catch (Exception e) {
                    Log.e(TAG, "Unable to remove v6 upstream interface", e);
                } catch (RemoteException e) {
                    Log.e(TAG, "Unable to remove v6 upstream interface");
                }
            }