Merge "gui: bump theme version to 2" into android-7.1
diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp
index 362d9cb..4d1ce5b 100644
--- a/bootloader_message/bootloader_message.cpp
+++ b/bootloader_message/bootloader_message.cpp
@@ -39,7 +39,7 @@
 
 static std::string misc_blkdev;
 
-void set_misc_device(const char* type, const char* name) {
+void set_misc_device(std::string name) {
     misc_blkdev = name;
 }
 
diff --git a/bootloader_message/include/bootloader_message/bootloader_message.h b/bootloader_message/include/bootloader_message/bootloader_message.h
index b4d3604..52d7331 100644
--- a/bootloader_message/include/bootloader_message/bootloader_message.h
+++ b/bootloader_message/include/bootloader_message/bootloader_message.h
@@ -86,7 +86,7 @@
 bool read_wipe_package(std::string* package_data, size_t size, std::string* err);
 bool write_wipe_package(const std::string& package_data, std::string* err);
 
-void set_misc_device(const char* type, const char* name);
+void set_misc_device(std::string name);
 void get_args(int *argc, char ***argv);
 
 #else
diff --git a/gui/button.cpp b/gui/button.cpp
index 45614e4..a9b02a3 100644
--- a/gui/button.cpp
+++ b/gui/button.cpp
@@ -85,7 +85,7 @@
 
 	mHighlightColor = LoadAttrColor(FindNode(node, "highlight"), "color", &hasHighlightColor);
 
-	int x, y, w, h;
+	int x = 0, y = 0, w = 0, h = 0;
 	TextPlacement = TOP_LEFT;
 	if (mButtonImg) {
 		mButtonImg->GetRenderPos(x, y, w, h);
diff --git a/gui/hardwarekeyboard.cpp b/gui/hardwarekeyboard.cpp
index f831727..68be906 100644
--- a/gui/hardwarekeyboard.cpp
+++ b/gui/hardwarekeyboard.cpp
@@ -37,6 +37,7 @@
 #include "../common.h"
 }
 
+#include "../twcommon.h"
 #include "objects.hpp"
 #include <linux/input.h>
 
@@ -361,7 +362,7 @@
 
 #ifdef _EVENT_LOGGING
 		default:
-			LOGE("Unmapped keycode: %i\n", key_code);
+			LOGERR("Unmapped keycode: %i\n", key_code);
 			break;
 #endif
 	}
@@ -384,7 +385,7 @@
 int HardwareKeyboard::KeyDown(int key_code)
 {
 #ifdef _EVENT_LOGGING
-	LOGE("HardwareKeyboard::KeyDown %i\n", key_code);
+	LOGERR("HardwareKeyboard::KeyDown %i\n", key_code);
 #endif
 	key_code = TranslateKeyCode(key_code);
 	mPressedKeys.insert(key_code);
@@ -410,7 +411,7 @@
 int HardwareKeyboard::KeyUp(int key_code)
 {
 #ifdef _EVENT_LOGGING
-	LOGE("HardwareKeyboard::KeyUp %i\n", key_code);
+	LOGERR("HardwareKeyboard::KeyUp %i\n", key_code);
 #endif
 	key_code = TranslateKeyCode(key_code);
 	std::set<int>::iterator itr = mPressedKeys.find(key_code);
@@ -424,7 +425,7 @@
 int HardwareKeyboard::KeyRepeat()
 {
 #ifdef _EVENT_LOGGING
-	LOGE("HardwareKeyboard::KeyRepeat: %i\n", mLastKeyChar);
+	LOGERR("HardwareKeyboard::KeyRepeat: %i\n", mLastKeyChar);
 #endif
 	if (mLastKeyChar)
 		PageManager::NotifyCharInput(mLastKeyChar);
diff --git a/twrp.cpp b/twrp.cpp
index ff40eb1..88df452 100644
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -176,11 +176,9 @@
 		TWPartition* misc = PartitionManager.Find_Partition_By_Path("/misc");
 		if (misc != NULL) {
 			if (misc->Current_File_System == "emmc") {
-				set_misc_device("emmc", misc->Actual_Block_Device.c_str());
-			} else if (misc->Current_File_System == "mtd") {
-				set_misc_device("mtd", misc->MTD_Name.c_str());
+				set_misc_device(misc->Actual_Block_Device);
 			} else {
-				LOGERR("Unknown file system for /misc\n");
+				LOGERR("Only emmc /misc is supported\n");
 			}
 		}
 		get_args(&argc, &argv);