diff options
-rw-r--r-- | gui/theme/landscape_hdpi/ui.xml | 5 | ||||
-rw-r--r-- | gui/theme/landscape_mdpi/ui.xml | 5 | ||||
-rw-r--r-- | gui/theme/portrait_hdpi/ui.xml | 5 | ||||
-rw-r--r-- | gui/theme/portrait_mdpi/ui.xml | 5 | ||||
-rw-r--r-- | toybox/Android.mk | 2 | ||||
-rw-r--r-- | updater/install.cpp | 28 |
6 files changed, 49 insertions, 1 deletions
diff --git a/gui/theme/landscape_hdpi/ui.xml b/gui/theme/landscape_hdpi/ui.xml index 39f626f61..f1bd647f2 100644 --- a/gui/theme/landscape_hdpi/ui.xml +++ b/gui/theme/landscape_hdpi/ui.xml @@ -430,6 +430,11 @@ <action function="key">back</action> </button> + <fill color="%background_color%"> + <condition var1="tw_busy" var2="1"/> + <placement x="0" y="%navbar_y%" w="%screen_width%" h="%navbar_height%"/> + </fill> + <action> <touch key="power"/> <action function="togglebacklight"/> diff --git a/gui/theme/landscape_mdpi/ui.xml b/gui/theme/landscape_mdpi/ui.xml index cde1a5b76..cf30d898d 100644 --- a/gui/theme/landscape_mdpi/ui.xml +++ b/gui/theme/landscape_mdpi/ui.xml @@ -430,6 +430,11 @@ <action function="key">back</action> </button> + <fill color="%background_color%"> + <condition var1="tw_busy" var2="1"/> + <placement x="0" y="%navbar_y%" w="%screen_width%" h="%navbar_height%"/> + </fill> + <action> <touch key="power"/> <action function="togglebacklight"/> diff --git a/gui/theme/portrait_hdpi/ui.xml b/gui/theme/portrait_hdpi/ui.xml index 0545b3f6b..3f3102a5e 100644 --- a/gui/theme/portrait_hdpi/ui.xml +++ b/gui/theme/portrait_hdpi/ui.xml @@ -334,6 +334,11 @@ <action function="key">back</action> </button> + <fill color="%background_color%"> + <condition var1="tw_busy" var2="1"/> + <placement x="0" y="%navbar_y%" w="%screen_width%" h="%navbar_height%"/> + </fill> + <action> <touch key="power"/> <action function="togglebacklight"/> diff --git a/gui/theme/portrait_mdpi/ui.xml b/gui/theme/portrait_mdpi/ui.xml index 061d46b0e..f41ff79cb 100644 --- a/gui/theme/portrait_mdpi/ui.xml +++ b/gui/theme/portrait_mdpi/ui.xml @@ -334,6 +334,11 @@ <action function="key">back</action> </button> + <fill color="%background_color%"> + <condition var1="tw_busy" var2="1"/> + <placement x="0" y="%navbar_y%" w="%screen_width%" h="%navbar_height%"/> + </fill> + <action> <touch key="power"/> <action function="togglebacklight"/> diff --git a/toybox/Android.mk b/toybox/Android.mk index 5b2f32fd7..c88f360f5 100644 --- a/toybox/Android.mk +++ b/toybox/Android.mk @@ -532,7 +532,7 @@ ALL_TOOLS += \ vconfig \ watch \ xxd -ifeq ($(shell test $(PLATFORM_SDK_VERSION) -lt 27; echo $$?),0) +ifeq ($(shell test $(PLATFORM_SDK_VERSION) -le 27; echo $$?),0) ALL_TOOLS += \ getprop \ xzcat diff --git a/updater/install.cpp b/updater/install.cpp index 741d97014..2266127f2 100644 --- a/updater/install.cpp +++ b/updater/install.cpp @@ -97,6 +97,34 @@ static void uiPrint(State* state, const std::string& buffer) { LOG(INFO) << buffer; } +static bool is_dir(const std::string& dirpath) { + struct stat st; + return stat(dirpath.c_str(), &st) == 0 && S_ISDIR(st.st_mode); +} + +// Create all parent directories of name, if necessary. +static bool make_parents(const std::string& name) { + size_t prev_end = 0; + while (prev_end < name.size()) { + size_t next_end = name.find('/', prev_end + 1); + if (next_end == std::string::npos) { + break; + } + std::string dir_path = name.substr(0, next_end); + if (!is_dir(dir_path)) { + int result = mkdir(dir_path.c_str(), 0700); + if (result != 0) { + PLOG(ERROR) << "failed to mkdir " << dir_path << " when make parents for " << name; + return false; + } + + LOG(INFO) << "created [" << dir_path << "]"; + } + prev_end = next_end; + } + return true; +} + void uiPrintf(State* _Nonnull state, const char* _Nonnull format, ...) { std::string error_msg; |