internal void OpenApp(string packageName, bool isCheckForGrm = true) { AppIconModel appIcon = this.GetAppIcon(packageName); if (appIcon == null) { return; } if ((uint)appIcon.AppIncompatType > 0U & isCheckForGrm && !this.mParentWindow.mTopBar.mAppTabButtons.mDictTabs.ContainsKey(packageName)) { GrmHandler.HandleCompatibility(appIcon.PackageName, this.mParentWindow.mVmName); } else { this.mParentWindow.mTopBar.mAppTabButtons.AddAppTab(appIcon.AppName, appIcon.PackageName, appIcon.ActivityName, appIcon.ImageName, false, true, false); this.mParentWindow.mAppHandler.SwitchWhenPackageNameRecieved = appIcon.PackageName; this.mParentWindow.mAppHandler.SendRunAppRequestAsync(appIcon.PackageName, "", false); if (appIcon.IsRedDotVisible) { appIcon.IsRedDotVisible = false; HomeAppManager.AddPackageInRedDotShownRegistry(appIcon.PackageName); } HomeAppManager.SendStats(appIcon.PackageName); } }
private void Button_Click(object sender, RoutedEventArgs e) { Logger.Info("Clicked app icon, package name {0}", (object)this.mAppIconModel.PackageName); if (this.mUnInstallTabButton.IsMouseOver) { this.UninstallButtonClicked(); } else if (this.mErrorGrid.IsVisible) { this.mErrorGrid.Visibility = Visibility.Hidden; if (this.mAppIconModel.IsDownLoadingFailed) { this.mDownloader?.DownloadApk(this.mAppIconModel.ApkUrl, this.mAppIconModel.PackageName, false, false, ""); } else { if (!this.mAppIconModel.IsInstallingFailed) { return; } this.mDownloader?.InstallApk(this.mAppIconModel.PackageName, this.mAppIconModel.ApkFilePath, false, false, ""); } } else { if (this.mAppIconModel.IsDownloading) { return; } if (this.mAppIconModel.IsInstalling) { if (this.mDownloader != null) { return; } this.ParentWindow.mWelcomeTab.mFrontendPopupControl.Init(this.mAppIconModel.PackageName, this.mAppIconModel.AppName, PlayStoreAction.OpenApp, false); } else if (this.mAppIconModel.IsRerollIcon) { this.HandleRerollClick(); } else if (this.mAppIconModel.IsAppSuggestionActive) { this.HandleAppSuggestionClick(); if (!this.mAppIconModel.IsRedDotVisible) { return; } this.mAppIconModel.IsRedDotVisible = false; HomeAppManager.AddPackageInRedDotShownRegistry(this.mAppIconModel.PackageName); } else { if (string.IsNullOrEmpty(this.mAppIconModel.PackageName)) { return; } if (string.Equals(this.mAppIconModel.PackageName, "help_center", StringComparison.InvariantCulture)) { this.ParentWindow.mTopBar.mAppTabButtons.AddWebTab(BlueStacksUIUtils.GetHelpCenterUrl(), "STRING_FEEDBACK", "help_center", true, "STRING_FEEDBACK", false); } else if (string.Equals(this.mAppIconModel.PackageName, "instance_manager", StringComparison.InvariantCulture)) { BlueStacksUIUtils.LaunchMultiInstanceManager(); } else if (string.Equals(this.mAppIconModel.PackageName, "macro_recorder", StringComparison.InvariantCulture)) { this.ParentWindow.mCommonHandler.ShowMacroRecorderWindow(); } else { this.ParentWindow.mWelcomeTab.mHomeAppManager.OpenApp(this.mAppIconModel.PackageName, true); } } } }