From 271bb3a17c92f243afbbb46ed16819e7497004be Mon Sep 17 00:00:00 2001 From: epicX Date: Wed, 30 Dec 2020 01:03:18 +0530 Subject: [PATCH] reduced the checkforapp function call to reduce unwanted log info Change-Id: I79ef116989f68333292d3518dcb3ea08be98b8ef --- gui/action.cpp | 44 +++---------------------------- gui/theme/common/landscape.xml | 7 ----- gui/theme/common/portrait.xml | 7 ----- gui/theme/common/watch.xml | 7 ----- twrp-functions.cpp | 47 ++++++++++++++++++++++++++++++++++ twrp-functions.hpp | 1 + twrp.cpp | 2 ++ 7 files changed, 54 insertions(+), 61 deletions(-) diff --git a/gui/action.cpp b/gui/action.cpp index 597bb614..878f9809 100755 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -1960,48 +1960,10 @@ int GUIAction::checkforapp(std::string arg __unused) operation_start("Check for TWRP App"); if (!simulate) { - string sdkverstr = TWFunc::System_Property_Get("ro.build.version.sdk"); - int sdkver = 0; - if (!sdkverstr.empty()) { - sdkver = atoi(sdkverstr.c_str()); - } - if (sdkver <= 13) { - if (sdkver == 0) - LOGINFO("Unable to read sdk version from build prop\n"); - else - LOGINFO("SDK version too low for TWRP app (%i < 14)\n", sdkver); - DataManager::SetValue("tw_app_install_status", 1); // 0 = no status, 1 = not installed, 2 = already installed or do not install - goto exit; - } - if (TWFunc::Is_TWRP_App_In_System()) { - DataManager::SetValue("tw_app_install_status", 2); // 0 = no status, 1 = not installed, 2 = already installed or do not install - goto exit; - } - if (PartitionManager.Mount_By_Path("/data", false)) { - const char parent_path[] = "/data/app"; - const char app_prefix[] = "me.twrp.twrpapp-"; - DIR *d = opendir(parent_path); - if (d) { - struct dirent *p; - while ((p = readdir(d))) { - if (p->d_type != DT_DIR || strlen(p->d_name) < strlen(app_prefix) || strncmp(p->d_name, app_prefix, strlen(app_prefix))) - continue; - closedir(d); - LOGINFO("App found at '%s/%s'\n", parent_path, p->d_name); - DataManager::SetValue("tw_app_install_status", 2); // 0 = no status, 1 = not installed, 2 = already installed or do not install - goto exit; - } - closedir(d); - } - } else { - LOGINFO("Data partition cannot be mounted during app check\n"); - DataManager::SetValue("tw_app_install_status", 2); // 0 = no status, 1 = not installed, 2 = already installed or do not install - } + TWFunc::checkforapp(); } else simulate_progress_bar(); - LOGINFO("App not installed\n"); - DataManager::SetValue("tw_app_install_status", 1); // 0 = no status, 1 = not installed, 2 = already installed -exit: + operation_end(0); return 0; } @@ -2114,6 +2076,7 @@ int GUIAction::installapp(std::string arg __unused) } else simulate_progress_bar(); exit: + TWFunc::checkforapp(); operation_end(0); return 0; } @@ -2167,6 +2130,7 @@ int GUIAction::uninstalltwrpsystemapp(std::string arg __unused) } else simulate_progress_bar(); exit: + TWFunc::checkforapp(); operation_end(0); return 0; } diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml index f8b5a950..babf5b4e 100755 --- a/gui/theme/common/landscape.xml +++ b/gui/theme/common/landscape.xml @@ -3593,13 +3593,6 @@ - - - advanced1 - - - -