question: public void sendRegistrationId ( ) throws AndroidAgentException { DeviceInfo deviceInfo = new DeviceInfo ( getContext ( ) ) ; DeviceInfoPayload deviceInfoPayload = new DeviceInfoPayload ( getContext ( ) ) ; deviceInfoPayload . build ( ) ; String replyPayload = deviceInfoPayload . getDeviceInfoPayload ( ) ; String ipSaved = Constants . DEFAULT_HOST ; String prefIP = Preference . getString ( getContext ( ) , Constants . PreferenceFlag . IP ) ; if ( prefIP != null ) { ipSaved = prefIP ; } if ( ipSaved != null && ! ipSaved . isEmpty ( ) ) { ServerConfig utils = new ServerConfig ( ) ; utils . setServerIP ( ipSaved ) ; String url = utils . getAPIServerURL ( getContext ( ) ) + Constants . DEVICE_ENDPOINT + deviceInfo . getDeviceId ( ) ; CommonUtils . callSecuredAPI ( getContext ( ) , url , org . wso2 . emm . agent . proxy . utils . Constants . HTTP_METHODS . PUT , replyPayload , GCMRegistrationManager . this , Constants . GCM_REGISTRATION_ID_SEND_CODE ) ; } else { Log . e ( TAG , "There is no valid IP to contact the server" ) ; } }
target:  This is used to send the registration Id to MDM server so that the server can use it as a reference to identify the device when sending messages to Google server.