platform/frameworks/opt/net/wifi / service/java/com/android/server/wifi/p2p/WifiP2pServiceImpl.java
private String getPersistedDeviceName(){
String deviceName = mFrameworkFacade.getStringSetting(mContext,
Settings.Global.WIFI_P2P_DEVICE_NAME);if(deviceName == null){// We use the 4 digits of the ANDROID_ID to have a friendly// default that has low likelihood of collision with a peer
String id = mFrameworkFacade.getSecureStringSetting(mContext,
Settings.Secure.ANDROID_ID);return"Android_"+ id.substring(0,4);}return deviceName;}
修改如下:
import android.os.SystemProperties;private String getPersistedDeviceName(){
String deviceName = SystemProperties.get("ro.odm.lenovo.series","");if(deviceName.length()==0){// We use the 4 digits of the ANDROID_ID to have a friendly// default that has low likelihood of collision with a peer
String id = mFrameworkFacade.getSecureStringSetting(mContext,
Settings.Secure.ANDROID_ID);return"Android_"+ id.substring(0,4);}return deviceName;}