aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-09-18 02:26:43 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-09-18 02:26:43 +0000
commitf4d460216beb5f5fccf7ce3e5553a35ff1760030 (patch)
tree668ceeb6d16b5403131da69f608faead32aec2c5
parent4f509f4fadbc58cc65ad3c3d498101c2f2bd0d20 (diff)
parent26ca350563052cbfdfffd400ac193e6befb8e445 (diff)
downloadselinux-o-mr1-iot-preview-6.tar.gz
Change-Id: I8e9a3bef62ea563169cc7049e5f6db57e460cb09
-rw-r--r--libselinux/Android.bp6
-rw-r--r--libselinux/src/android/android.c6
2 files changed, 11 insertions, 1 deletions
diff --git a/libselinux/Android.bp b/libselinux/Android.bp
index 65607d1b..3e881c24 100644
--- a/libselinux/Android.bp
+++ b/libselinux/Android.bp
@@ -87,6 +87,12 @@ cc_defaults {
}
},
+ 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 391fc1b8..b79b4635 100644
--- a/libselinux/src/android/android.c
+++ b/libselinux/src/android/android.c
@@ -63,8 +63,12 @@ struct selabel_handle* selinux_android_service_context_handle(void)
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)