Enable binderized graphics allocator

Bug: 37550237
Test: boots to launcher
Change-Id: I0b34a6dc87d33f37fffee000b020d78e754d827c
diff --git a/BoardConfigCommon.mk b/BoardConfigCommon.mk
index 10356bb..977829b 100644
--- a/BoardConfigCommon.mk
+++ b/BoardConfigCommon.mk
@@ -36,6 +36,8 @@
 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4
 TARGET_USE_PAN_DISPLAY := true
 
+SF_START_GRAPHICS_ALLOCATOR_SERVICE := true
+
 # enable to use the CPUSETS feature
 ENABLE_CPUSETS := true
 ENABLE_SCHEDBOOST := true
diff --git a/device-common.mk b/device-common.mk
index f328861..059139e 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -53,6 +53,11 @@
 
 PRODUCT_PACKAGES += libGLES_android
 
+# Graphics HAL
+PRODUCT_PACKAGES += \
+    android.hardware.graphics.allocator@2.0-impl \
+    android.hardware.graphics.mapper@2.0-impl
+
 PRODUCT_PACKAGES +=	TIInit_11.8.32.bts \
 			wl18xx-fw-4.bin \
 			wl18xx-conf.bin
diff --git a/manifest.xml b/manifest.xml
index 6d489e9..95a1fe7 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -9,6 +9,24 @@
         </interface>
     </hal>
     <hal format="hidl">
+        <name>android.hardware.graphics.allocator</name>
+        <transport>hwbinder</transport>
+        <version>2.0</version>
+        <interface>
+            <name>IAllocator</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+    <hal format="hidl">
+        <name>android.hardware.graphics.mapper</name>
+        <transport arch="32+64">passthrough</transport>
+        <version>2.0</version>
+        <interface>
+            <name>IMapper</name>
+            <instance>default</instance>
+        </interface>
+    </hal>
+    <hal format="hidl">
         <name>android.hardware.wifi.supplicant</name>
         <transport>hwbinder</transport>
         <version>1.0</version>
diff --git a/sepolicy/surfaceflinger.te b/sepolicy/surfaceflinger.te
new file mode 100644
index 0000000..f53f2b4
--- /dev/null
+++ b/sepolicy/surfaceflinger.te
@@ -0,0 +1 @@
+hal_server_domain(surfaceflinger, hal_graphics_allocator)