@@ -442,9 +442,9 @@ private void resolveRestrictions() {
442
442
}
443
443
444
444
if (appRestrictions .containsKey ("frequency" )) {
445
- editor .putString ("timeInventory" , appRestrictions .getString ("frequency" ));
445
+ editor .putString ("timeInventory" , appRestrictions .getString ("frequency" , "Week" ));
446
446
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" ));
448
448
editor .apply ();
449
449
}
450
450
@@ -471,11 +471,21 @@ private void resolveRestrictions() {
471
471
472
472
try {
473
473
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 );
479
489
480
490
AgentLog .e ("EMM - Receive the following configuration '" + jsonServerConfig .toString ());
481
491
0 commit comments