Program: 33120
Project: 33120
Buggy source:
/** 
 * Update Device parameters such as username, password, domain, etc
 * @param params Parameters for the Device entity (prefer using the string constants shown below, i.e. RCDevice.ParameterKeys.*, instead of using stringslike 'signaling-secure', etc. Possible keys: <br> <b>RCDevice.ParameterKeys.SIGNALING_USERNAME</b>: Identity for the client, like <i>'bob'</i> (mandatory) <br> <b>RCDevice.ParameterKeys.SIGNALING_PASSWORD</b>: Password for the client. Be VERY careful to securely handle this inside your App. Never store it statically and in cleartext form in your App before submitting to Google Play Store as you run the risk of any of the folks downloading it figuring it out your credentials <br> <b>RCDevice.ParameterKeys.SIGNALING_DOMAIN</b>: Restcomm instance to use, like <i>'cloud.restcomm.com'</i>. Don't pass this parameters (or leave empty) for registrar-less mode<br> <b>RCDevice.ParameterKeys.MEDIA_ICE_URL</b>: ICE url to use, like <i>'https://turn.provider.com/turn'</i> (mandatory) <br> <b>RCDevice.ParameterKeys.MEDIA_ICE_USERNAME</b>: ICE username for authentication (mandatory) <br> <b>RCDevice.ParameterKeys.MEDIA_ICE_PASSWORD</b>: ICE password for authentication (mandatory). Be VERY careful to securely handle this inside your App. Never store it statically and in cleartext form in your App before submitting to Google Play Store as you run the risk of any of the folks downloading it figuring it out your credentials <br> <b>RCDevice.ParameterKeys.MEDIA_ICE_DOMAIN</b>: ICE Domain to be used in the ICE configuration URL (mandatory) <br> <b>RCDevice.ParameterKeys.SIGNALING_SECURE_ENABLED</b>: Should signaling traffic be encrypted? If this is the case, then a key pair is generated when signaling facilities are initialized and added to a custom keystore. Also, added to this custom keystore are all the trusted certificates from the System Wide Android CA Store, so that we properly accept only legit server certificates. If not passed (or false) signaling is cleartext (optional) <br> <b>RCDevice.ParameterKeys.MEDIA_TURN_ENABLED</b>: Should TURN be enabled for webrtc media? (optional) <br> <b>RCDevice.ParameterKeys.SIGNALING_LOCAL_PORT</b>: Local port to use for signaling (optional) <br> //push notification keys <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME</b>: name of the client application <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL</b>: account's email <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD </b>: password for an account <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT</b>: true if we want to enable push on server for the account, otherwise false <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_PUSH_DOMAIN</b>: domain for the push notifications; for example: push.restcomm.com <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_HTTP_DOMAIN</b>: Restcomm HTTP domain, like 'cloud.restcomm.com' <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY</b>: server hash key for created application in firebase cloud messaging <b>RCDevice.ParameterKeys.PUSH_NOTIFICATION_TIMEOUT_MESSAGING_SERVICE</b>: RCDevice will have timer introduced for closing because of the message background logic this is introduced in the design. The timer by default will be 5 seconds; It can be changed by sending parameter with value (in milliseconds)
 * @see RCDevice
 * @return right now this is more of a placeholder and always returns true
 */
public boolean updateParams(HashMap<String,Object> params){
  this.parameters=JainSipConfiguration.mergeParameters(this.parameters,params);
  if (storageManagerPreferences == null) {
    storageManagerPreferences=new StorageManagerPreferences(this);
  }
  StorageUtils.saveParams(storageManagerPreferences,parameters);
  signalingClient.reconfigure(params);
  registerForPush(true);
  return true;
}

Fixed version (ground truth):
/** 
 * Update Device parameters such as username, password, domain, etc
 * @param params Parameters for the Device entity (prefer using the string constants shown below, i.e. RCDevice.ParameterKeys.*, instead of using stringslike 'signaling-secure', etc. Possible keys: <br> <b>RCDevice.ParameterKeys.SIGNALING_USERNAME</b>: Identity for the client, like <i>'bob'</i> (mandatory) <br> <b>RCDevice.ParameterKeys.SIGNALING_PASSWORD</b>: Password for the client. Be VERY careful to securely handle this inside your App. Never store it statically and in cleartext form in your App before submitting to Google Play Store as you run the risk of any of the folks downloading it figuring it out your credentials <br> <b>RCDevice.ParameterKeys.SIGNALING_DOMAIN</b>: Restcomm instance to use, like <i>'cloud.restcomm.com'</i>. Don't pass this parameters (or leave empty) for registrar-less mode<br> <b>RCDevice.ParameterKeys.MEDIA_ICE_URL</b>: ICE url to use, like <i>'https://turn.provider.com/turn'</i> (mandatory) <br> <b>RCDevice.ParameterKeys.MEDIA_ICE_USERNAME</b>: ICE username for authentication (mandatory) <br> <b>RCDevice.ParameterKeys.MEDIA_ICE_PASSWORD</b>: ICE password for authentication (mandatory). Be VERY careful to securely handle this inside your App. Never store it statically and in cleartext form in your App before submitting to Google Play Store as you run the risk of any of the folks downloading it figuring it out your credentials <br> <b>RCDevice.ParameterKeys.MEDIA_ICE_DOMAIN</b>: ICE Domain to be used in the ICE configuration URL (mandatory) <br> <b>RCDevice.ParameterKeys.SIGNALING_SECURE_ENABLED</b>: Should signaling traffic be encrypted? If this is the case, then a key pair is generated when signaling facilities are initialized and added to a custom keystore. Also, added to this custom keystore are all the trusted certificates from the System Wide Android CA Store, so that we properly accept only legit server certificates. If not passed (or false) signaling is cleartext (optional) <br> <b>RCDevice.ParameterKeys.MEDIA_TURN_ENABLED</b>: Should TURN be enabled for webrtc media? (optional) <br> <b>RCDevice.ParameterKeys.SIGNALING_LOCAL_PORT</b>: Local port to use for signaling (optional) <br> //push notification keys <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_APPLICATION_NAME</b>: name of the client application <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_EMAIL</b>: account's email <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ACCOUNT_PASSWORD </b>: password for an account <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT</b>: true if we want to enable push on server for the account, otherwise false <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_PUSH_DOMAIN</b>: domain for the push notifications; for example: push.restcomm.com <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_HTTP_DOMAIN</b>: Restcomm HTTP domain, like 'cloud.restcomm.com' <b>RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_FCM_SERVER_KEY</b>: server hash key for created application in firebase cloud messaging <b>RCDevice.ParameterKeys.PUSH_NOTIFICATION_TIMEOUT_MESSAGING_SERVICE</b>: RCDevice will have timer introduced for closing because of the message background logic this is introduced in the design. The timer by default will be 5 seconds; It can be changed by sending parameter with value (in milliseconds)
 * @see RCDevice
 * @return right now this is more of a placeholder and always returns true
 */
public boolean updateParams(HashMap<String,Object> params){
  this.parameters=JainSipConfiguration.mergeParameters(this.parameters,params);
  if (storageManagerPreferences == null) {
    storageManagerPreferences=new StorageManagerPreferences(this);
  }
  StorageUtils.saveParams(storageManagerPreferences,parameters);
  signalingClient.reconfigure(params);
  if ((Boolean)parameters.get(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT)) {
    registerForPush(true);
  }
  return true;
}