From 5ef301ec95cb340da8ee410027e4042b5b0657b6 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Tue, 14 Oct 2014 10:04:44 -0500 Subject: Do not set contexts during a factory reset We should not need to set or change the contexts of the media folder when doing a factory reset. We should only do this when we need to recreate the media folder. Change-Id: I9f9918743d687b0aa0eb1e50747677f883037047 --- partition.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/partition.cpp b/partition.cpp index 3fadfb980..6c1c3e50b 100644 --- a/partition.cpp +++ b/partition.cpp @@ -1733,10 +1733,6 @@ bool TWPartition::Wipe_Data_Without_Wiping_Media() { } closedir(d); - #ifdef HAVE_SELINUX - perms.fixDataInternalContexts(); - #endif - gui_print("Done.\n"); return true; } @@ -2076,9 +2072,9 @@ void TWPartition::Recreate_Media_Folder(void) { PartitionManager.Mount_By_Path(Symlink_Mount_Point, true); LOGINFO("Recreating /data/media folder.\n"); mkdir("/data/media", S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); - #ifdef HAVE_SELINUX +#ifdef HAVE_SELINUX perms.fixDataInternalContexts(); - #endif +#endif // Toggle mount to ensure that "internal sdcard" gets mounted PartitionManager.UnMount_By_Path(Symlink_Mount_Point, true); PartitionManager.Mount_By_Path(Symlink_Mount_Point, true); -- cgit v1.2.3