Make "Unmap Super Devices" option available to A-only devices
Change-Id: Ib3aed724b2e98f66387bdca240b0b4f719054594 (cherry picked from commit 2136fc5b91963fc21e782614ce6cfd55ca065eb9)
This commit is contained in:
@@ -818,11 +818,10 @@ 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");
|
||||
mConst.SetValue(TW_VIRTUAL_AB_ENABLED, "1");
|
||||
else
|
||||
mConst.SetValue("tw_virtual_ab.enabled", "0");
|
||||
mConst.SetValue(TW_VIRTUAL_AB_ENABLED, "0");
|
||||
// Brightness handling
|
||||
string findbright;
|
||||
#ifdef TW_BRIGHTNESS_PATH
|
||||
|
||||
@@ -3856,7 +3856,7 @@
|
||||
</actions>
|
||||
</listitem>
|
||||
<listitem name="{@unmap_super_devices=Unmap Super Devices}">
|
||||
<condition var1="tw_virtual_ab.enabled" op="=" var2="1"/>
|
||||
<condition var1="tw_is_super" op="=" var2="1"/>
|
||||
<actions>
|
||||
<action function="set">tw_back=advanced</action>
|
||||
<action function="set">tw_action=unmapsuperdevices</action>
|
||||
|
||||
@@ -3979,7 +3979,7 @@
|
||||
</actions>
|
||||
</listitem>
|
||||
<listitem name="{@unmap_super_devices=Unmap Super Devices}">
|
||||
<condition var1="tw_virtual_ab.enabled" op="=" var2="1"/>
|
||||
<condition var1="tw_is_super" op="=" var2="1"/>
|
||||
<actions>
|
||||
<action function="set">tw_back=advanced</action>
|
||||
<action function="set">tw_action=unmapsuperdevices</action>
|
||||
|
||||
@@ -4466,7 +4466,7 @@
|
||||
</actions>
|
||||
</listitem>
|
||||
<listitem name="{@unmap_super_devices=Unmap Super Devices}">
|
||||
<condition var1="tw_virtual_ab.enabled" op="=" var2="1"/>
|
||||
<condition var1="tw_is_super" op="=" var2="1"/>
|
||||
<actions>
|
||||
<action function="set">tw_back=advanced</action>
|
||||
<action function="set">tw_action=unmapsuperdevices</action>
|
||||
|
||||
@@ -3573,7 +3573,9 @@ bool TWPartitionManager::Unmap_Super_Devices() {
|
||||
if ((*iter)->Is_Super) {
|
||||
TWPartition *part = *iter;
|
||||
std::string bare_partition_name = Get_Bare_Partition_Name((*iter)->Get_Mount_Point());
|
||||
std::string blk_device_partition = bare_partition_name + PartitionManager.Get_Active_Slot_Suffix();
|
||||
std::string blk_device_partition = bare_partition_name;
|
||||
if (DataManager::GetStrValue(TW_VIRTUAL_AB_ENABLED) == "1")
|
||||
blk_device_partition.append(PartitionManager.Get_Active_Slot_Suffix());
|
||||
(*iter)->UnMount(false);
|
||||
LOGINFO("removing dynamic partition: %s\n", blk_device_partition.c_str());
|
||||
destroyed = DestroyLogicalPartition(blk_device_partition);
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
#define TW_NO_SHA2 "tw_no_sha2"
|
||||
#define TW_UNMOUNT_SYSTEM "tw_unmount_system"
|
||||
#define TW_IS_SUPER "tw_is_super"
|
||||
#define TW_VIRTUAL_AB_ENABLED "tw_virtual_ab.enabled"
|
||||
#define TW_AUTO_REFLASHTWRP_VAR "tw_auto_reflashtwrp"
|
||||
|
||||
// Theme versioning
|
||||
|
||||
Reference in New Issue
Block a user