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

Commit de8383ca authored by Robert Greenwalt's avatar Robert Greenwalt
Browse files

Set net.hostname sys property to our unique ID.

Give us a default name networking wise so that wifi (at least) can use it.

Bug:2327089
parent 8d528c85
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -180,6 +180,15 @@ public class ConnectivityService extends IConnectivityManager.Stub {

    private ConnectivityService(Context context) {
        if (DBG) Log.v(TAG, "ConnectivityService starting up");

        // setup our unique device name
        String id = Settings.Secure.getString(context.getContentResolver(),
                Settings.Secure.ANDROID_ID);
        if (id != null && id.length() > 0) {
            String name = new String("android_").concat(id);
            SystemProperties.set("net.hostname", name);
        }

        mContext = context;
        mNetTrackers = new NetworkStateTracker[
                ConnectivityManager.MAX_NETWORK_TYPE+1];