Replace fix permissions with fix contexts for emulated storage

Fix permissions rarely fixed anything on more recent versions of
Android and usually made things worse. Instead we will replace it
with a more dumbed down option that should fix contexts on
/data/media with a few improvements to ensure that contexts get
fixed for multiple users and on adopted storage.

Change-Id: If5523781936a0b04196e2ad871cae767ebae2583
diff --git a/gui/action.cpp b/gui/action.cpp
index 240db8f..e081118 100644
--- a/gui/action.cpp
+++ b/gui/action.cpp
@@ -209,6 +209,7 @@
 		ADD_ACTION(wipe);
 		ADD_ACTION(refreshsizes);
 		ADD_ACTION(nandroid);
+		ADD_ACTION(fixcontexts);
 		ADD_ACTION(fixpermissions);
 		ADD_ACTION(dd);
 		ADD_ACTION(partitionsd);
@@ -1219,16 +1220,16 @@
 	return 0;
 }
 
-int GUIAction::fixpermissions(std::string arg __unused)
+int GUIAction::fixcontexts(std::string arg __unused)
 {
 	int op_status = 0;
 
-	operation_start("Fix Permissions");
-	LOGINFO("fix permissions started!\n");
+	operation_start("Fix Contexts");
+	LOGINFO("fix contexts started!\n");
 	if (simulate) {
 		simulate_progress_bar();
 	} else {
-		op_status = PartitionManager.Fix_Permissions();
+		op_status = PartitionManager.Fix_Contexts();
 		if (op_status != 0)
 			op_status = 1; // failure
 	}
@@ -1236,6 +1237,11 @@
 	return 0;
 }
 
+int GUIAction::fixpermissions(std::string arg)
+{
+	return fixcontexts(arg);
+}
+
 int GUIAction::dd(std::string arg)
 {
 	operation_start("imaging");