diff options
author | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-16 02:04:45 -0400 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2009-09-16 02:04:45 -0400 |
commit | 3a94132f772e9f017d4f4f387fc0d4bee82d3d87 (patch) | |
tree | 91fd9e12967fd772589f6cc084b718a237b9b05b | |
parent | 5d59c866af0c8c90adfc785868b4d12a77cd6882 (diff) | |
parent | b5df6d801cc154899e9f52328eb1e40e90720fa4 (diff) | |
download | frameworks_native-3a94132f772e9f017d4f4f387fc0d4bee82d3d87.zip frameworks_native-3a94132f772e9f017d4f4f387fc0d4bee82d3d87.tar.gz frameworks_native-3a94132f772e9f017d4f4f387fc0d4bee82d3d87.tar.bz2 |
Merge change 25238 into eclair
* changes:
Implement issue #1780928: Need support hiding nav keys.
-rw-r--r-- | include/utils/ResourceTypes.h | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/include/utils/ResourceTypes.h b/include/utils/ResourceTypes.h index e524e2a..17ccad6 100644 --- a/include/utils/ResourceTypes.h +++ b/include/utils/ResourceTypes.h @@ -864,6 +864,13 @@ struct ResTable_config KEYSHIDDEN_SOFT = 0x0003, }; + enum { + MASK_NAVHIDDEN = 0x000c, + NAVHIDDEN_ANY = 0x0000, + NAVHIDDEN_NO = 0x0004, + NAVHIDDEN_YES = 0x0008, + }; + union { struct { uint8_t keyboard; @@ -1011,7 +1018,8 @@ struct ResTable_config if (orientation != o.orientation) diffs |= CONFIG_ORIENTATION; if (density != o.density) diffs |= CONFIG_DENSITY; if (touchscreen != o.touchscreen) diffs |= CONFIG_TOUCHSCREEN; - if (((inputFlags^o.inputFlags)&MASK_KEYSHIDDEN) != 0) diffs |= CONFIG_KEYBOARD_HIDDEN; + if (((inputFlags^o.inputFlags)&(MASK_KEYSHIDDEN|MASK_NAVHIDDEN)) != 0) + diffs |= CONFIG_KEYBOARD_HIDDEN; if (keyboard != o.keyboard) diffs |= CONFIG_KEYBOARD; if (navigation != o.navigation) diffs |= CONFIG_NAVIGATION; if (screenSize != o.screenSize) diffs |= CONFIG_SCREEN_SIZE; @@ -1082,6 +1090,11 @@ struct ResTable_config if (!(o.inputFlags & MASK_KEYSHIDDEN)) return true; } + if (((inputFlags^o.inputFlags) & MASK_NAVHIDDEN) != 0) { + if (!(inputFlags & MASK_NAVHIDDEN)) return false; + if (!(o.inputFlags & MASK_NAVHIDDEN)) return true; + } + if (keyboard != o.keyboard) { if (!keyboard) return false; if (!o.keyboard) return true; @@ -1225,6 +1238,18 @@ struct ResTable_config } } + const int navHidden = inputFlags & MASK_NAVHIDDEN; + const int oNavHidden = o.inputFlags & MASK_NAVHIDDEN; + if (navHidden != oNavHidden) { + const int reqNavHidden = + requested->inputFlags & MASK_NAVHIDDEN; + if (reqNavHidden) { + + if (!navHidden) return false; + if (!oNavHidden) return true; + } + } + if ((keyboard != o.keyboard) && requested->keyboard) { return (keyboard); } @@ -1332,6 +1357,12 @@ struct ResTable_config return false; } } + const int navHidden = inputFlags&MASK_NAVHIDDEN; + const int setNavHidden = settings.inputFlags&MASK_NAVHIDDEN; + if (setNavHidden != 0 && navHidden != 0 + && navHidden != setNavHidden) { + return false; + } if (settings.keyboard != 0 && keyboard != 0 && keyboard != settings.keyboard) { return false; |