Treat /vendor like /system for read only

The vendor partition is verity checked just like system so we
should treat vendor as read only same as system.

Change-Id: Ida65c9f44d8610e52fcdcef0b4a50faf5c7110d2
This commit is contained in:
Ethan Yonker
2015-10-26 21:51:58 -05:00
committed by Dees Troy
parent 0543f06679
commit 1673e3d4ea
3 changed files with 30 additions and 0 deletions
+15
View File
@@ -1798,6 +1798,7 @@ int GUIAction::mountsystemtoggle(std::string arg)
{
int op_status = 0;
bool remount_system = PartitionManager.Is_Mounted_By_Path("/system");
bool remount_vendor = PartitionManager.Is_Mounted_By_Path("/vendor");
operation_start("Toggle System Mount");
if (!PartitionManager.UnMount_By_Path("/system", true)) {
@@ -1819,6 +1820,20 @@ int GUIAction::mountsystemtoggle(std::string arg)
} else {
op_status = 1; // fail
}
Part = PartitionManager.Find_Partition_By_Path("/vendor");
if (Part) {
if (arg == "0") {
Part->Change_Mount_Read_Only(false);
} else {
Part->Change_Mount_Read_Only(true);
}
if (remount_vendor) {
Part->Mount(true);
}
op_status = 0; // success
} else {
op_status = 1; // fail
}
}
operation_end(op_status);