Merge "Fix log spam about CPU frequency on one device" into jb-dev
diff --git a/cmds/dumpstate/dumpstate.c b/cmds/dumpstate/dumpstate.c
index dd015c6..880f81f 100644
--- a/cmds/dumpstate/dumpstate.c
+++ b/cmds/dumpstate/dumpstate.c
@@ -311,6 +311,8 @@
ALOGI("begin\n");
+ signal(SIGPIPE, SIG_IGN);
+
/* set as high priority, and protect from OOM killer */
setpriority(PRIO_PROCESS, 0, -20);
FILE *oom_adj = fopen("/proc/self/oom_adj", "w");
diff --git a/cmds/dumpsys/dumpsys.cpp b/cmds/dumpsys/dumpsys.cpp
index 7dad6b6..c9fcc00 100644
--- a/cmds/dumpsys/dumpsys.cpp
+++ b/cmds/dumpsys/dumpsys.cpp
@@ -28,6 +28,7 @@
int main(int argc, char* const argv[])
{
+ signal(SIGPIPE, SIG_IGN);
sp<IServiceManager> sm = defaultServiceManager();
fflush(stdout);
if (sm == NULL) {
diff --git a/include/ui/Rect.h b/include/ui/Rect.h
index 308da7b..c2c2675 100644
--- a/include/ui/Rect.h
+++ b/include/ui/Rect.h
@@ -65,15 +65,22 @@
}
// rectangle's width
- inline int32_t width() const {
+ inline int32_t getWidth() const {
return right-left;
}
// rectangle's height
- inline int32_t height() const {
+ inline int32_t getHeight() const {
return bottom-top;
}
+ inline Rect getBounds() const {
+ return Rect(right-left, bottom-top);
+ }
+
+ inline int32_t width() const { return getWidth(); }
+ inline int32_t height() const { return getHeight(); }
+
void setLeftTop(const Point& lt) {
left = lt.x;
top = lt.y;