From b5fab76bea98dff8d0825d16c3dd359397449e9a Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Thu, 28 Jan 2016 14:03:33 -0600 Subject: 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 --- gui/action.cpp | 14 ++++++++++---- gui/objects.hpp | 1 + gui/theme/common/landscape.xml | 29 ++++++++++++----------------- gui/theme/common/languages/en.xml | 20 +++++++++----------- gui/theme/common/portrait.xml | 29 ++++++++++++----------------- gui/theme/common/watch.xml | 29 ++++++++++++----------------- 6 files changed, 56 insertions(+), 66 deletions(-) (limited to 'gui') diff --git a/gui/action.cpp b/gui/action.cpp index 240db8f24..e08111850 100644 --- a/gui/action.cpp +++ b/gui/action.cpp @@ -209,6 +209,7 @@ GUIAction::GUIAction(xml_node<>* node) 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 @@ int GUIAction::cancelbackup(std::string arg __unused) { 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 @@ int GUIAction::fixpermissions(std::string arg __unused) return 0; } +int GUIAction::fixpermissions(std::string arg) +{ + return fixcontexts(arg); +} + int GUIAction::dd(std::string arg) { operation_start("imaging"); diff --git a/gui/objects.hpp b/gui/objects.hpp index e7ade18a5..d64a5fcfd 100644 --- a/gui/objects.hpp +++ b/gui/objects.hpp @@ -337,6 +337,7 @@ protected: int wipe(std::string arg); int refreshsizes(std::string arg); int nandroid(std::string arg); + int fixcontexts(std::string arg); int fixpermissions(std::string arg); int dd(std::string arg); int partitionsd(std::string arg); diff --git a/gui/theme/common/landscape.xml b/gui/theme/common/landscape.xml index 3bbb8bebd..7ce8d6534 100755 --- a/gui/theme/common/landscape.xml +++ b/gui/theme/common/landscape.xml @@ -3094,9 +3094,10 @@