From e3c6837d5afb19f648acbd2e5e3ac0b885a1bf6a 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. :( --- AaptAssets.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/AaptAssets.cpp b/AaptAssets.cpp index 6e7a66d..fc655a7 100644 --- a/AaptAssets.cpp +++ b/AaptAssets.cpp @@ -820,7 +820,12 @@ bool AaptGroupEntry::getUiModeTypeName(const char* name, if (strcmp(name, kWildcardName) == 0) { if (out) out->uiMode = (out->uiMode&~ResTable_config::MASK_UI_MODE_TYPE) - | ResTable_config::UI_MODE_TYPE_NORMAL; + | ResTable_config::UI_MODE_TYPE_ANY; + return true; + } else if (strcmp(name, "desk") == 0) { + if (out) out->uiMode = + (out->uiMode&~ResTable_config::MASK_UI_MODE_TYPE) + | ResTable_config::UI_MODE_TYPE_DESK; return true; } else if (strcmp(name, "car") == 0) { if (out) out->uiMode = -- 2.45.2