@@ -120,6 +120,7 @@ public class WifiStateMachine extends StateMachine {
120120 private ConnectivityManager mCm ;
121121
122122 private final boolean mP2pSupported ;
123+ private final String mPrimaryDeviceType ;
123124
124125 /* Scan results handling */
125126 private List <ScanResult > mScanResults ;
@@ -590,6 +591,9 @@ public WifiStateMachine(Context context, String wlanInterface) {
590591 mBackgroundScanSupported = mContext .getResources ().getBoolean (
591592 com .android .internal .R .bool .config_wifi_background_scan_support );
592593
594+ mPrimaryDeviceType = mContext .getResources ().getString (
595+ com .android .internal .R .string .config_wifi_p2p_device_type );
596+
593597 mContext .registerReceiver (
594598 new BroadcastReceiver () {
595599 @ Override
@@ -2214,6 +2218,37 @@ public void enter() {
22142218 if (DBG ) log (getName () + "\n " );
22152219 EventLog .writeEvent (EVENTLOG_WIFI_STATE_CHANGED , getName ());
22162220 }
2221+
2222+ private void initializeWpsDetails () {
2223+ String detail ;
2224+ detail = SystemProperties .get ("ro.product.name" , "" );
2225+ if (!mWifiNative .setDeviceName (detail )) {
2226+ loge ("Failed to set device name " + detail );
2227+ }
2228+ detail = SystemProperties .get ("ro.product.manufacturer" , "" );
2229+ if (!mWifiNative .setManufacturer (detail )) {
2230+ loge ("Failed to set manufacturer " + detail );
2231+ }
2232+ detail = SystemProperties .get ("ro.product.model" , "" );
2233+ if (!mWifiNative .setModelName (detail )) {
2234+ loge ("Failed to set model name " + detail );
2235+ }
2236+ detail = SystemProperties .get ("ro.product.model" , "" );
2237+ if (!mWifiNative .setModelNumber (detail )) {
2238+ loge ("Failed to set model number " + detail );
2239+ }
2240+ detail = SystemProperties .get ("ro.serialno" , "" );
2241+ if (!mWifiNative .setSerialNumber (detail )) {
2242+ loge ("Failed to set serial number " + detail );
2243+ }
2244+ if (!mWifiNative .setConfigMethods ("physical_display virtual_push_button keypad" )) {
2245+ loge ("Failed to set WPS config methods" );
2246+ }
2247+ if (!mWifiNative .setDeviceType (mPrimaryDeviceType )) {
2248+ loge ("Failed to set primary device type " + mPrimaryDeviceType );
2249+ }
2250+ }
2251+
22172252 @ Override
22182253 public boolean processMessage (Message message ) {
22192254 if (DBG ) log (getName () + message .toString () + "\n " );
@@ -2231,8 +2266,8 @@ public boolean processMessage(Message message) {
22312266 mLastSignalLevel = -1 ;
22322267
22332268 mWifiInfo .setMacAddress (mWifiNative .getMacAddress ());
2234-
22352269 mWifiConfigStore .initialize ();
2270+ initializeWpsDetails ();
22362271
22372272 sendSupplicantConnectionChangedBroadcast (true );
22382273 transitionTo (mDriverStartedState );
0 commit comments