release-request-f4ecf242-5d1c-45e0-8c7c-ede48d1a9e82-for-git_oc-release-4111650 snap-temp-L02200000075283731

Change-Id: Id1b274b254753d4ee0fc788092ef6a62f86efd92
diff --git a/recovery.cpp b/recovery.cpp
index 30edaa5..c1a31b6 100644
--- a/recovery.cpp
+++ b/recovery.cpp
@@ -54,6 +54,7 @@
 #include <healthd/BatteryMonitor.h>
 #include <private/android_logger.h> /* private pmsg functions */
 #include <private/android_filesystem_config.h>  /* for AID_SYSTEM */
+#include <selinux/android.h>
 #include <selinux/label.h>
 #include <selinux/selinux.h>
 #include <ziparchive/zip_archive.h>
@@ -1481,12 +1482,8 @@
     ui->SetBackground(RecoveryUI::NONE);
     if (show_text) ui->ShowText(true);
 
-    struct selinux_opt seopts[] = {
-        { SELABEL_OPT_PATH, "/file_contexts" }
-    };
-
-    sehandle = selabel_open(SELABEL_CTX_FILE, seopts, 1);
-
+    sehandle = selinux_android_file_context_handle();
+    selinux_android_set_sehandle(sehandle);
     if (!sehandle) {
         ui->Print("Warning: No file_contexts\n");
     }
diff --git a/updater/updater.cpp b/updater/updater.cpp
index c09e267..f3e2820 100644
--- a/updater/updater.cpp
+++ b/updater/updater.cpp
@@ -25,6 +25,7 @@
 
 #include <android-base/logging.h>
 #include <android-base/strings.h>
+#include <selinux/android.h>
 #include <selinux/label.h>
 #include <selinux/selinux.h>
 #include <ziparchive/zip_archive.h>
@@ -139,9 +140,8 @@
     return 6;
   }
 
-  struct selinux_opt seopts[] = { { SELABEL_OPT_PATH, "/file_contexts" } };
-
-  sehandle = selabel_open(SELABEL_CTX_FILE, seopts, 1);
+  sehandle = selinux_android_file_context_handle();
+  selinux_android_set_sehandle(sehandle);
 
   if (!sehandle) {
     fprintf(cmd_pipe, "ui_print Warning: No file_contexts\n");