LineageSettingsService: prevent setting net.hostname to null
If the user did not set a custom hostname, the settings service will set net.hostname to null. Only set net.hostname if the user actually set a custom hostname. Change-Id: Ie9cc84e5e8c9468a7e698896e2b21c14a37ebffc Signed-off-by: Alexander Martinz <amartinz@shiftphones.com>
This commit is contained in:
@@ -45,7 +45,9 @@ public class LineageSettingsService extends LineageSystemService {
|
||||
// Load custom hostname
|
||||
String hostname = LineageSettings.Secure.getString(mContext.getContentResolver(),
|
||||
LineageSettings.Secure.DEVICE_HOSTNAME);
|
||||
SystemProperties.set("net.hostname", hostname);
|
||||
if (hostname != null) {
|
||||
SystemProperties.set("net.hostname", hostname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user