display: Create QService binder interface.
Add QService binder interface to enable communication
to display by the mediaserver for Securing/Unsecuring start and end
notifications.
Create separate lib for external.
Clear reserved field before applying format.
Change-Id: I463c9c6deac7587bd0c4e0b84513b5d0b5dd7e98
diff --git a/liboverlay/overlayCtrl.cpp b/liboverlay/overlayCtrl.cpp
index bb91529..9047f3e 100644
--- a/liboverlay/overlayCtrl.cpp
+++ b/liboverlay/overlayCtrl.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
-* Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
+* Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -75,6 +75,8 @@
return true;
}
+utils::ActionSafe* utils::ActionSafe::sActionSafe = NULL;
+
utils::Dim Ctrl::getAspectRatio(const utils::Whf& whf) const
{
utils::Whf inWhf(whf.w, whf.h, mMdp.getSrcWhf().format);
@@ -107,11 +109,9 @@
if (inWhf.w > fbWidth) inWhf.w = fbWidth;
if (inWhf.h > fbHeight) inWhf.h = fbHeight;
- char value[PROPERTY_VALUE_MAX];
- property_get("hw.actionsafe.width", value, "0");
- float asWidth = atof(value);
- property_get("hw.actionsafe.height", value, "0");
- float asHeight = atof(value);
+ float asWidth = utils::ActionSafe::getInstance()->getHeight();
+ float asHeight = utils::ActionSafe::getInstance()->getWidth();
+
inWhf.w = inWhf.w * (1.0f - asWidth / 100.0f);
inWhf.h = inWhf.h * (1.0f - asHeight / 100.0f);
diff --git a/liboverlay/overlayUtils.h b/liboverlay/overlayUtils.h
index e5f7119..f308b95 100644
--- a/liboverlay/overlayUtils.h
+++ b/liboverlay/overlayUtils.h
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
+* Copyright (c) 2011-2012, 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
@@ -238,6 +238,28 @@
uint32_t size;
};
+class ActionSafe {
+private:
+ ActionSafe() : mWidth(0.0f), mHeight(0.0f) { };
+ float mWidth;
+ float mHeight;
+ static ActionSafe *sActionSafe;
+public:
+ ~ActionSafe() { };
+ static ActionSafe* getInstance() {
+ if(!sActionSafe) {
+ sActionSafe = new ActionSafe();
+ }
+ return sActionSafe;
+ }
+ void setDimension(int w, int h) {
+ mWidth = (float)w;
+ mHeight = (float)h;
+ }
+ float getWidth() { return mWidth; }
+ float getHeight() { return mHeight; }
+};
+
enum { MAX_PATH_LEN = 256 };
/**