From 70592f2c4734681521fd49fd9654967907901127 Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Thu, 4 Mar 2010 18:41:49 -0800 Subject: [PATCH] Refactor car mode. Extract all UI behavior from dock observer and ACTION_DOCK_EVENT. Also introduce a desk type to go along with the car type all through the resource system, since we now need to have corresponding high-level broadcasts for desk dock mode. As part of that I also reworked some of the logic for switching modes to all funnel through a single update() call that looks all of the current state to decide what to do next, and fixed various locking issues. In addition I found there were bugs in the configuration change handling causing us to only switch into the car mode config and then never get out of it. Unfortunately now that we are actually changing the configuration for each mode change, the transitions between them are really crummy as we restart all kinds of activities. :( --- include/utils/ResourceTypes.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h index cbcef4e1a..0e796dc56 100644 --- a/include/utils/ResourceTypes.h +++ b/include/utils/ResourceTypes.h @@ -946,7 +946,8 @@ struct ResTable_config MASK_UI_MODE_TYPE = 0x0f, UI_MODE_TYPE_ANY = 0x00, UI_MODE_TYPE_NORMAL = 0x01, - UI_MODE_TYPE_CAR = 0x02, + UI_MODE_TYPE_DESK = 0x02, + UI_MODE_TYPE_CAR = 0x03, // uiMode bits for the night switch. MASK_UI_MODE_NIGHT = 0x30,