summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMady Mellor <madym@google.com>2015-06-05 09:02:55 -0700
committerMady Mellor <madym@google.com>2015-06-05 09:02:55 -0700
commite860891b1a7d4c1b581f294fa5831999caac6506 (patch)
tree3737463446e647f20f4dcbfe127d74cc44287a2e
parent05ae9b56aec7c1a261eb84741b43e40351d20bd4 (diff)
downloadframeworks_base-e860891b1a7d4c1b581f294fa5831999caac6506.zip
frameworks_base-e860891b1a7d4c1b581f294fa5831999caac6506.tar.gz
frameworks_base-e860891b1a7d4c1b581f294fa5831999caac6506.tar.bz2
Change stylus button press to context click in View - API review feedback
Updates all references in View's onStylusButtonPress to onContextClick as per API review feedback. Additionally listens for mouse right clicks and calls the onContextClick method for these as well for the stylus button press. Bug: 21572278 Change-Id: I5c1ee8c8f23a77d7c677b86356e89d0e4fc40056
-rw-r--r--api/current.txt34
-rw-r--r--api/system-current.txt34
-rw-r--r--core/java/android/app/AssistStructure.java12
-rw-r--r--core/java/android/view/HapticFeedbackConstants.java4
-rw-r--r--core/java/android/view/View.java150
-rw-r--r--core/java/android/view/ViewStructure.java6
-rw-r--r--core/java/android/view/accessibility/AccessibilityEvent.java10
-rw-r--r--core/java/android/view/accessibility/AccessibilityNodeInfo.java28
-rw-r--r--core/res/res/values/attrs.xml8
-rwxr-xr-xcore/res/res/values/config.xml4
-rw-r--r--core/res/res/values/ids.xml4
-rw-r--r--core/res/res/values/public.xml4
-rwxr-xr-xcore/res/res/values/symbols.xml2
-rw-r--r--services/core/java/com/android/server/policy/PhoneWindowManager.java12
14 files changed, 155 insertions, 157 deletions
diff --git a/api/current.txt b/api/current.txt
index 0467b69..e08e313 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -432,6 +432,7 @@ package android {
field public static final int contentInsetLeft = 16843861; // 0x1010455
field public static final int contentInsetRight = 16843862; // 0x1010456
field public static final int contentInsetStart = 16843859; // 0x1010453
+ field public static final int contextClickable = 16844021; // 0x10104f5
field public static final int controlX1 = 16843772; // 0x10103fc
field public static final int controlX2 = 16843774; // 0x10103fe
field public static final int controlY1 = 16843773; // 0x10103fd
@@ -1177,7 +1178,6 @@ package android {
field public static final int strokeLineJoin = 16843788; // 0x101040c
field public static final int strokeMiterLimit = 16843789; // 0x101040d
field public static final int strokeWidth = 16843783; // 0x1010407
- field public static final int stylusButtonPressable = 16844021; // 0x10104f5
field public static final int submitBackground = 16843912; // 0x1010488
field public static final int subtitle = 16843473; // 0x10102d1
field public static final int subtitleTextAppearance = 16843823; // 0x101042f
@@ -1690,13 +1690,13 @@ package android {
public static final class R.id {
ctor public R.id();
+ field public static final int accessibilityActionContextClick = 16908348; // 0x102003c
field public static final int accessibilityActionScrollDown = 16908345; // 0x1020039
field public static final int accessibilityActionScrollLeft = 16908344; // 0x1020038
field public static final int accessibilityActionScrollRight = 16908346; // 0x102003a
field public static final int accessibilityActionScrollToPosition = 16908342; // 0x1020036
field public static final int accessibilityActionScrollUp = 16908343; // 0x1020037
field public static final int accessibilityActionShowOnScreen = 16908341; // 0x1020035
- field public static final int accessibilityActionStylusButtonPress = 16908348; // 0x102003c
field public static final int addToDictionary = 16908330; // 0x102002a
field public static final int background = 16908288; // 0x1020000
field public static final int button1 = 16908313; // 0x1020019
@@ -4042,12 +4042,12 @@ package android.app {
method public boolean isCheckable();
method public boolean isChecked();
method public boolean isClickable();
+ method public boolean isContextClickable();
method public boolean isEnabled();
method public boolean isFocusable();
method public boolean isFocused();
method public boolean isLongClickable();
method public boolean isSelected();
- method public boolean isStylusButtonPressable();
field public static final int TEXT_COLOR_UNDEFINED = 1; // 0x1
field public static final int TEXT_STYLE_BOLD = 1; // 0x1
field public static final int TEXT_STYLE_ITALIC = 2; // 0x2
@@ -34819,11 +34819,11 @@ package android.view {
public class HapticFeedbackConstants {
field public static final int CLOCK_TICK = 4; // 0x4
+ field public static final int CONTEXT_CLICK = 6; // 0x6
field public static final int FLAG_IGNORE_GLOBAL_SETTING = 2; // 0x2
field public static final int FLAG_IGNORE_VIEW_SETTING = 1; // 0x1
field public static final int KEYBOARD_TAP = 3; // 0x3
field public static final int LONG_PRESS = 0; // 0x0
- field public static final int STYLUS_BUTTON_PRESS = 6; // 0x6
field public static final int VIRTUAL_KEY = 1; // 0x1
}
@@ -36133,6 +36133,7 @@ package android.view {
method public boolean isActivated();
method public boolean isAttachedToWindow();
method public boolean isClickable();
+ method public boolean isContextClickable();
method public boolean isDirty();
method public boolean isDrawingCacheEnabled();
method public boolean isDuplicateParentStateEnabled();
@@ -36165,7 +36166,6 @@ package android.view {
method public boolean isSelected();
method public boolean isShown();
method public boolean isSoundEffectsEnabled();
- method public boolean isStylusButtonPressable();
method public boolean isTextAlignmentResolved();
method public boolean isTextDirectionResolved();
method public boolean isVerticalFadingEdgeEnabled();
@@ -36230,10 +36230,10 @@ package android.view {
method protected boolean overScrollBy(int, int, int, int, int, int, int, int, boolean);
method public boolean performAccessibilityAction(int, android.os.Bundle);
method public boolean performClick();
+ method public boolean performContextClick();
method public boolean performHapticFeedback(int);
method public boolean performHapticFeedback(int, int);
method public boolean performLongClick();
- method public boolean performStylusButtonPress();
method public void playSoundEffect(int);
method public boolean post(java.lang.Runnable);
method public boolean postDelayed(java.lang.Runnable, long);
@@ -36287,6 +36287,7 @@ package android.view {
method public void setClipBounds(android.graphics.Rect);
method public void setClipToOutline(boolean);
method public void setContentDescription(java.lang.CharSequence);
+ method public void setContextClickable(boolean);
method public void setDrawingCacheBackgroundColor(int);
method public void setDrawingCacheEnabled(boolean);
method public void setDrawingCacheQuality(int);
@@ -36328,6 +36329,7 @@ package android.view {
method public void setNextFocusUpId(int);
method public void setOnApplyWindowInsetsListener(android.view.View.OnApplyWindowInsetsListener);
method public void setOnClickListener(android.view.View.OnClickListener);
+ method public void setOnContextClickListener(android.view.View.OnContextClickListener);
method public void setOnCreateContextMenuListener(android.view.View.OnCreateContextMenuListener);
method public void setOnDragListener(android.view.View.OnDragListener);
method public void setOnFocusChangeListener(android.view.View.OnFocusChangeListener);
@@ -36336,7 +36338,6 @@ package android.view {
method public void setOnKeyListener(android.view.View.OnKeyListener);
method public void setOnLongClickListener(android.view.View.OnLongClickListener);
method public void setOnScrollChangeListener(android.view.View.OnScrollChangeListener);
- method public void setOnStylusButtonPressListener(android.view.View.OnStylusButtonPressListener);
method public void setOnSystemUiVisibilityChangeListener(android.view.View.OnSystemUiVisibilityChangeListener);
method public void setOnTouchListener(android.view.View.OnTouchListener);
method public void setOutlineProvider(android.view.ViewOutlineProvider);
@@ -36367,7 +36368,6 @@ package android.view {
method public void setSelected(boolean);
method public void setSoundEffectsEnabled(boolean);
method public void setStateListAnimator(android.animation.StateListAnimator);
- method public void setStylusButtonPressable(boolean);
method public void setSystemUiVisibility(int);
method public void setTag(java.lang.Object);
method public void setTag(int, java.lang.Object);
@@ -36585,6 +36585,10 @@ package android.view {
method public abstract void onClick(android.view.View);
}
+ public static abstract interface View.OnContextClickListener {
+ method public abstract boolean onContextClick(android.view.View);
+ }
+
public static abstract interface View.OnCreateContextMenuListener {
method public abstract void onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo);
}
@@ -36621,10 +36625,6 @@ package android.view {
method public abstract void onScrollChange(android.view.View, int, int, int, int);
}
- public static abstract interface View.OnStylusButtonPressListener {
- method public abstract boolean onStylusButtonPress(android.view.View);
- }
-
public static abstract interface View.OnSystemUiVisibilityChangeListener {
method public abstract void onSystemUiVisibilityChange(int);
}
@@ -37036,6 +37036,7 @@ package android.view {
method public abstract void setClassName(java.lang.String);
method public abstract void setClickable(boolean);
method public abstract void setContentDescription(java.lang.CharSequence);
+ method public abstract void setContextClickable(boolean);
method public abstract void setDimens(int, int, int, int, int, int);
method public abstract void setEnabled(boolean);
method public abstract void setFocusable(boolean);
@@ -37044,7 +37045,6 @@ package android.view {
method public abstract void setId(int, java.lang.String, java.lang.String, java.lang.String);
method public abstract void setLongClickable(boolean);
method public abstract void setSelected(boolean);
- method public abstract void setStylusButtonPressable(boolean);
method public abstract void setText(java.lang.CharSequence);
method public abstract void setText(java.lang.CharSequence, int, int);
method public abstract void setTextStyle(float, int, int, int);
@@ -37550,13 +37550,13 @@ package android.view.accessibility {
field public static final int TYPE_VIEW_ACCESSIBILITY_FOCUSED = 32768; // 0x8000
field public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED = 65536; // 0x10000
field public static final int TYPE_VIEW_CLICKED = 1; // 0x1
+ field public static final int TYPE_VIEW_CONTEXT_CLICKED = 8388608; // 0x800000
field public static final int TYPE_VIEW_FOCUSED = 8; // 0x8
field public static final int TYPE_VIEW_HOVER_ENTER = 128; // 0x80
field public static final int TYPE_VIEW_HOVER_EXIT = 256; // 0x100
field public static final int TYPE_VIEW_LONG_CLICKED = 2; // 0x2
field public static final int TYPE_VIEW_SCROLLED = 4096; // 0x1000
field public static final int TYPE_VIEW_SELECTED = 4; // 0x4
- field public static final int TYPE_VIEW_STYLUS_BUTTON_PRESSED = 8388608; // 0x800000
field public static final int TYPE_VIEW_TEXT_CHANGED = 16; // 0x10
field public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 8192; // 0x2000
field public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 131072; // 0x20000
@@ -37637,6 +37637,7 @@ package android.view.accessibility {
method public boolean isChecked();
method public boolean isClickable();
method public boolean isContentInvalid();
+ method public boolean isContextClickable();
method public boolean isDismissable();
method public boolean isEditable();
method public boolean isEnabled();
@@ -37647,7 +37648,6 @@ package android.view.accessibility {
method public boolean isPassword();
method public boolean isScrollable();
method public boolean isSelected();
- method public boolean isStylusButtonPressable();
method public boolean isVisibleToUser();
method public static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View);
method public static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View, int);
@@ -37673,6 +37673,7 @@ package android.view.accessibility {
method public void setCollectionItemInfo(android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo);
method public void setContentDescription(java.lang.CharSequence);
method public void setContentInvalid(boolean);
+ method public void setContextClickable(boolean);
method public void setDismissable(boolean);
method public void setEditable(boolean);
method public void setEnabled(boolean);
@@ -37698,7 +37699,6 @@ package android.view.accessibility {
method public void setSelected(boolean);
method public void setSource(android.view.View);
method public void setSource(android.view.View, int);
- method public void setStylusButtonPressable(boolean);
method public void setText(java.lang.CharSequence);
method public void setTextSelection(int, int);
method public void setTraversalAfter(android.view.View);
@@ -37758,6 +37758,7 @@ package android.view.accessibility {
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CLEAR_SELECTION;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CLICK;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_COLLAPSE;
+ field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CONTEXT_CLICK;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_COPY;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CUT;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_DISMISS;
@@ -37780,7 +37781,6 @@ package android.view.accessibility {
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SET_SELECTION;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SET_TEXT;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SHOW_ON_SCREEN;
- field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_STYLUS_BUTTON_PRESS;
}
public static final class AccessibilityNodeInfo.CollectionInfo {
diff --git a/api/system-current.txt b/api/system-current.txt
index d11fe85..d5c512a 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -507,6 +507,7 @@ package android {
field public static final int contentInsetLeft = 16843861; // 0x1010455
field public static final int contentInsetRight = 16843862; // 0x1010456
field public static final int contentInsetStart = 16843859; // 0x1010453
+ field public static final int contextClickable = 16844021; // 0x10104f5
field public static final int controlX1 = 16843772; // 0x10103fc
field public static final int controlX2 = 16843774; // 0x10103fe
field public static final int controlY1 = 16843773; // 0x10103fd
@@ -1256,7 +1257,6 @@ package android {
field public static final int strokeLineJoin = 16843788; // 0x101040c
field public static final int strokeMiterLimit = 16843789; // 0x101040d
field public static final int strokeWidth = 16843783; // 0x1010407
- field public static final int stylusButtonPressable = 16844021; // 0x10104f5
field public static final int submitBackground = 16843912; // 0x1010488
field public static final int subtitle = 16843473; // 0x10102d1
field public static final int subtitleTextAppearance = 16843823; // 0x101042f
@@ -1769,13 +1769,13 @@ package android {
public static final class R.id {
ctor public R.id();
+ field public static final int accessibilityActionContextClick = 16908348; // 0x102003c
field public static final int accessibilityActionScrollDown = 16908345; // 0x1020039
field public static final int accessibilityActionScrollLeft = 16908344; // 0x1020038
field public static final int accessibilityActionScrollRight = 16908346; // 0x102003a
field public static final int accessibilityActionScrollToPosition = 16908342; // 0x1020036
field public static final int accessibilityActionScrollUp = 16908343; // 0x1020037
field public static final int accessibilityActionShowOnScreen = 16908341; // 0x1020035
- field public static final int accessibilityActionStylusButtonPress = 16908348; // 0x102003c
field public static final int addToDictionary = 16908330; // 0x102002a
field public static final int background = 16908288; // 0x1020000
field public static final int button1 = 16908313; // 0x1020019
@@ -4138,12 +4138,12 @@ package android.app {
method public boolean isCheckable();
method public boolean isChecked();
method public boolean isClickable();
+ method public boolean isContextClickable();
method public boolean isEnabled();
method public boolean isFocusable();
method public boolean isFocused();
method public boolean isLongClickable();
method public boolean isSelected();
- method public boolean isStylusButtonPressable();
field public static final int TEXT_COLOR_UNDEFINED = 1; // 0x1
field public static final int TEXT_STYLE_BOLD = 1; // 0x1
field public static final int TEXT_STYLE_ITALIC = 2; // 0x2
@@ -37084,11 +37084,11 @@ package android.view {
public class HapticFeedbackConstants {
field public static final int CLOCK_TICK = 4; // 0x4
+ field public static final int CONTEXT_CLICK = 6; // 0x6
field public static final int FLAG_IGNORE_GLOBAL_SETTING = 2; // 0x2
field public static final int FLAG_IGNORE_VIEW_SETTING = 1; // 0x1
field public static final int KEYBOARD_TAP = 3; // 0x3
field public static final int LONG_PRESS = 0; // 0x0
- field public static final int STYLUS_BUTTON_PRESS = 6; // 0x6
field public static final int VIRTUAL_KEY = 1; // 0x1
}
@@ -38398,6 +38398,7 @@ package android.view {
method public boolean isActivated();
method public boolean isAttachedToWindow();
method public boolean isClickable();
+ method public boolean isContextClickable();
method public boolean isDirty();
method public boolean isDrawingCacheEnabled();
method public boolean isDuplicateParentStateEnabled();
@@ -38430,7 +38431,6 @@ package android.view {
method public boolean isSelected();
method public boolean isShown();
method public boolean isSoundEffectsEnabled();
- method public boolean isStylusButtonPressable();
method public boolean isTextAlignmentResolved();
method public boolean isTextDirectionResolved();
method public boolean isVerticalFadingEdgeEnabled();
@@ -38495,10 +38495,10 @@ package android.view {
method protected boolean overScrollBy(int, int, int, int, int, int, int, int, boolean);
method public boolean performAccessibilityAction(int, android.os.Bundle);
method public boolean performClick();
+ method public boolean performContextClick();
method public boolean performHapticFeedback(int);
method public boolean performHapticFeedback(int, int);
method public boolean performLongClick();
- method public boolean performStylusButtonPress();
method public void playSoundEffect(int);
method public boolean post(java.lang.Runnable);
method public boolean postDelayed(java.lang.Runnable, long);
@@ -38552,6 +38552,7 @@ package android.view {
method public void setClipBounds(android.graphics.Rect);
method public void setClipToOutline(boolean);
method public void setContentDescription(java.lang.CharSequence);
+ method public void setContextClickable(boolean);
method public void setDrawingCacheBackgroundColor(int);
method public void setDrawingCacheEnabled(boolean);
method public void setDrawingCacheQuality(int);
@@ -38593,6 +38594,7 @@ package android.view {
method public void setNextFocusUpId(int);
method public void setOnApplyWindowInsetsListener(android.view.View.OnApplyWindowInsetsListener);
method public void setOnClickListener(android.view.View.OnClickListener);
+ method public void setOnContextClickListener(android.view.View.OnContextClickListener);
method public void setOnCreateContextMenuListener(android.view.View.OnCreateContextMenuListener);
method public void setOnDragListener(android.view.View.OnDragListener);
method public void setOnFocusChangeListener(android.view.View.OnFocusChangeListener);
@@ -38601,7 +38603,6 @@ package android.view {
method public void setOnKeyListener(android.view.View.OnKeyListener);
method public void setOnLongClickListener(android.view.View.OnLongClickListener);
method public void setOnScrollChangeListener(android.view.View.OnScrollChangeListener);
- method public void setOnStylusButtonPressListener(android.view.View.OnStylusButtonPressListener);
method public void setOnSystemUiVisibilityChangeListener(android.view.View.OnSystemUiVisibilityChangeListener);
method public void setOnTouchListener(android.view.View.OnTouchListener);
method public void setOutlineProvider(android.view.ViewOutlineProvider);
@@ -38632,7 +38633,6 @@ package android.view {
method public void setSelected(boolean);
method public void setSoundEffectsEnabled(boolean);
method public void setStateListAnimator(android.animation.StateListAnimator);
- method public void setStylusButtonPressable(boolean);
method public void setSystemUiVisibility(int);
method public void setTag(java.lang.Object);
method public void setTag(int, java.lang.Object);
@@ -38850,6 +38850,10 @@ package android.view {
method public abstract void onClick(android.view.View);
}
+ public static abstract interface View.OnContextClickListener {
+ method public abstract boolean onContextClick(android.view.View);
+ }
+
public static abstract interface View.OnCreateContextMenuListener {
method public abstract void onCreateContextMenu(android.view.ContextMenu, android.view.View, android.view.ContextMenu.ContextMenuInfo);
}
@@ -38886,10 +38890,6 @@ package android.view {
method public abstract void onScrollChange(android.view.View, int, int, int, int);
}
- public static abstract interface View.OnStylusButtonPressListener {
- method public abstract boolean onStylusButtonPress(android.view.View);
- }
-
public static abstract interface View.OnSystemUiVisibilityChangeListener {
method public abstract void onSystemUiVisibilityChange(int);
}
@@ -39301,6 +39301,7 @@ package android.view {
method public abstract void setClassName(java.lang.String);
method public abstract void setClickable(boolean);
method public abstract void setContentDescription(java.lang.CharSequence);
+ method public abstract void setContextClickable(boolean);
method public abstract void setDimens(int, int, int, int, int, int);
method public abstract void setEnabled(boolean);
method public abstract void setFocusable(boolean);
@@ -39309,7 +39310,6 @@ package android.view {
method public abstract void setId(int, java.lang.String, java.lang.String, java.lang.String);
method public abstract void setLongClickable(boolean);
method public abstract void setSelected(boolean);
- method public abstract void setStylusButtonPressable(boolean);
method public abstract void setText(java.lang.CharSequence);
method public abstract void setText(java.lang.CharSequence, int, int);
method public abstract void setTextStyle(float, int, int, int);
@@ -39818,13 +39818,13 @@ package android.view.accessibility {
field public static final int TYPE_VIEW_ACCESSIBILITY_FOCUSED = 32768; // 0x8000
field public static final int TYPE_VIEW_ACCESSIBILITY_FOCUS_CLEARED = 65536; // 0x10000
field public static final int TYPE_VIEW_CLICKED = 1; // 0x1
+ field public static final int TYPE_VIEW_CONTEXT_CLICKED = 8388608; // 0x800000
field public static final int TYPE_VIEW_FOCUSED = 8; // 0x8
field public static final int TYPE_VIEW_HOVER_ENTER = 128; // 0x80
field public static final int TYPE_VIEW_HOVER_EXIT = 256; // 0x100
field public static final int TYPE_VIEW_LONG_CLICKED = 2; // 0x2
field public static final int TYPE_VIEW_SCROLLED = 4096; // 0x1000
field public static final int TYPE_VIEW_SELECTED = 4; // 0x4
- field public static final int TYPE_VIEW_STYLUS_BUTTON_PRESSED = 8388608; // 0x800000
field public static final int TYPE_VIEW_TEXT_CHANGED = 16; // 0x10
field public static final int TYPE_VIEW_TEXT_SELECTION_CHANGED = 8192; // 0x2000
field public static final int TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY = 131072; // 0x20000
@@ -39905,6 +39905,7 @@ package android.view.accessibility {
method public boolean isChecked();
method public boolean isClickable();
method public boolean isContentInvalid();
+ method public boolean isContextClickable();
method public boolean isDismissable();
method public boolean isEditable();
method public boolean isEnabled();
@@ -39915,7 +39916,6 @@ package android.view.accessibility {
method public boolean isPassword();
method public boolean isScrollable();
method public boolean isSelected();
- method public boolean isStylusButtonPressable();
method public boolean isVisibleToUser();
method public static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View);
method public static android.view.accessibility.AccessibilityNodeInfo obtain(android.view.View, int);
@@ -39941,6 +39941,7 @@ package android.view.accessibility {
method public void setCollectionItemInfo(android.view.accessibility.AccessibilityNodeInfo.CollectionItemInfo);
method public void setContentDescription(java.lang.CharSequence);
method public void setContentInvalid(boolean);
+ method public void setContextClickable(boolean);
method public void setDismissable(boolean);
method public void setEditable(boolean);
method public void setEnabled(boolean);
@@ -39966,7 +39967,6 @@ package android.view.accessibility {
method public void setSelected(boolean);
method public void setSource(android.view.View);
method public void setSource(android.view.View, int);
- method public void setStylusButtonPressable(boolean);
method public void setText(java.lang.CharSequence);
method public void setTextSelection(int, int);
method public void setTraversalAfter(android.view.View);
@@ -40026,6 +40026,7 @@ package android.view.accessibility {
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CLEAR_SELECTION;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CLICK;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_COLLAPSE;
+ field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CONTEXT_CLICK;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_COPY;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_CUT;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_DISMISS;
@@ -40048,7 +40049,6 @@ package android.view.accessibility {
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SET_SELECTION;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SET_TEXT;
field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_SHOW_ON_SCREEN;
- field public static final android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction ACTION_STYLUS_BUTTON_PRESS;
}
public static final class AccessibilityNodeInfo.CollectionInfo {
diff --git a/core/java/android/app/AssistStructure.java b/core/java/android/app/AssistStructure.java
index ef7fde4..0f69817 100644
--- a/core/java/android/app/AssistStructure.java
+++ b/core/java/android/app/AssistStructure.java
@@ -235,7 +235,7 @@ public class AssistStructure {
static final int FLAGS_CHECKED = 0x00000200;
static final int FLAGS_CLICKABLE = 0x00004000;
static final int FLAGS_LONG_CLICKABLE = 0x00200000;
- static final int FLAGS_STYLUS_BUTTON_PRESSABLE = 0x00400000;
+ static final int FLAGS_CONTEXT_CLICKABLE = 0x00400000;
int mFlags;
@@ -413,8 +413,8 @@ public class AssistStructure {
return (mFlags&ViewNode.FLAGS_LONG_CLICKABLE) != 0;
}
- public boolean isStylusButtonPressable() {
- return (mFlags&ViewNode.FLAGS_STYLUS_BUTTON_PRESSABLE) != 0;
+ public boolean isContextClickable() {
+ return (mFlags&ViewNode.FLAGS_CONTEXT_CLICKABLE) != 0;
}
public String getClassName() {
@@ -529,9 +529,9 @@ public class AssistStructure {
}
@Override
- public void setStylusButtonPressable(boolean state) {
- mNode.mFlags = (mNode.mFlags&~ViewNode.FLAGS_STYLUS_BUTTON_PRESSABLE)
- | (state ? ViewNode.FLAGS_STYLUS_BUTTON_PRESSABLE : 0);
+ public void setContextClickable(boolean state) {
+ mNode.mFlags = (mNode.mFlags&~ViewNode.FLAGS_CONTEXT_CLICKABLE)
+ | (state ? ViewNode.FLAGS_CONTEXT_CLICKABLE : 0);
}
@Override
diff --git a/core/java/android/view/HapticFeedbackConstants.java b/core/java/android/view/HapticFeedbackConstants.java
index 6651b83..2f87d2e 100644
--- a/core/java/android/view/HapticFeedbackConstants.java
+++ b/core/java/android/view/HapticFeedbackConstants.java
@@ -52,9 +52,9 @@ public class HapticFeedbackConstants {
public static final int CALENDAR_DATE = 5;
/**
- * The user has touched the screen with a stylus and pressed the stylus button.
+ * The user has performed a context click on an object.
*/
- public static final int STYLUS_BUTTON_PRESS = 6;
+ public static final int CONTEXT_CLICK = 6;
/**
* This is a private constant. Feel free to renumber as desired.
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 126540f..84ddeff 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -990,13 +990,13 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
/**
* <p>
- * Indicates this view can be stylus button pressed. When stylus button
- * pressable, a View reacts to stylus button presses by notifiying
- * the OnStylusButtonPressListener.
+ * Indicates this view can be context clicked. When context clickable, a View reacts to a
+ * context click (e.g. a primary stylus button press or right mouse click) by notifying the
+ * OnContextClickListener.
* </p>
* {@hide}
*/
- static final int STYLUS_BUTTON_PRESSABLE = 0x00800000;
+ static final int CONTEXT_CLICKABLE = 0x00800000;
/** @hide */
@@ -3418,11 +3418,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
protected OnLongClickListener mOnLongClickListener;
/**
- * Listener used to dispatch stylus touch and button press events. This field should be made
- * private, so it is hidden from the SDK.
+ * Listener used to dispatch context click events. This field should be made private, so it
+ * is hidden from the SDK.
* {@hide}
*/
- protected OnStylusButtonPressListener mOnStylusButtonPressListener;
+ protected OnContextClickListener mOnContextClickListener;
/**
* Listener used to build the context menu.
@@ -3515,11 +3515,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
private boolean mHasPerformedLongPress;
/**
- * Whether the stylus button is currently pressed down. This is true when
- * the stylus is touching the screen and the button has been pressed, this
- * is false once the stylus has been lifted.
+ * Whether a context click button is currently pressed down. This is true when the stylus is
+ * touching the screen and the primary button has been pressed, or if a mouse's right button is
+ * pressed. This is false once the button is released or if the stylus has been lifted.
*/
- private boolean mInStylusButtonPress;
+ private boolean mInContextButtonPress;
/**
* Whether the next up event should be ignored for the purposes of gesture recognition. This is
@@ -4045,10 +4045,10 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
viewFlagMasks |= LONG_CLICKABLE;
}
break;
- case com.android.internal.R.styleable.View_stylusButtonPressable:
+ case com.android.internal.R.styleable.View_contextClickable:
if (a.getBoolean(attr, false)) {
- viewFlagValues |= STYLUS_BUTTON_PRESSABLE;
- viewFlagMasks |= STYLUS_BUTTON_PRESSABLE;
+ viewFlagValues |= CONTEXT_CLICKABLE;
+ viewFlagMasks |= CONTEXT_CLICKABLE;
}
break;
case com.android.internal.R.styleable.View_saveEnabled:
@@ -4537,7 +4537,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
out.append((mViewFlags&SCROLLBARS_VERTICAL) != 0 ? 'V' : '.');
out.append((mViewFlags&CLICKABLE) != 0 ? 'C' : '.');
out.append((mViewFlags&LONG_CLICKABLE) != 0 ? 'L' : '.');
- out.append((mViewFlags & STYLUS_BUTTON_PRESSABLE) != 0 ? 'S' : '.');
+ out.append((mViewFlags&CONTEXT_CLICKABLE) != 0 ? 'X' : '.');
out.append(' ');
out.append((mPrivateFlags&PFLAG_IS_ROOT_NAMESPACE) != 0 ? 'R' : '.');
out.append((mPrivateFlags&PFLAG_FOCUSED) != 0 ? 'F' : '.');
@@ -5125,17 +5125,17 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
- * Register a callback to be invoked when this view is touched with a stylus and the button is
- * pressed.
+ * Register a callback to be invoked when this view is context clicked. If the view is not
+ * context clickable, it becomes context clickable.
*
* @param l The callback that will run
- * @see #setStylusButtonPressable(boolean)
+ * @see #setContextClickable(boolean)
*/
- public void setOnStylusButtonPressListener(@Nullable OnStylusButtonPressListener l) {
- if (!isStylusButtonPressable()) {
- setStylusButtonPressable(true);
+ public void setOnContextClickListener(@Nullable OnContextClickListener l) {
+ if (!isContextClickable()) {
+ setContextClickable(true);
}
- getListenerInfo().mOnStylusButtonPressListener = l;
+ getListenerInfo().mOnContextClickListener = l;
}
/**
@@ -5216,21 +5216,21 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
- * Call this view's OnStylusButtonPressListener, if it is defined.
+ * Call this view's OnContextClickListener, if it is defined.
*
- * @return True if there was an assigned OnStylusButtonPressListener that consumed the event,
- * false otherwise.
+ * @return True if there was an assigned OnContextClickListener that consumed the event, false
+ * otherwise.
*/
- public boolean performStylusButtonPress() {
- sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_STYLUS_BUTTON_PRESSED);
+ public boolean performContextClick() {
+ sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CONTEXT_CLICKED);
boolean handled = false;
ListenerInfo li = mListenerInfo;
- if (li != null && li.mOnStylusButtonPressListener != null) {
- handled = li.mOnStylusButtonPressListener.onStylusButtonPress(View.this);
+ if (li != null && li.mOnContextClickListener != null) {
+ handled = li.mOnContextClickListener.onContextClick(View.this);
}
if (handled) {
- performHapticFeedback(HapticFeedbackConstants.STYLUS_BUTTON_PRESS);
+ performHapticFeedback(HapticFeedbackConstants.CONTEXT_CLICK);
}
return handled;
}
@@ -6025,7 +6025,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
* <li>{@link AccessibilityNodeInfo#setFocused(boolean)},</li>
* <li>{@link AccessibilityNodeInfo#setLongClickable(boolean)},</li>
* <li>{@link AccessibilityNodeInfo#setSelected(boolean)},</li>
- * <li>{@link AccessibilityNodeInfo#setStylusButtonPressable(boolean)}</li>
+ * <li>{@link AccessibilityNodeInfo#setContextClickable(boolean)}</li>
* </ul>
* <p>
* Subclasses should override this method, call the super implementation,
@@ -6177,8 +6177,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
structure.setChecked(true);
}
}
- if (isStylusButtonPressable()) {
- structure.setStylusButtonPressable(true);
+ if (isContextClickable()) {
+ structure.setContextClickable(true);
}
structure.setClassName(getAccessibilityClassName().toString());
structure.setContentDescription(getContentDescription());
@@ -6247,8 +6247,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
structure.setChecked(true);
}
}
- if (info.isStylusButtonPressable()) {
- structure.setStylusButtonPressable(true);
+ if (info.isContextClickable()) {
+ structure.setContextClickable(true);
}
CharSequence cname = info.getClassName();
structure.setClassName(cname != null ? cname.toString() : null);
@@ -6379,7 +6379,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
info.setAccessibilityFocused(isAccessibilityFocused());
info.setSelected(isSelected());
info.setLongClickable(isLongClickable());
- info.setStylusButtonPressable(isStylusButtonPressable());
+ info.setContextClickable(isContextClickable());
info.setLiveRegion(getAccessibilityLiveRegion());
// TODO: These make sense only if we are in an AdapterView but all
@@ -6410,8 +6410,8 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
info.addAction(AccessibilityNodeInfo.ACTION_LONG_CLICK);
}
- if (isStylusButtonPressable() && isEnabled()) {
- info.addAction(AccessibilityAction.ACTION_STYLUS_BUTTON_PRESS);
+ if (isContextClickable() && isEnabled()) {
+ info.addAction(AccessibilityAction.ACTION_CONTEXT_CLICK);
}
CharSequence text = getIterableTextForAccessibility();
@@ -7801,28 +7801,25 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
- * Indicates whether this view reacts to stylus button press events or not.
+ * Indicates whether this view reacts to context clicks or not.
*
- * @return true if the view is stylus button pressable, false otherwise
- * @see #setStylusButtonPressable(boolean)
- * @attr ref android.R.styleable#View_stylusButtonPressable
+ * @return true if the view is context clickable, false otherwise
+ * @see #setContextClickable(boolean)
+ * @attr ref android.R.styleable#View_contextClickable
*/
- public boolean isStylusButtonPressable() {
- return (mViewFlags & STYLUS_BUTTON_PRESSABLE) == STYLUS_BUTTON_PRESSABLE;
+ public boolean isContextClickable() {
+ return (mViewFlags & CONTEXT_CLICKABLE) == CONTEXT_CLICKABLE;
}
/**
- * Enables or disables stylus button press events for this view. When a view is stylus button
- * pressable it reacts to the user touching the screen with a stylus and pressing the first
- * stylus button. This event can launch the listener.
+ * Enables or disables context clicking for this view. This event can launch the listener.
*
- * @param stylusButtonPressable true to make the view react to a stylus button press, false
- * otherwise
- * @see #isStylusButtonPressable()
- * @attr ref android.R.styleable#View_stylusButtonPressable
+ * @param contextClickable true to make the view react to a context click, false otherwise
+ * @see #isContextClickable()
+ * @attr ref android.R.styleable#View_contextClickable
*/
- public void setStylusButtonPressable(boolean stylusButtonPressable) {
- setFlags(stylusButtonPressable ? STYLUS_BUTTON_PRESSABLE : 0, STYLUS_BUTTON_PRESSABLE);
+ public void setContextClickable(boolean contextClickable) {
+ setFlags(contextClickable ? CONTEXT_CLICKABLE : 0, CONTEXT_CLICKABLE);
}
/**
@@ -8243,7 +8240,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
final int viewFlags = mViewFlags;
if (((viewFlags & CLICKABLE) == CLICKABLE || (viewFlags & LONG_CLICKABLE) == LONG_CLICKABLE
- || (viewFlags & STYLUS_BUTTON_PRESSABLE) == STYLUS_BUTTON_PRESSABLE)
+ || (viewFlags & CONTEXT_CLICKABLE) == CONTEXT_CLICKABLE)
&& (viewFlags & ENABLED_MASK) == ENABLED) {
views.add(this);
}
@@ -8962,9 +8959,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
return requestRectangleOnScreen(r, true);
}
} break;
- case R.id.accessibilityActionStylusButtonPress: {
- if (isStylusButtonPressable()) {
- performStylusButtonPress();
+ case R.id.accessibilityActionContextClick: {
+ if (isContextClickable()) {
+ performContextClick();
return true;
}
} break;
@@ -9369,12 +9366,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
return true;
}
+ final int actionButton = event.getActionButton();
switch (event.getActionMasked()) {
case MotionEvent.ACTION_BUTTON_PRESS:
- if (isStylusButtonPressable() && !mInStylusButtonPress && !mHasPerformedLongPress
- && event.getActionButton() == MotionEvent.BUTTON_STYLUS_PRIMARY) {
- if (performStylusButtonPress()) {
- mInStylusButtonPress = true;
+ if (isContextClickable() && !mInContextButtonPress && !mHasPerformedLongPress
+ && (actionButton == MotionEvent.BUTTON_STYLUS_PRIMARY
+ || actionButton == MotionEvent.BUTTON_SECONDARY)) {
+ if (performContextClick()) {
+ mInContextButtonPress = true;
setPressed(true, event.getX(), event.getY());
removeTapCallback();
removeLongPressCallback();
@@ -9384,9 +9383,9 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
break;
case MotionEvent.ACTION_BUTTON_RELEASE:
- if (mInStylusButtonPress
- && event.getActionButton() == MotionEvent.BUTTON_STYLUS_PRIMARY) {
- mInStylusButtonPress = false;
+ if (mInContextButtonPress && (actionButton == MotionEvent.BUTTON_STYLUS_PRIMARY
+ || actionButton == MotionEvent.BUTTON_SECONDARY)) {
+ mInContextButtonPress = false;
mIgnoreNextUpEvent = true;
}
break;
@@ -10145,7 +10144,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
return (viewFlags & CLICKABLE) == CLICKABLE
|| (viewFlags & LONG_CLICKABLE) == LONG_CLICKABLE
- || (viewFlags & STYLUS_BUTTON_PRESSABLE) == STYLUS_BUTTON_PRESSABLE;
+ || (viewFlags & CONTEXT_CLICKABLE) == CONTEXT_CLICKABLE;
}
/**
@@ -10238,7 +10237,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
// events, it just doesn't respond to them.
return (((viewFlags & CLICKABLE) == CLICKABLE
|| (viewFlags & LONG_CLICKABLE) == LONG_CLICKABLE)
- || (viewFlags & STYLUS_BUTTON_PRESSABLE) == STYLUS_BUTTON_PRESSABLE);
+ || (viewFlags & CONTEXT_CLICKABLE) == CONTEXT_CLICKABLE);
}
if (mTouchDelegate != null) {
@@ -10249,7 +10248,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (((viewFlags & CLICKABLE) == CLICKABLE ||
(viewFlags & LONG_CLICKABLE) == LONG_CLICKABLE) ||
- (viewFlags & STYLUS_BUTTON_PRESSABLE) == STYLUS_BUTTON_PRESSABLE) {
+ (viewFlags & CONTEXT_CLICKABLE) == CONTEXT_CLICKABLE) {
switch (action) {
case MotionEvent.ACTION_UP:
boolean prepressed = (mPrivateFlags & PFLAG_PREPRESSED) != 0;
@@ -10335,7 +10334,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
setPressed(false);
removeTapCallback();
removeLongPressCallback();
- mInStylusButtonPress = false;
+ mInContextButtonPress = false;
mHasPerformedLongPress = false;
mIgnoreNextUpEvent = false;
break;
@@ -10643,7 +10642,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
if (accessibilityEnabled) {
if ((changed & FOCUSABLE_MASK) != 0 || (changed & VISIBILITY_MASK) != 0
|| (changed & CLICKABLE) != 0 || (changed & LONG_CLICKABLE) != 0
- || (changed & STYLUS_BUTTON_PRESSABLE) != 0) {
+ || (changed & CONTEXT_CLICKABLE) != 0) {
if (oldIncludeForAccessibility != includeForAccessibility()) {
notifySubtreeAccessibilityStateChangedIfNeeded();
} else {
@@ -21301,17 +21300,16 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
}
/**
- * Interface definition for a callback to be invoked when a view is touched with a stylus while
- * the stylus button is pressed.
+ * Interface definition for a callback to be invoked when a view is context clicked.
*/
- public interface OnStylusButtonPressListener {
+ public interface OnContextClickListener {
/**
- * Called when a view is touched with a stylus while the stylus button is pressed.
+ * Called when a view is context clicked.
*
- * @param v The view that was touched.
- * @return true if the callback consumed the stylus button press, false otherwise.
+ * @param v The view that has been context clicked.
+ * @return true if the callback consumed the context click, false otherwise.
*/
- boolean onStylusButtonPress(View v);
+ boolean onContextClick(View v);
}
/**
diff --git a/core/java/android/view/ViewStructure.java b/core/java/android/view/ViewStructure.java
index e525474..8ceb166 100644
--- a/core/java/android/view/ViewStructure.java
+++ b/core/java/android/view/ViewStructure.java
@@ -75,10 +75,10 @@ public abstract class ViewStructure {
public abstract void setLongClickable(boolean state);
/**
- * Set the stylus button pressable state of this view, as per
- * {@link View#isStylusButtonPressable View.isStylusButtonPressable()}.
+ * Set the context clickable state of this view, as per
+ * {@link View#isContextClickable View.isContextClickable()}.
*/
- public abstract void setStylusButtonPressable(boolean state);
+ public abstract void setContextClickable(boolean state);
/**
* Set the focusable state of this view, as per {@link View#isFocusable View.isFocusable()}.
diff --git a/core/java/android/view/accessibility/AccessibilityEvent.java b/core/java/android/view/accessibility/AccessibilityEvent.java
index b0dbeca..ab793e0 100644
--- a/core/java/android/view/accessibility/AccessibilityEvent.java
+++ b/core/java/android/view/accessibility/AccessibilityEvent.java
@@ -684,9 +684,9 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
public static final int TYPE_WINDOWS_CHANGED = 0x00400000;
/**
- * Represents the event of a stylus button press on a {@link android.view.View}.
+ * Represents the event of a context click on a {@link android.view.View}.
*/
- public static final int TYPE_VIEW_STYLUS_BUTTON_PRESSED = 0x00800000;
+ public static final int TYPE_VIEW_CONTEXT_CLICKED = 0x00800000;
/**
* Change type for {@link #TYPE_WINDOW_CONTENT_CHANGED} event:
@@ -736,7 +736,7 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
* @see #TYPE_TOUCH_INTERACTION_START
* @see #TYPE_TOUCH_INTERACTION_END
* @see #TYPE_WINDOWS_CHANGED
- * @see #TYPE_VIEW_STYLUS_BUTTON_PRESSED
+ * @see #TYPE_VIEW_CONTEXT_CLICKED
*/
public static final int TYPES_ALL_MASK = 0xFFFFFFFF;
@@ -1402,11 +1402,11 @@ public final class AccessibilityEvent extends AccessibilityRecord implements Par
builder.append("TYPE_WINDOWS_CHANGED");
eventTypeCount++;
} break;
- case TYPE_VIEW_STYLUS_BUTTON_PRESSED: {
+ case TYPE_VIEW_CONTEXT_CLICKED: {
if (eventTypeCount > 0) {
builder.append(", ");
}
- builder.append("TYPE_VIEW_STYLUS_BUTTON_PRESSED");
+ builder.append("TYPE_VIEW_CONTEXT_CLICKED");
eventTypeCount++;
}
break;
diff --git a/core/java/android/view/accessibility/AccessibilityNodeInfo.java b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
index b454d1c..36de8f3 100644
--- a/core/java/android/view/accessibility/AccessibilityNodeInfo.java
+++ b/core/java/android/view/accessibility/AccessibilityNodeInfo.java
@@ -520,7 +520,7 @@ public class AccessibilityNodeInfo implements Parcelable {
private static final int BOOLEAN_PROPERTY_CONTENT_INVALID = 0x00010000;
- private static final int BOOLEAN_PROPERTY_STYLUS_BUTTON_PRESSABLE = 0x00020000;
+ private static final int BOOLEAN_PROPERTY_CONTEXT_CLICKABLE = 0x00020000;
/**
* Bits that provide the id of a virtual descendant of a view.
@@ -1945,27 +1945,27 @@ public class AccessibilityNodeInfo implements Parcelable {
}
/**
- * Gets whether this node is stylus button pressable.
+ * Gets whether this node is context clickable.
*
- * @return True if the node is stylus button pressable.
+ * @return True if the node is context clickable.
*/
- public boolean isStylusButtonPressable() {
- return getBooleanProperty(BOOLEAN_PROPERTY_STYLUS_BUTTON_PRESSABLE);
+ public boolean isContextClickable() {
+ return getBooleanProperty(BOOLEAN_PROPERTY_CONTEXT_CLICKABLE);
}
/**
- * Sets whether this node is stylus button pressable.
+ * Sets whether this node is context clickable.
* <p>
* <strong>Note:</strong> Cannot be called from an
* {@link android.accessibilityservice.AccessibilityService}. This class is made immutable
* before being delivered to an AccessibilityService.
* </p>
*
- * @param stylusButtonPressable True if the node is stylus button pressable.
+ * @param contextClickable True if the node is context clickable.
* @throws IllegalStateException If called from an AccessibilityService.
*/
- public void setStylusButtonPressable(boolean stylusButtonPressable) {
- setBooleanProperty(BOOLEAN_PROPERTY_STYLUS_BUTTON_PRESSABLE, stylusButtonPressable);
+ public void setContextClickable(boolean contextClickable) {
+ setBooleanProperty(BOOLEAN_PROPERTY_CONTEXT_CLICKABLE, contextClickable);
}
/**
@@ -3156,7 +3156,7 @@ public class AccessibilityNodeInfo implements Parcelable {
builder.append("; selected: ").append(isSelected());
builder.append("; clickable: ").append(isClickable());
builder.append("; longClickable: ").append(isLongClickable());
- builder.append("; stylusButtonPressable: ").append(isStylusButtonPressable());
+ builder.append("; contextClickable: ").append(isContextClickable());
builder.append("; enabled: ").append(isEnabled());
builder.append("; password: ").append(isPassword());
builder.append("; scrollable: ").append(isScrollable());
@@ -3537,10 +3537,10 @@ public class AccessibilityNodeInfo implements Parcelable {
new AccessibilityAction(R.id.accessibilityActionScrollRight, null);
/**
- * Action that stylus button presses the node.
+ * Action that context clicks the node.
*/
- public static final AccessibilityAction ACTION_STYLUS_BUTTON_PRESS =
- new AccessibilityAction(R.id.accessibilityActionStylusButtonPress, null);
+ public static final AccessibilityAction ACTION_CONTEXT_CLICK =
+ new AccessibilityAction(R.id.accessibilityActionContextClick, null);
private static final ArraySet<AccessibilityAction> sStandardActions = new ArraySet<>();
static {
@@ -3572,7 +3572,7 @@ public class AccessibilityNodeInfo implements Parcelable {
sStandardActions.add(ACTION_SCROLL_LEFT);
sStandardActions.add(ACTION_SCROLL_DOWN);
sStandardActions.add(ACTION_SCROLL_RIGHT);
- sStandardActions.add(ACTION_STYLUS_BUTTON_PRESS);
+ sStandardActions.add(ACTION_CONTEXT_CLICK);
}
private final int mActionId;
diff --git a/core/res/res/values/attrs.xml b/core/res/res/values/attrs.xml
index a65c5c1..26c5241 100644
--- a/core/res/res/values/attrs.xml
+++ b/core/res/res/values/attrs.xml
@@ -2336,8 +2336,8 @@
<!-- Defines whether this view reacts to long click events. -->
<attr name="longClickable" format="boolean" />
- <!-- Defines whether this view reacts to stylus button press events. -->
- <attr name="stylusButtonPressable" format="boolean" />
+ <!-- Defines whether this view reacts to context click events. -->
+ <attr name="contextClickable" format="boolean" />
<!-- If false, no state will be saved for this view when it is being
frozen. The default is true, allowing the view to be saved
@@ -3103,8 +3103,8 @@
<flag name="typeTouchInteractionEnd" value="0x00200000" />
<!-- Receives {@link android.view.accessibility.AccessibilityEvent#TYPE_WINDOWS_CHANGED} events. -->
<flag name="typeWindowsChanged" value="0x00400000" />
- <!-- Receives {@link android.view.accessibility.AccessibilityEvent#TYPE_VIEW_STYLUS_BUTTON_PRESSED} events. -->
- <flag name="typeStylusButtonPressed" value="0x00800000" />
+ <!-- Receives {@link android.view.accessibility.AccessibilityEvent#TYPE_VIEW_CONTEXT_CLICKED} events. -->
+ <flag name="typeContextClicked" value="0x00800000" />
<!-- Receives {@link android.view.accessibility.AccessibilityEvent#TYPES_ALL_MASK} i.e. all events. -->
<flag name="typeAllMask" value="0xffffffff" />
</attr>
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 0310bea..db1ac44 100755
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -783,8 +783,8 @@
<item>10</item>
</integer-array>
- <!-- Vibrator pattern for feedback about a stylus button press -->
- <integer-array name="config_stylusButtonPressVibePattern">
+ <!-- Vibrator pattern for feedback about a context click -->
+ <integer-array name="config_contextClickVibePattern">
<item>0</item>
<item>1</item>
<item>20</item>
diff --git a/core/res/res/values/ids.xml b/core/res/res/values/ids.xml
index fca1285..c96c57c 100644
--- a/core/res/res/values/ids.xml
+++ b/core/res/res/values/ids.xml
@@ -114,6 +114,6 @@
<!-- Accessibility action identifier for {@link android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction#ACTION_SCROLL_RIGHT}. -->
<item type="id" name="accessibilityActionScrollRight" />
- <!-- Accessibility action identifier for {@link android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction#ACTION_STYLUS_BUTTON_PRESS}. -->
- <item type="id" name="accessibilityActionStylusButtonPress" />
+ <!-- Accessibility action identifier for {@link android.view.accessibility.AccessibilityNodeInfo.AccessibilityAction#ACTION_CONTEXT_CLICK}. -->
+ <item type="id" name="accessibilityActionContextClick" />
</resources>
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index 1600e97..1214ed5 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2656,7 +2656,7 @@
<public type="id" name="accessibilityActionScrollDown" />
<public type="id" name="accessibilityActionScrollRight" />
<public type="id" name="shareText" />
- <public type="id" name="accessibilityActionStylusButtonPress" />
+ <public type="id" name="accessibilityActionContextClick" />
<public type="attr" name="allowUndo" />
<public type="attr" name="colorBackgroundFloating" />
@@ -2685,7 +2685,7 @@
<attr name="__reserved0" format="boolean" />
<public type="attr" name="__reserved0" />
- <public type="attr" name="stylusButtonPressable" />
+ <public type="attr" name="contextClickable" />
<public type="attr" name="supportsLaunchVoiceAssistFromKeyguard" />
<public type="attr" name="scrollIndicators" />
<public type="attr" name="hyphenationFrequency" />
diff --git a/core/res/res/values/symbols.xml b/core/res/res/values/symbols.xml
index 84f3d69..c7f27e1 100755
--- a/core/res/res/values/symbols.xml
+++ b/core/res/res/values/symbols.xml
@@ -1450,7 +1450,7 @@
<java-symbol type="array" name="config_longPressVibePattern" />
<java-symbol type="array" name="config_safeModeDisabledVibePattern" />
<java-symbol type="array" name="config_safeModeEnabledVibePattern" />
- <java-symbol type="array" name="config_stylusButtonPressVibePattern" />
+ <java-symbol type="array" name="config_contextClickVibePattern" />
<java-symbol type="array" name="config_virtualKeyVibePattern" />
<java-symbol type="attr" name="actionModePopupWindowStyle" />
<java-symbol type="attr" name="dialogCustomTitleDecorLayout" />
diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java
index 46793b9..a679358 100644
--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java
+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java
@@ -288,8 +288,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// Vibrator pattern for haptic feedback during boot when safe mode is enabled.
long[] mSafeModeEnabledVibePattern;
- // Vibrator pattern for haptic feedback of a stylus button press.
- long[] mStylusButtonPressVibePattern;
+ // Vibrator pattern for haptic feedback of a context click.
+ long[] mContextClickVibePattern;
/** If true, hitting shift & menu will broadcast Intent.ACTION_BUG_REPORT */
boolean mEnableShiftMenuBugReports = false;
@@ -1453,8 +1453,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
com.android.internal.R.array.config_safeModeDisabledVibePattern);
mSafeModeEnabledVibePattern = getLongIntArray(mContext.getResources(),
com.android.internal.R.array.config_safeModeEnabledVibePattern);
- mStylusButtonPressVibePattern = getLongIntArray(mContext.getResources(),
- com.android.internal.R.array.config_stylusButtonPressVibePattern);
+ mContextClickVibePattern = getLongIntArray(mContext.getResources(),
+ com.android.internal.R.array.config_contextClickVibePattern);
mScreenshotChordEnabled = mContext.getResources().getBoolean(
com.android.internal.R.bool.config_enableScreenshotChord);
@@ -6284,8 +6284,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
case HapticFeedbackConstants.SAFE_MODE_ENABLED:
pattern = mSafeModeEnabledVibePattern;
break;
- case HapticFeedbackConstants.STYLUS_BUTTON_PRESS:
- pattern = mStylusButtonPressVibePattern;
+ case HapticFeedbackConstants.CONTEXT_CLICK:
+ pattern = mContextClickVibePattern;
break;
default:
return false;