internal static void HandleUsageNotification(JObject resJson, string vmName) { try { string result = ""; string jsonObjectString = JSONUtils.GetJSONObjectString(AppUsageTimer.GetRealtimeDictionary()); JObject.Parse(resJson["bluestacks_notification"][(object)"payload"].ToString()).AssignStringIfContains("handler", ref result); string url = WebHelper.GetServerHost() + "/v2/" + result; Dictionary <string, string> dictionary = new Dictionary <string, string>() { ["oem"] = "bgp", ["client_ver"] = RegistryManager.Instance.ClientVersion, ["engine_ver"] = RegistryManager.Instance.Version, ["guid"] = RegistryManager.Instance.UserGuid, ["locale"] = RegistryManager.Instance.UserSelectedLocale, ["partner"] = RegistryManager.Instance.Partner, ["campaignMD5"] = RegistryManager.Instance.CampaignMD5 }; if (!string.IsNullOrEmpty(RegistryManager.Instance.RegisteredEmail)) { dictionary["email"] = RegistryManager.Instance.RegisteredEmail; } dictionary["usage_data"] = jsonObjectString; if (!dictionary.ContainsKey("current_app")) { dictionary.Add("current_app", BlueStacksUIUtils.DictWindows[vmName].mTopBar.mAppTabButtons.SelectedTab.PackageName); } else { dictionary["current_app"] = BlueStacksUIUtils.DictWindows[vmName].mTopBar.mAppTabButtons.SelectedTab.PackageName; } Dictionary <string, string> data = dictionary; string empty = string.Empty; Logger.Info("real time app usage response:" + BstHttpClient.Post(url, data, (Dictionary <string, string>)null, false, empty, 0, 1, 0, false, "bgp")); } catch (Exception ex) { Logger.Error("Exception in handling usage notification" + ex.ToString()); } }