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

Commit dbc0ebc5 authored by Martin Herndl's avatar Martin Herndl Committed by Ethan Chen
Browse files

ConnectivityService: set user-defined hostname

Together with I1d8302f06144dbb3e6ddba68594cc5718b4f0bb7 this enables
that feature again.

Change-Id: I015d6e183bb4bcd48f96cbd4f392c12f9b53bb53
(originally coming from commit I44e4771f4415a32fe66867d4dd90f1ad138341e1)
parent 1a2ec09c
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -726,13 +726,14 @@ public class ConnectivityService extends IConnectivityManager.Stub
        mTrackerHandler = new NetworkStateTrackerHandler(mHandlerThread.getLooper());

        // setup our unique device name
        // either to (in order): current net.hostname
        //                       DEVICE_HOSTNAME
        // either to (in order): DEVICE_HOSTNAME
        //                       current net.hostname
        //                       android-ANDROID_ID
        //                       android-r-RANDOM_NUMBER
        if (TextUtils.isEmpty(SystemProperties.get("net.hostname"))) {
        String hostname = CMSettings.Secure.getString(context.getContentResolver(),
                CMSettings.Secure.DEVICE_HOSTNAME);
        if (TextUtils.isEmpty(SystemProperties.get("net.hostname"))
                || !TextUtils.isEmpty(hostname)) {
            String id = Settings.Secure.getString(context.getContentResolver(),
                    Settings.Secure.ANDROID_ID);
            if (!TextUtils.isEmpty(hostname)) {