diff --git a/Android.mk b/Android.mk index 582741d5f..1714d16ff 100755 --- a/Android.mk +++ b/Android.mk @@ -465,6 +465,9 @@ endif ifeq ($(TW_EXCLUDE_NANO), true) LOCAL_CFLAGS += -DTW_EXCLUDE_NANO endif +ifeq ($(PB_EXCLUDE_TORCH), true) + LOCAL_CFLAGS += -DPB_EXCLUDE_TORCH +endif TWRP_REQUIRED_MODULES += \ dump_image \ diff --git a/data.cpp b/data.cpp index f2f927d0a..88d9b8942 100755 --- a/data.cpp +++ b/data.cpp @@ -1020,6 +1020,12 @@ void DataManager::SetDefaultValues() LOGINFO("TW_EXCLUDE_NANO := true\n"); mConst.SetValue("tw_include_nano", "0"); #endif +#ifndef PB_EXCLUDE_TORCH + mConst.SetValue("pb_torch_support", "1"); +#else + LOGINFO("PB_EXCLUDE_TORCH := true\n"); + mConst.SetValue("pb_torch_support", "0"); +#endif mData.SetValue("tw_enable_adb_backup", "0"); diff --git a/gui/Android.mk b/gui/Android.mk index 9f3020333..889af3220 100755 --- a/gui/Android.mk +++ b/gui/Android.mk @@ -113,6 +113,9 @@ endif ifeq ($(TW_EXCLUDE_NANO), true) LOCAL_CFLAGS += -DTW_EXCLUDE_NANO endif +ifeq ($(PB_EXCLUDE_TORCH), true) + LOCAL_CFLAGS += -DPB_EXCLUDE_TORCH +endif LOCAL_C_INCLUDES += \ bionic \ diff --git a/gui/action.cpp b/gui/action.cpp index 42ba9da98..2f46abea2 100755 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -192,7 +192,9 @@ GUIAction::GUIAction(xml_node<>* node) ADD_ACTION(getpartitiondetails); ADD_ACTION(screenshot); ADD_ACTION(setbrightness); +#ifndef PB_EXCLUDE_TORCH ADD_ACTION(flashlight); +#endif ADD_ACTION(fileexists); ADD_ACTION(killterminal); ADD_ACTION(checkbackupname); @@ -2450,6 +2452,7 @@ int GUIAction::repack(std::string arg __unused) return 0; } +#ifndef PB_EXCLUDE_TORCH int GUIAction::flashlight(std::string arg __unused) { int br_value = DataManager::GetIntValue("pb_bright_value"); @@ -2520,6 +2523,7 @@ int GUIAction::flashlight(std::string arg __unused) } return 0; } +#endif int GUIAction::repackimage(std::string arg __unused) { diff --git a/gui/objects.hpp b/gui/objects.hpp index e9cbd335e..0a7afb361 100644 --- a/gui/objects.hpp +++ b/gui/objects.hpp @@ -370,7 +370,9 @@ class GUIAction : public GUIObject, public ActionObject int setlanguage(std::string arg); int togglebacklight(std::string arg); int twcmd(std::string arg); +#ifndef PB_EXCLUDE_TORCH int flashlight(std::string arg); +#endif int setbootslot(std::string arg); int readfile(std::string arg); int installapp(std::string arg); diff --git a/gui/theme/common/portrait.xml b/gui/theme/common/portrait.xml index fb19ea8cf..b1e97bafc 100644 --- a/gui/theme/common/portrait.xml +++ b/gui/theme/common/portrait.xml @@ -4052,7 +4052,10 @@ - + + + + {@sel_br_val=Flashlight Brightness Value: %pb_bright_value%%} @@ -4820,7 +4823,10 @@