summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--gui/Android.mk3
-rw-r--r--gui/action.cpp3
-rw-r--r--gui/gui.cpp8
3 files changed, 10 insertions, 4 deletions
diff --git a/gui/Android.mk b/gui/Android.mk
index 40b67d80a..19bb0bcf0 100644
--- a/gui/Android.mk
+++ b/gui/Android.mk
@@ -68,6 +68,9 @@ endif
ifeq ($(HAVE_SELINUX), true)
LOCAL_CFLAGS += -DHAVE_SELINUX
endif
+ifeq ($(TW_OEM_BUILD),true)
+ LOCAL_CFLAGS += -DTW_OEM_BUILD
+endif
ifeq ($(DEVICE_RESOLUTION),)
$(warning ********************************************************************************)
diff --git a/gui/action.cpp b/gui/action.cpp
index 453304ceb..9d7e482ca 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -800,7 +800,7 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
}
} else
ret_val = PartitionManager.Wipe_By_Path(arg);
-
+#ifdef TW_OEM_BUILD
if (arg == DataManager::GetSettingsStoragePath()) {
// If we wiped the settings storage path, recreate the TWRP folder and dump the settings
string Storage_Path = DataManager::GetSettingsStoragePath();
@@ -814,6 +814,7 @@ int GUIAction::doAction(Action action, int isThreaded /* = 0 */)
LOGERR("Unable to recreate TWRP folder and save settings.\n");
}
}
+#endif
}
PartitionManager.Update_System_Details();
if (ret_val)
diff --git a/gui/gui.cpp b/gui/gui.cpp
index 912899f07..b3d4fe1a0 100644
--- a/gui/gui.cpp
+++ b/gui/gui.cpp
@@ -692,7 +692,7 @@ extern "C" int gui_loadResources(void)
// unlink("/sdcard/video.last");
// rename("/sdcard/video.bin", "/sdcard/video.last");
// gRecorder = open("/sdcard/video.bin", O_CREAT | O_WRONLY);
-
+#ifndef TW_OEM_BUILD
int check = 0;
DataManager::GetValue(TW_IS_ENCRYPTED, check);
if (check)
@@ -731,14 +731,16 @@ extern "C" int gui_loadResources(void)
theme_path += "/TWRP/theme/ui.zip";
if (check || PageManager::LoadPackage("TWRP", theme_path, "main"))
{
+#endif // ifndef TW_OEM_BUILD
if (PageManager::LoadPackage("TWRP", "/res/ui.xml", "main"))
{
LOGERR("Failed to load base packages.\n");
goto error;
}
+#ifndef TW_OEM_BUILD
}
}
-
+#endif // ifndef TW_OEM_BUILD
// Set the default package
PageManager::SelectPackage("TWRP");
@@ -746,7 +748,7 @@ extern "C" int gui_loadResources(void)
return 0;
error:
- LOGERR("An internal error has occurred.\n");
+ LOGERR("An internal error has occurred: unable to load theme.\n");
gGuiInitialized = 0;
return -1;
}