Merge "sde: Read simulation flag"

This commit is contained in:
Linux Build Service Account
2015-01-09 18:23:47 -08:00
committed by Gerrit - the friendly Code Review server
2 changed files with 11 additions and 0 deletions

View File

@@ -25,6 +25,7 @@
#ifndef __DEBUG_H__ #ifndef __DEBUG_H__
#define __DEBUG_H__ #define __DEBUG_H__
#include <stdint.h>
#include <core/sde_types.h> #include <core/sde_types.h>
#define DLOG(tag, method, format, ...) Debug::GetLogHandler()->method(tag, \ #define DLOG(tag, method, format, ...) Debug::GetLogHandler()->method(tag, \
@@ -47,6 +48,7 @@ class Debug {
static inline void SetLogHandler(LogHandler *log_handler) { debug_.log_handler_ = log_handler; } static inline void SetLogHandler(LogHandler *log_handler) { debug_.log_handler_ = log_handler; }
static inline LogHandler* GetLogHandler() { return debug_.log_handler_; } static inline LogHandler* GetLogHandler() { return debug_.log_handler_; }
static inline bool IsVirtualDriver() { return debug_.virtual_driver_; } static inline bool IsVirtualDriver() { return debug_.virtual_driver_; }
static uint32_t GetSimulationFlag();
private: private:
Debug(); Debug();

View File

@@ -38,5 +38,14 @@ Debug::Debug() : log_handler_(&default_log_handler_), virtual_driver_(false) {
} }
} }
uint32_t Debug::GetSimulationFlag() {
char property[PROPERTY_VALUE_MAX];
if (property_get("debug.hwc.simulate", property, NULL) > 0) {
return atoi(property);
}
return 0;
}
} // namespace sde } // namespace sde