summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Dianne Hackborn <hackbod@google.com> 2009-09-01 19:01:50 -0700
committer Dianne Hackborn <hackbod@google.com> 2009-09-02 17:20:25 -0700
commit39bf918e21d8fd13ce5015517fabac255b01f409 (patch)
tree314960f3583e8bf2a753b8076d77bb2a261891c1
parent9a93e323a30cdab6cf67356a33e2fcf749a79597 (diff)
Work on issue #2079167: Flickering issue across multiple UI
This addresses a few parts of the bug: - There was a small issue in the window manager where we could show a window too early before the transition animation starts, which was introduced by the recent wallpaper work. This was the cause of the flicker when starting the dialer for the first time. - There was a much larger problem that has existing forever where moving an application token to the front or back was not synchronized with the application animation transaction. This was the cause of the flicker when hanging up (now that the in-call screen moves to the back instead of closing and we always have a wallpaper visible). The approach to solving this is to have the window manager go ahead and move the app tokens (it must in order to keep in sync with the activity manager), but to delay the actual window movement: perform the movement to front when the animation starts, and to back when it ends. Actually, when the animation ends, we just go and completely rebuild the window list to ensure it is correct, because there can be ways people can add windows while in this intermediate state where they could end up at the wrong place once we do the delayed movement to the front or back. And it is simply reasuring to know that every time we finish a full app transition, we re-evaluate the world and put everything in its proper place. Also included in this change are a few little tweaks to the input system, to perform better logging, and completely ignore input devices that do not have any of our input classes. There is also a little cleanup of evaluating configuration changes to not do more work than needed when an input devices appears or disappears, and to only log a config change message when the config is truly changing. Change-Id: Ifb2db77f8867435121722a6abeb946ec7c3ea9d3
-rw-r--r--libs/ui/EventHub.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/libs/ui/EventHub.cpp b/libs/ui/EventHub.cpp
index 60c177b7aa..e39a357598 100644
--- a/libs/ui/EventHub.cpp
+++ b/libs/ui/EventHub.cpp
@@ -781,12 +781,21 @@ int EventHub::close_device(const char *deviceName)
if(strcmp(mDevices[i]->path.string(), deviceName) == 0) {
//LOGD("remove device %d: %s\n", i, deviceName);
device_t* device = mDevices[i];
- int count = mFDCount - i - 1;
+
+ LOGI("Removed device: path=%s name=%s id=0x%x (of 0x%x) index=%d fd=%d classes=0x%x\n",
+ device->path.string(), device->name.string(), device->id,
+ mNumDevicesById, mFDCount, mFDs[i].fd, device->classes);
+
+ // Clear this device's entry.
int index = (device->id&ID_MASK);
mDevicesById[index].device = NULL;
+
+ // Close the file descriptor and compact the fd array.
close(mFDs[i].fd);
+ int count = mFDCount - i - 1;
memmove(mDevices + i, mDevices + i + 1, sizeof(mDevices[0]) * count);
memmove(mFDs + i, mFDs + i + 1, sizeof(mFDs[0]) * count);
+ mFDCount--;
#ifdef EV_SW
for (int j=0; j<EV_SW; j++) {
@@ -799,8 +808,6 @@ int EventHub::close_device(const char *deviceName)
device->next = mClosingDevices;
mClosingDevices = device;
- mFDCount--;
-
uint32_t publicID;
if (device->id == mFirstKeyboardId) {
LOGW("built-in keyboard device %s (id=%d) is closing! the apps will not like this",
@@ -817,7 +824,7 @@ int EventHub::close_device(const char *deviceName)
return 0;
}
}
- LOGE("remote device: %s not found\n", deviceName);
+ LOGE("remove device: %s not found\n", deviceName);
return -1;
}
@@ -832,7 +839,7 @@ int EventHub::read_notify(int nfd)
int event_pos = 0;
struct inotify_event *event;
-LOGD("EventHub::read_notify nfd: %d\n", nfd);
+ LOGV("EventHub::read_notify nfd: %d\n", nfd);
res = read(nfd, event_buf, sizeof(event_buf));
if(res < (int)sizeof(*event)) {
if(errno == EINTR)