summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2009-09-15 22:50:40 -0700
committerDianne Hackborn <hackbod@google.com>2009-09-15 22:50:40 -0700
commitb5df6d801cc154899e9f52328eb1e40e90720fa4 (patch)
tree91fd9e12967fd772589f6cc084b718a237b9b05b
parentf2f2787391cf91c1bc215d159e41c67709c30d6d (diff)
downloadframeworks_native-b5df6d801cc154899e9f52328eb1e40e90720fa4.zip
frameworks_native-b5df6d801cc154899e9f52328eb1e40e90720fa4.tar.gz
frameworks_native-b5df6d801cc154899e9f52328eb1e40e90720fa4.tar.bz2
Implement issue #1780928: Need support hiding nav keys.
This implements support for devices whose hardware can hide their navigation keys. It works much like the existing keyboardHidden configuration, and for compatibility uses the same configuration change bit. Also add FLAG_TURN_ON_SCREEN for windows, which has the system cause the screen to be turned on when the window is displayed. Great fun when used with FLAG_SHOW_WHEN_LOCKED! Change-Id: I0b867f19af85cfd8786a14cea194b34f7bdd9b7a
-rw-r--r--include/utils/ResourceTypes.h33
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;