Don't load nonplat_service_contexts on full-treble.
am: e3ab0e6086

Change-Id: I4884e1bd0255a5efaca5d66b455b8fb115e4fe2b
diff --git a/libselinux/Android.bp b/libselinux/Android.bp
index 65607d1..3e881c2 100644
--- a/libselinux/Android.bp
+++ b/libselinux/Android.bp
@@ -87,6 +87,12 @@
         }
     },
 
+    product_variables: {
+        treble: {
+            cflags: ["-DFULL_TREBLE"],
+        },
+    },
+
     local_include_dirs: ["include"],
     export_include_dirs: ["include"],
 }
diff --git a/libselinux/src/android/android.c b/libselinux/src/android/android.c
index 391fc1b..b79b463 100644
--- a/libselinux/src/android/android.c
+++ b/libselinux/src/android/android.c
@@ -63,8 +63,12 @@
         seopts_service = seopts_service_rootfs;
     }
 
-    // TODO(b/36866029) full treble devices can't load non-plat
+#ifdef FULL_TREBLE
+    // Treble compliant devices can only serve plat_service_contexts from servicemanager
+    return selinux_android_service_open_context_handle(seopts_service, 1);
+#else
     return selinux_android_service_open_context_handle(seopts_service, 2);
+#endif
 }
 
 struct selabel_handle* selinux_android_hw_service_context_handle(void)