Make legacy props an option disabled by default

Change-Id: Id0bb17ebd11e120b4676c41d6553e6a830ac7ee9
This commit is contained in:
Ethan Yonker
2017-09-08 12:17:03 -05:00
parent 8373cfe28c
commit 75aa615767
6 changed files with 41 additions and 14 deletions
+15 -12
View File
@@ -60,7 +60,6 @@ extern "C" {
}
#define AB_OTA "payload_properties.txt"
//#define TW_NO_LEGACY_PROPS 1
static const char* properties_path = "/dev/__properties__";
static const char* properties_path_renamed = "/dev/__properties_kk__";
@@ -174,11 +173,13 @@ static int Run_Update_Binary(const char *path, ZipWrap *Zip, int* wipe_cache, zi
FILE* child_data;
#ifndef TW_NO_LEGACY_PROPS
/* Set legacy properties */
if (switch_to_legacy_properties() != 0) {
LOGERR("Legacy property environment did not initialize successfully. Properties may not be detected.\n");
} else {
LOGINFO("Legacy property environment initialized.\n");
if (DataManager::GetIntValue("tw_enable_legacy_props") != 0) {
/* Set legacy properties */
if (switch_to_legacy_properties() != 0) {
LOGERR("Legacy property environment did not initialize successfully. Properties may not be detected.\n");
} else {
LOGINFO("Legacy property environment initialized.\n");
}
}
#endif
@@ -259,12 +260,14 @@ static int Run_Update_Binary(const char *path, ZipWrap *Zip, int* wipe_cache, zi
int waitrc = TWFunc::Wait_For_Child(pid, &status, "Updater");
#ifndef TW_NO_LEGACY_PROPS
/* Unset legacy properties */
if (legacy_props_path_modified) {
if (switch_to_new_properties() != 0) {
LOGERR("Legacy property environment did not disable successfully. Legacy properties may still be in use.\n");
} else {
LOGINFO("Legacy property environment disabled.\n");
if (DataManager::GetIntValue("tw_enable_legacy_props") != 0) {
/* Unset legacy properties */
if (legacy_props_path_modified) {
if (switch_to_new_properties() != 0) {
LOGERR("Legacy property environment did not disable successfully. Legacy properties may still be in use.\n");
} else {
LOGINFO("Legacy property environment disabled.\n");
}
}
}
#endif