@@ -442,9 +442,9 @@ private void resolveRestrictions() {
442442 }
443443
444444 if (appRestrictions .containsKey ("frequency" )) {
445- editor .putString ("timeInventory" , appRestrictions .getString ("frequency" ));
445+ editor .putString ("timeInventory" , appRestrictions .getString ("frequency" , "Week" ));
446446 enterpriseFeedback (getApplicationContext (), "frequency" , "frequency option set successfully" , appRestrictions .getString ("frequency" ), KeyedAppState .SEVERITY_INFO );
447- AgentLog .e ("EMM - set frequency to " + appRestrictions .getString ("frequency" ));
447+ AgentLog .e ("EMM - set frequency to " + appRestrictions .getString ("frequency" , "Week" ));
448448 editor .apply ();
449449 }
450450
@@ -471,11 +471,21 @@ private void resolveRestrictions() {
471471
472472 try {
473473 jsonServerConfig .put ("address" , serverConfig .getString ("server_url" ));
474- jsonServerConfig .put ("tag" , serverConfig .getString ("server_tag" ));
475- jsonServerConfig .put ("login" , serverConfig .getString ("server_login" ));
476- jsonServerConfig .put ("pass" , serverConfig .getString ("server_password" ));
477- jsonServerConfig .put ("itemtype" , serverConfig .getString ("server_itemtype" ));
478- jsonServerConfig .put ("serial" , serverConfig .getString ("server_custom_asset_serial" ));
474+
475+ String tag = serverConfig .containsKey ("server_tag" ) ? serverConfig .getString ("server_tag" ) : "" ;
476+ jsonServerConfig .put ("tag" , tag );
477+
478+ String login = serverConfig .containsKey ("server_login" ) ? serverConfig .getString ("server_login" ) : "" ;
479+ jsonServerConfig .put ("login" , login );
480+
481+ String pass = serverConfig .containsKey ("server_password" ) ? serverConfig .getString ("server_password" ) : "" ;
482+ jsonServerConfig .put ("pass" , pass );
483+
484+ String itemType = serverConfig .containsKey ("server_itemtype" ) ? serverConfig .getString ("server_itemtype" ) : "Computer" ;
485+ jsonServerConfig .put ("itemtype" , itemType );
486+
487+ String serial = serverConfig .containsKey ("server_custom_asset_serial" ) ? serverConfig .getString ("server_custom_asset_serial" ) : "" ;
488+ jsonServerConfig .put ("serial" , serial );
479489
480490 AgentLog .e ("EMM - Receive the following configuration '" + jsonServerConfig .toString ());
481491
0 commit comments