Settings: Set device name from marketname if available
Change-Id: If974ac38638fca9b100008d1b5404d876faf42e2 Signed-off-by: Pranav Vashi <neobuddy89@gmail.com> Signed-off-by: Joey Huab <joey@evolution-x.org> Signed-off-by: Dmitrii <bankersenator@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@ import android.net.wifi.SoftApConfiguration;
|
||||
import android.net.wifi.WifiManager;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.SystemProperties;
|
||||
import android.provider.Settings;
|
||||
import android.text.SpannedString;
|
||||
|
||||
@@ -44,6 +45,8 @@ public class DeviceNamePreferenceController extends BasePreferenceController
|
||||
LifecycleObserver,
|
||||
OnSaveInstanceState,
|
||||
OnCreate {
|
||||
|
||||
private static final String KEY_MARKET_NAME_PROP = "ro.product.marketname";
|
||||
private static final String KEY_PENDING_DEVICE_NAME = "key_pending_device_name";
|
||||
@VisibleForTesting
|
||||
static final int RES_SHOW_DEVICE_NAME_BOOL = R.bool.config_show_device_name;
|
||||
@@ -76,11 +79,11 @@ public class DeviceNamePreferenceController extends BasePreferenceController
|
||||
}
|
||||
|
||||
private void initializeDeviceName() {
|
||||
mDeviceName = Settings.Global.getString(mContext.getContentResolver(),
|
||||
String deviceName = Settings.Global.getString(mContext.getContentResolver(),
|
||||
Settings.Global.DEVICE_NAME);
|
||||
if (mDeviceName == null) {
|
||||
mDeviceName = Build.MODEL;
|
||||
}
|
||||
if (deviceName == null)
|
||||
deviceName = Build.MODEL;
|
||||
mDeviceName = SystemProperties.get(KEY_MARKET_NAME_PROP, deviceName);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user