Skip to content

Commit

Permalink
Merge "Fix build error on Pie with TW_NO_LEGACY_PROPS := true" into a…
Browse files Browse the repository at this point in the history
…ndroid-9.0
  • Loading branch information
bigbiff authored and Gerrit Code Review committed Mar 15, 2019
2 parents 6b9ee0e + c4faea8 commit 3ae89ed
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions twinstall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,12 @@ extern "C" {

#define AB_OTA "payload_properties.txt"

#ifndef TW_NO_LEGACY_PROPS
static const char* properties_path = "/dev/__properties__";
static const char* properties_path_renamed = "/dev/__properties_kk__";
static bool legacy_props_env_initd = false;
static bool legacy_props_path_modified = false;
#endif

enum zip_type {
UNKNOWN_ZIP_TYPE = 0,
Expand All @@ -79,6 +81,7 @@ enum zip_type {
TWRP_THEME_ZIP_TYPE
};

#ifndef TW_NO_LEGACY_PROPS
// to support pre-KitKat update-binaries that expect properties in the legacy format
static int switch_to_legacy_properties()
{
Expand Down Expand Up @@ -120,6 +123,7 @@ static int switch_to_new_properties()

return 0;
}
#endif

static int Install_Theme(const char* path, ZipWrap *Zip) {
#ifdef TW_OEM_BUILD // We don't do custom themes in OEM builds
Expand Down Expand Up @@ -173,6 +177,7 @@ static int Prepare_Update_Binary(const char *path, ZipWrap *Zip, int* wipe_cache
return INSTALL_SUCCESS;
}

#ifndef TW_NO_LEGACY_PROPS
static bool update_binary_has_legacy_properties(const char *binary) {
const char str_to_match[] = "ANDROID_PROPERTY_WORKSPACE";
int len_to_match = sizeof(str_to_match) - 1;
Expand Down Expand Up @@ -205,6 +210,7 @@ static bool update_binary_has_legacy_properties(const char *binary) {

return found;
}
#endif

static int Run_Update_Binary(const char *path, ZipWrap *Zip, int* wipe_cache, zip_type ztype) {
int ret_val, pipe_fd[2], status, zip_verify;
Expand Down

0 comments on commit 3ae89ed

Please sign in to comment.