Skip ab/6749736 in stage.

Merged-In: Ic29b1ffb323ad0044a27a98ba1aa08d4935a3bdc
Change-Id: I539139fe9521db4ae582062b97c89137477abf69
diff --git a/device-common.mk b/device-common.mk
index f69cc5b..0721f01 100644
--- a/device-common.mk
+++ b/device-common.mk
@@ -28,6 +28,7 @@
 else
 # Adjust the dalvik heap to be appropriate for a tablet.
 $(call inherit-product, frameworks/native/build/tablet-10in-xhdpi-2048-dalvik-heap.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
 endif
 
 # Set vendor kernel path
diff --git a/gralloc/alloc_device.cpp b/gralloc/alloc_device.cpp
index 95b1a43..f458a62 100644
--- a/gralloc/alloc_device.cpp
+++ b/gralloc/alloc_device.cpp
@@ -147,7 +147,7 @@
 		return ret;
 	}
 
-	fd = open(buf, O_RDWR);
+	fd = open(buf, O_RDONLY);
 	if (fd < 0)
 		AERR("open %s failed!\n", buf);
 	return fd;
diff --git a/gralloc960/mali_gralloc_ion.cpp b/gralloc960/mali_gralloc_ion.cpp
index d688de1..c40dc7b 100644
--- a/gralloc960/mali_gralloc_ion.cpp
+++ b/gralloc960/mali_gralloc_ion.cpp
@@ -171,7 +171,7 @@
 		return ret;
 	}
 
-	fd = open(buf, O_RDWR);
+	fd = open(buf, O_RDONLY);
 	if (fd < 0)
 		AERR("open %s failed!\n", buf);
 	return fd;
diff --git a/hikey-common.mk b/hikey-common.mk
index aba5797..b156cc3 100644
--- a/hikey-common.mk
+++ b/hikey-common.mk
@@ -19,4 +19,3 @@
 
 $(call inherit-product, device/linaro/hikey/hikey/device-hikey.mk)
 $(call inherit-product, device/linaro/hikey/device-common.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
diff --git a/hikey960.mk b/hikey960.mk
index 22e8f6f..3a979f8 100644
--- a/hikey960.mk
+++ b/hikey960.mk
@@ -23,11 +23,10 @@
 endif
 
 #
-# Inherit the full_base and device configurations
+# Inherit the common device configuration
 $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk)
 $(call inherit-product, device/linaro/hikey/hikey960/device-hikey960.mk)
 $(call inherit-product, device/linaro/hikey/device-common.mk)
-$(call inherit-product, $(SRC_TARGET_DIR)/product/full_base.mk)
 
 #setup dm-verity configs
 PRODUCT_SYSTEM_VERITY_PARTITION := /dev/block/platform/soc/ff3b0000.ufs/by-name/system
@@ -48,10 +47,11 @@
 ifneq ($(HIKEY_USES_GKI),)
   HIKEY_MOD_DIR := device/linaro/hikey-kernel/hikey960/$(TARGET_KERNEL_USE)
   HIKEY_MODS := $(wildcard $(HIKEY_MOD_DIR)/*.ko)
+  SDCARDFS_KO := $(wildcard $(HIKEY_MOD_DIR)/sdcardfs*.ko)
   ifneq ($(HIKEY_MODS),)
     BOARD_VENDOR_KERNEL_MODULES += $(HIKEY_MODS)
     BOARD_VENDOR_RAMDISK_KERNEL_MODULES += \
 	$(HIKEY_MOD_DIR)/ion_cma_heap.ko \
-	$(HIKEY_MOD_DIR)/sdcardfs.ko
+	$(SDCARDFS_KO)
   endif
 endif
diff --git a/sepolicy/file_contexts b/sepolicy/file_contexts
index 927ec77..350c678 100644
--- a/sepolicy/file_contexts
+++ b/sepolicy/file_contexts
@@ -13,7 +13,7 @@
 /dev/hifi_misc         u:object_r:audio_device:s0
 /dev/hi_vdec	       u:object_r:video_device:s0
 /dev/hi_venc	       u:object_r:video_device:s0
-/dev/dma_heap(/.*)? u:object_r:graphics_device:s0
+/dev/dma_heap/linux,cma u:object_r:graphics_device:s0
 /dev/graphics/fb0      u:object_r:graphics_device:s0
 
 # files in /vendor
diff --git a/sepolicy/hal_graphics_allocator_default.te b/sepolicy/hal_graphics_allocator_default.te
index b17dc7d..833e957 100644
--- a/sepolicy/hal_graphics_allocator_default.te
+++ b/sepolicy/hal_graphics_allocator_default.te
@@ -1,2 +1,3 @@
 allow hal_graphics_allocator_default graphics_device:dir search;
 allow hal_graphics_allocator_default graphics_device:chr_file { open read write ioctl map rw_file_perms};
+allow hal_graphics_allocator_default dmabuf_system_heap_device:chr_file r_file_perms;
diff --git a/sepolicy/property.te b/sepolicy/property.te
index 93e029d..c47a33e 100644
--- a/sepolicy/property.te
+++ b/sepolicy/property.te
@@ -1 +1 @@
-type sensors_prop, property_type;
+vendor_internal_prop(sensors_prop)
diff --git a/ueventd.common.rc b/ueventd.common.rc
index 7f37c25..8065263 100644
--- a/ueventd.common.rc
+++ b/ueventd.common.rc
@@ -1,9 +1,5 @@
 modalias_handling enabled
 
-subsystem dma_heap
-    devname uevent_devpath
-    dirname /dev/dma_heap
-
 subsystem usbmisc
     devname uevent_devname
 
@@ -18,7 +14,6 @@
 /dev/hi_vdec     0660 system camera
 /dev/hi_venc     0660 system camera
 /dev/ion	 0666 system graphics
-/dev/dma_heap/system	0666 system graphics
 /dev/dma_heap/linux,cma	0666 system graphics
 /dev/graphics/fb0	0666 system graphics