Use /twres instead of /res for theme resources

AOSP and other ROM trees now do a rm -rf of the res folder during
the ramdisk creation process that removes the TWRP resources.
Using /twres instead of /res works around this issue making TWRP
more compatible with AOSP and other build trees.

Change-Id: I0d4c7e06ca381ac5aa0069b6f2b8c47f7dec49e7
This commit is contained in:
Dees Troy
2015-01-20 19:21:04 +00:00
committed by Ethan Yonker
parent d9ff3c5dd0
commit 3454ade92d
11 changed files with 49 additions and 38 deletions
+4 -3
View File
@@ -644,11 +644,11 @@ int PageSet::CheckInclude(ZipArchive* package, xml_document<> *parentDoc)
if (!attr)
break;
LOGINFO("PageSet::CheckInclude loading filename: '%s'\n", filename.c_str());
if (!package) {
// We can try to load the XML directly...
filename = "/res/";
filename = TWRES;
filename += attr->value();
LOGINFO("PageSet::CheckInclude loading filename: '%s'\n", filename.c_str());
struct stat st;
if(stat(filename.c_str(),&st) != 0) {
LOGERR("Unable to locate '%s'\n", filename.c_str());
@@ -668,6 +668,7 @@ int PageSet::CheckInclude(ZipArchive* package, xml_document<> *parentDoc)
close(fd);
} else {
filename += attr->value();
LOGINFO("PageSet::CheckInclude loading filename: '%s'\n", filename.c_str());
const ZipEntry* ui_xml = mzFindZipEntry(package, filename.c_str());
if (ui_xml == NULL)
{
@@ -1094,7 +1095,7 @@ int PageManager::ReloadPackage(std::string name, std::string package)
if (LoadPackage(name, package, "main") != 0)
{
LOGERR("Failed to load package.\n");
LOGERR("Failed to load package '%s'.\n", package.c_str());
mPageSets.insert(std::pair<std::string, PageSet*>(name, set));
return -1;
}