vab: correct default properties when vab is enabled
- do not show vab options in advanced - do not perform merges when vab is disabled Change-Id: I20997eca515600cb07fe896305b861ee9418c326
This commit is contained in:
9
data.cpp
9
data.cpp
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2012 to 2016 bigbiff/Dees_Troy TeamWin
|
||||
Copyright 2012 to 2021 TeamWin
|
||||
This file is part of TWRP/TeamWin Recovery Project.
|
||||
|
||||
TWRP is free software: you can redistribute it and/or modify
|
||||
@@ -766,7 +766,7 @@ void DataManager::SetDefaultValues()
|
||||
mPersist.SetValue(TW_TIME_ZONE_GUISEL, "CST6;CDT,M3.2.0,M11.1.0");
|
||||
mPersist.SetValue(TW_TIME_ZONE_GUIOFFSET, "0");
|
||||
mPersist.SetValue(TW_TIME_ZONE_GUIDST, "1");
|
||||
mPersist.SetValue(TW_AUTO_REFLASHTWRP_VAR, "0");
|
||||
mPersist.SetValue(TW_AUTO_REFLASHTWRP_VAR, "0");
|
||||
|
||||
mData.SetValue(TW_ACTION_BUSY, "0");
|
||||
mData.SetValue("tw_wipe_cache", "0");
|
||||
@@ -813,6 +813,11 @@ void DataManager::SetDefaultValues()
|
||||
mData.SetValue("tw_sleep", "5");
|
||||
mData.SetValue("tw_enable_fastboot", "0");
|
||||
|
||||
|
||||
if (android::base::GetBoolProperty("ro.virtual_ab.enabled", false))
|
||||
mConst.SetValue("tw_virtual_ab.enabled", "1");
|
||||
else
|
||||
mConst.SetValue("tw_virtual_ab.enabled", "0");
|
||||
// Brightness handling
|
||||
string findbright;
|
||||
#ifdef TW_BRIGHTNESS_PATH
|
||||
|
||||
2
data.hpp
2
data.hpp
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
Copyright 2012 bigbiff/Dees_Troy TeamWin
|
||||
Copyright 2012 to 2021 TeamWin
|
||||
This file is part of TWRP/TeamWin Recovery Project.
|
||||
|
||||
TWRP is free software: you can redistribute it and/or modify
|
||||
|
||||
@@ -3803,6 +3803,7 @@
|
||||
</actions>
|
||||
</listitem>
|
||||
<listitem name="{@unmap_super_devices=Unmap Super Devices}">
|
||||
<condition var1="tw_virtual_ab.enabled" op="=" var2="1"/>
|
||||
<actions>
|
||||
<action function="set">tw_back=advanced</action>
|
||||
<action function="set">tw_action=unmapsuperdevices</action>
|
||||
@@ -3814,6 +3815,7 @@
|
||||
</actions>
|
||||
</listitem>
|
||||
<listitem name="{@merges_snapshots=Merge Snapshots}">
|
||||
<condition var1="tw_virtual_ab.enabled" op="=" var2="1"/>
|
||||
<actions>
|
||||
<action function="set">tw_back=advanced</action>
|
||||
<action function="set">tw_action=mergesnapshots</action>
|
||||
|
||||
@@ -3925,6 +3925,7 @@
|
||||
</actions>
|
||||
</listitem>
|
||||
<listitem name="{@unmap_super_devices=Unmap Super Devices}">
|
||||
<condition var1="tw_virtual_ab.enabled" op="=" var2="1"/>
|
||||
<actions>
|
||||
<action function="set">tw_back=advanced</action>
|
||||
<action function="set">tw_action=unmapsuperdevices</action>
|
||||
@@ -3936,6 +3937,7 @@
|
||||
</actions>
|
||||
</listitem>
|
||||
<listitem name="{@merges_snapshots=Merge Snapshots}">
|
||||
<condition var1="tw_virtual_ab.enabled" op="=" var2="1"/>
|
||||
<actions>
|
||||
<action function="set">tw_back=advanced</action>
|
||||
<action function="set">tw_action=mergesnapshots</action>
|
||||
|
||||
@@ -4404,6 +4404,7 @@
|
||||
</actions>
|
||||
</listitem>
|
||||
<listitem name="{@unmap_super_devices=Unmap Super Devices}">
|
||||
<condition var1="tw_virtual_ab.enabled" op="=" var2="1"/>
|
||||
<actions>
|
||||
<action function="set">tw_back=advanced</action>
|
||||
<action function="set">tw_action=unmapsuperdevices</action>
|
||||
@@ -4415,6 +4416,7 @@
|
||||
</actions>
|
||||
</listitem>
|
||||
<listitem name="{@merges_snapshots=Merge Snapshots}">
|
||||
<condition var1="tw_virtual_ab.enabled" op="=" var2="1"/>
|
||||
<actions>
|
||||
<action function="set">tw_back=advanced</action>
|
||||
<action function="set">tw_action=mergesnapshots</action>
|
||||
|
||||
@@ -1594,7 +1594,7 @@ int TWPartitionManager::Format_Data(void) {
|
||||
metadata->UnMount(false);
|
||||
|
||||
if (dat != NULL) {
|
||||
if (android::base::GetBoolProperty("ro.virtual_ab.enabled", true)) {
|
||||
if (android::base::GetBoolProperty("ro.virtual_ab.enabled", false)) {
|
||||
#ifndef TW_EXCLUDE_APEX
|
||||
twrpApex apex;
|
||||
apex.Unmount();
|
||||
|
||||
@@ -346,7 +346,7 @@ int TWinstall_zip(const char* path, int* wipe_cache, bool check_for_digest) {
|
||||
PartitionManager.UnMount_By_Path("/vendor", false);
|
||||
if (!system_mount_state)
|
||||
PartitionManager.UnMount_By_Path(PartitionManager.Get_Android_Root_Path(), false);
|
||||
if (android::base::GetBoolProperty("ro.virtual_ab.enabled", true)) {
|
||||
if (android::base::GetBoolProperty("ro.virtual_ab.enabled", false)) {
|
||||
PartitionManager.Prepare_All_Super_Volumes();
|
||||
gui_warn("mount_vab_partitions=Devices on super may not mount until rebooting recovery.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user