void updateRequestWithV1Params ( JSONObject requestObj ) { try { SystemObserver . UniqueId hardwareID = getHardwareID ( ) ; if ( ! isNullOrEmptyOrBlank ( hardwareID . getId ( ) ) ) { requestObj . put ( Defines . Jsonkey . HardwareID . getKey ( ) , hardwareID . getId ( ) ) ; requestObj . put ( Defines . Jsonkey . IsHardwareIDReal . getKey ( ) , hardwareID . isReal ( ) ) ; } String brandName = SystemObserver . getPhoneBrand ( ) ; if ( ! isNullOrEmptyOrBlank ( brandName ) ) { requestObj . put ( Defines . Jsonkey . Brand . getKey ( ) , brandName ) ; } String modelName = SystemObserver . getPhoneModel ( ) ; if ( ! isNullOrEmptyOrBlank ( modelName ) ) { requestObj . put ( Defines . Jsonkey . Model . getKey ( ) , modelName ) ; } DisplayMetrics displayMetrics = SystemObserver . getScreenDisplay ( context_ ) ; requestObj . put ( Defines . Jsonkey . ScreenDpi . getKey ( ) , displayMetrics . densityDpi ) ; requestObj . put ( Defines . Jsonkey . ScreenHeight . getKey ( ) , displayMetrics . heightPixels ) ; requestObj . put ( Defines . Jsonkey . ScreenWidth . getKey ( ) , displayMetrics . widthPixels ) ; requestObj . put ( Defines . Jsonkey . WiFi . getKey ( ) , SystemObserver . getWifiConnected ( context_ ) ) ; requestObj . put ( Defines . Jsonkey . UIMode . getKey ( ) , SystemObserver . getUIMode ( context_ ) ) ; String osName = SystemObserver . getOS ( ) ; if ( ! isNullOrEmptyOrBlank ( osName ) ) { requestObj . put ( Defines . Jsonkey . OS . getKey ( ) , osName ) ; } requestObj . put ( Defines . Jsonkey . OSVersion . getKey ( ) , SystemObserver . getOSVersion ( ) ) ; String countryCode = SystemObserver . getISO2CountryCode ( ) ; if ( ! TextUtils . isEmpty ( countryCode ) ) { requestObj . put ( Defines . Jsonkey . Country . getKey ( ) , countryCode ) ; } String languageCode = SystemObserver . getISO2LanguageCode ( ) ; if ( ! TextUtils . isEmpty ( languageCode ) ) { requestObj . put ( Defines . Jsonkey . Language . getKey ( ) , languageCode ) ; } String localIpAddr = SystemObserver . getLocalIPAddress ( ) ; if ( ( ! TextUtils . isEmpty ( localIpAddr ) ) ) { requestObj . put ( Defines . Jsonkey . LocalIP . getKey ( ) , localIpAddr ) ; } } catch ( JSONException ignore ) { } }
Update the given server request JSON with device params