summaryrefslogtreecommitdiff
path: root/gralloc/gr_allocator.cpp
diff options
context:
space:
mode:
authorTharaga Balachandran <tbalacha@codeaurora.org>2020-01-23 18:41:10 -0500
committerBaldev Sahu <bsahu@codeaurora.org>2020-05-12 09:41:37 +0530
commit576571c110b70af015b5e192de6fa148ee6b0a12 (patch)
tree87eaafc96fc257880c5fd8e4e06e0a5e918335fd /gralloc/gr_allocator.cpp
parent95175bb5f9858fbc611f2bb333317ab27b61db09 (diff)
gralloc: Read debug properties in allocator process
This change resolves selinux denials caused by system processes reading vendor debug properties via gralloc. The debug properties are read and parsed in the allocator process, then propagated through the BufferManager CRs-Fixed: 2619084 Change-Id: I5175a7848cdcd2671bd16ee11721066a921f3d79
Diffstat (limited to 'gralloc/gr_allocator.cpp')
-rw-r--r--gralloc/gr_allocator.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/gralloc/gr_allocator.cpp b/gralloc/gr_allocator.cpp
index 64211572..a8073195 100644
--- a/gralloc/gr_allocator.cpp
+++ b/gralloc/gr_allocator.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2018, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2020, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -92,11 +92,6 @@ Allocator::Allocator() : ion_allocator_(nullptr) {}
bool Allocator::Init() {
ion_allocator_ = new IonAlloc();
- char property[PROPERTY_VALUE_MAX];
- property_get(USE_SYSTEM_HEAP_FOR_SENSORS, property, "1");
- if (!(strncmp(property, "0", PROPERTY_VALUE_MAX))) {
- use_system_heap_for_sensors_ = false;
- }
if (!ion_allocator_->Init()) {
return false;
@@ -111,6 +106,10 @@ Allocator::~Allocator() {
}
}
+void Allocator::SetProperties(gralloc::GrallocProperties props) {
+ use_system_heap_for_sensors_ = props.use_system_heap_for_sensors;
+}
+
int Allocator::AllocateMem(AllocData *alloc_data, uint64_t usage, int format) {
int ret;
alloc_data->uncached = UseUncached(format, usage);