summaryrefslogtreecommitdiffstats
path: root/core/java/android/view
diff options
context:
space:
mode:
authorPhil Tunstall <ptunstall@gmail.com>2012-07-27 12:00:44 +0100
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2012-12-10 16:50:22 -0800
commitb055725d0b1df2f23ecfa95bff940aa8b57f97df (patch)
tree582b3ee8a9dadda15505bbcae960f4badec1eacc /core/java/android/view
parentf84e114527b5c4761026b34a8d08f0284d6c2f34 (diff)
downloadframeworks_base-b055725d0b1df2f23ecfa95bff940aa8b57f97df.zip
frameworks_base-b055725d0b1df2f23ecfa95bff940aa8b57f97df.tar.gz
frameworks_base-b055725d0b1df2f23ecfa95bff940aa8b57f97df.tar.bz2
Hardware key custom rebinding (1/2)
Framework changes to allow rebinding of the actions performed on the following key press events: Home long-press, menu press, menu long-press, search press, search long-press, app-switch press and app-switch long-press. The available actions are: Nothing, open/close menu, recent apps switcher, search assistant, voice search and in-app search. Patch Set 1: Initial port from ICS [done by Konstantin Koslowski] Patch Set 2: Added 'assist' (search) key customisation Option for ICS-style in-app search, in addition to jellybean-style search assistant. Fixed double haptic feedback on virtual key press. Patch Set 3: Checkbox to enable/disable all custom bindings. Home long-press defaults to no action on devices with an app-switch key. Patch Set 4: The recent apps list will be preloaded on the initial down press of whichever key to which it is bound. Patch Set 5: Fixed menu virtual key press sometimes performing the custom action bound to the menu key instead of just opening or closing the menu as it should. Conflicts: core/res/res/values/public.xml policy/src/com/android/internal/policy/impl/PhoneWindowManager.java Change-Id: I72c0d220a09d79230bfa299e0521ed693e5c25f1
Diffstat (limited to 'core/java/android/view')
-rw-r--r--core/java/android/view/ViewConfiguration.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/java/android/view/ViewConfiguration.java b/core/java/android/view/ViewConfiguration.java
index 499075e..73295a2 100644
--- a/core/java/android/view/ViewConfiguration.java
+++ b/core/java/android/view/ViewConfiguration.java
@@ -223,6 +223,8 @@ public class ViewConfiguration {
private boolean sHasPermanentMenuKey;
private boolean sHasPermanentMenuKeySet;
+ private Context mContext;
+
static final SparseArray<ViewConfiguration> sConfigurations =
new SparseArray<ViewConfiguration>(2);
@@ -270,6 +272,8 @@ public class ViewConfiguration {
sizeAndDensity = density;
}
+ mContext = context;
+
mEdgeSlop = (int) (sizeAndDensity * EDGE_SLOP + 0.5f);
mFadingEdgeLength = (int) (sizeAndDensity * FADING_EDGE_LENGTH + 0.5f);
mMinimumFlingVelocity = (int) (density * MINIMUM_FLING_VELOCITY + 0.5f);
@@ -678,7 +682,18 @@ public class ViewConfiguration {
* @return true if a permanent menu key is present, false otherwise.
*/
public boolean hasPermanentMenuKey() {
- return sHasPermanentMenuKey;
+ // The action overflow button within app UI can
+ // be controlled with a system setting
+ int showOverflowButton = Settings.System.getInt(
+ mContext.getContentResolver(),
+ Settings.System.UI_FORCE_OVERFLOW_BUTTON, 0);
+ if (showOverflowButton == 1) {
+ // Force overflow button on by reporting that
+ // the device has no permanent menu key
+ return false;
+ } else {
+ return sHasPermanentMenuKey;
+ }
}
/**