SimpleCustomizationAction


public final class SimpleCustomizationAction
extends CustomizationAction

java.lang.Object
   ↳ android.hardware.input.CustomizationAction
     ↳ android.hardware.input.SimpleCustomizationAction


Represents predefined simple actions, such as Volume up/down, Screenshot, etc.

Summary

Constants

int TYPE_ASSIST

Action type: Assist.

int TYPE_BACK

Action type: Back.

int TYPE_BRIGHTNESS_DOWN

Action type: Brightness down.

int TYPE_BRIGHTNESS_UP

Action type: Brightness up.

int TYPE_CALCULATOR

Action type: Calculator.

int TYPE_CLOSE_WINDOW

Action type: Close window.

int TYPE_CONTEXTUAL_INSERT

Action type: Contextual Insert.

int TYPE_CONTEXTUAL_QUERY

Action type: Contextual Query.

int TYPE_CONTEXTUAL_SEARCH

Action type: Contextual Search.

int TYPE_DICTATION

Action type: Dictation.

int TYPE_DO_NOTHING

Action type: Do nothing.

int TYPE_EMOJI_MENU

Action type: Emoji menu.

int TYPE_FORWARD

Action type: Forward.

int TYPE_LOCK

Action type: Lock screen.

int TYPE_MEDIA_NEXT

Action type: Media next.

int TYPE_MEDIA_PLAY_PAUSE

Action type: Media play/pause.

int TYPE_MEDIA_PREVIOUS

Action type: Media previous.

int TYPE_PARTIAL_SCREENSHOT

Action type: Partial Screenshot.

int TYPE_PRINT_SCREEN

Action type: Print screen.

int TYPE_SCREEN_CAPTURE

Action type: Screen capture.

int TYPE_SHOW_DESKTOP

Action type: Show desktop.

int TYPE_VOICE_ASSIST

Action type: Voice Assist.

int TYPE_VOLUME_DOWN

Action type: Volume down.

int TYPE_VOLUME_MUTE

Action type: Volume mute.

int TYPE_VOLUME_UP

Action type: Volume up.

Public constructors

SimpleCustomizationAction(int actionType)

Creates a new SimpleCustomizationAction with the specified action type.

Public methods

boolean equals(Object o)

Indicates whether some other object is "equal to" this one.

int getType()

Returns the specific type of action to be performed.

int hashCode()

Returns a hash code value for the object.

Inherited methods

Constants

TYPE_ASSIST

public static final int TYPE_ASSIST

Action type: Assist.

Specifies the action to launch the default assistant for textual input when the peripheral input is triggered.

Constant Value: 21 (0x00000015)

TYPE_BACK

public static final int TYPE_BACK

Action type: Back.

Specifies the action to go back when the peripheral input is triggered.

Constant Value: 1 (0x00000001)

TYPE_BRIGHTNESS_DOWN

public static final int TYPE_BRIGHTNESS_DOWN

Action type: Brightness down.

Specifies the action to decrease screen brightness when the peripheral input is triggered.

Constant Value: 2 (0x00000002)

TYPE_BRIGHTNESS_UP

public static final int TYPE_BRIGHTNESS_UP

Action type: Brightness up.

Specifies the action to increase screen brightness when the peripheral input is triggered.

Constant Value: 3 (0x00000003)

TYPE_CALCULATOR

public static final int TYPE_CALCULATOR

Action type: Calculator.

Specifies the action to launch calculator app when the peripheral input is triggered.

Constant Value: 4 (0x00000004)

TYPE_CLOSE_WINDOW

public static final int TYPE_CLOSE_WINDOW

Action type: Close window.

Specifies the action to close the currently focused window when the peripheral input is triggered.

Constant Value: 19 (0x00000013)

TYPE_CONTEXTUAL_INSERT

public static final int TYPE_CONTEXTUAL_INSERT

Action type: Contextual Insert.

Specifies the action to trigger a contextual panel for inserting content into the focused input field when the peripheral input is triggered.

Constant Value: 22 (0x00000016)

TYPE_CONTEXTUAL_QUERY

public static final int TYPE_CONTEXTUAL_QUERY

Action type: Contextual Query.

Specifies the action to launch the contextual cursor. When available, this intelligent pointer analyzes screen elements beneath the cursor (such as images or text paragraphs) and displays contextual suggestions to discover available actions (like copy, translate, or share) when the peripheral input is triggered.

Constant Value: 24 (0x00000018)

public static final int TYPE_CONTEXTUAL_SEARCH

Action type: Contextual Search.

Specifies the action to launch a search experience that allows the user to search for information about any content displayed on the screen - using gestures like circling, highlighting, or tapping - without switching apps, when the peripheral input is triggered.

Constant Value: 23 (0x00000017)

TYPE_DICTATION

public static final int TYPE_DICTATION

Action type: Dictation.

Specifies the action to start dictation when the peripheral input is triggered.

Constant Value: 5 (0x00000005)

TYPE_DO_NOTHING

public static final int TYPE_DO_NOTHING

Action type: Do nothing.

Specifies that no action should occur when the peripheral input is triggered, effectively swallowing the default hardware behavior.

Constant Value: 18 (0x00000012)

TYPE_EMOJI_MENU

public static final int TYPE_EMOJI_MENU

Action type: Emoji menu.

Specifies the action to show emoji menu when the peripheral input is triggered.

Constant Value: 6 (0x00000006)

TYPE_FORWARD

public static final int TYPE_FORWARD

Action type: Forward.

Specifies the action to go forward when the peripheral input is triggered.

Constant Value: 7 (0x00000007)

TYPE_LOCK

public static final int TYPE_LOCK

Action type: Lock screen.

Specifies the action to lock screen when the peripheral input is triggered.

Constant Value: 8 (0x00000008)

TYPE_MEDIA_NEXT

public static final int TYPE_MEDIA_NEXT

Action type: Media next.

Specifies the action to skip to the next media track when the peripheral input is triggered.

Constant Value: 9 (0x00000009)

TYPE_MEDIA_PLAY_PAUSE

public static final int TYPE_MEDIA_PLAY_PAUSE

Action type: Media play/pause.

Specifies the action to toggle media play/pause when the peripheral input is triggered.

Constant Value: 10 (0x0000000a)

TYPE_MEDIA_PREVIOUS

public static final int TYPE_MEDIA_PREVIOUS

Action type: Media previous.

Specifies the action to skip to the previous media track when the peripheral input is triggered.

Constant Value: 11 (0x0000000b)

TYPE_PARTIAL_SCREENSHOT

public static final int TYPE_PARTIAL_SCREENSHOT

Action type: Partial Screenshot.

Specifies the action to activate the system region capture utility to take a partial screenshot when the peripheral input is triggered.

Constant Value: 20 (0x00000014)

TYPE_PRINT_SCREEN

public static final int TYPE_PRINT_SCREEN

Action type: Print screen.

Specifies the action to take a snapshot that is first sent to the foreground app for handling. If the app does not consume it, the framework captures the screen, mimicking KeyEvent.KEYCODE_SYSRQ.

Constant Value: 12 (0x0000000c)

TYPE_SCREEN_CAPTURE

public static final int TYPE_SCREEN_CAPTURE

Action type: Screen capture.

Specifies the action to trigger a global framework-level screenshot. Unlike TYPE_PRINT_SCREEN, this action bypasses the foreground app and typically displays system UI tools for editing or sharing.

Constant Value: 13 (0x0000000d)

TYPE_SHOW_DESKTOP

public static final int TYPE_SHOW_DESKTOP

Action type: Show desktop.

Specifies the action to show desktop when the peripheral input is triggered.

Constant Value: 14 (0x0000000e)

TYPE_VOICE_ASSIST

public static final int TYPE_VOICE_ASSIST

Action type: Voice Assist.

Specifies the action to launch the default assistant for voice input when the peripheral input is triggered.

Constant Value: 25 (0x00000019)

TYPE_VOLUME_DOWN

public static final int TYPE_VOLUME_DOWN

Action type: Volume down.

Specifies the action to decrease the current system volume level when the peripheral input is triggered.

Constant Value: 15 (0x0000000f)

TYPE_VOLUME_MUTE

public static final int TYPE_VOLUME_MUTE

Action type: Volume mute.

Specifies the action to toggle the system mute state or mute the current volume when the peripheral input is triggered.

Constant Value: 16 (0x00000010)

TYPE_VOLUME_UP

public static final int TYPE_VOLUME_UP

Action type: Volume up.

Specifies the action to increase the current system volume level when the peripheral input is triggered.

Constant Value: 17 (0x00000011)

Public constructors

SimpleCustomizationAction

public SimpleCustomizationAction (int actionType)

Creates a new SimpleCustomizationAction with the specified action type.

Parameters
actionType int: The type of action to be performed, such as TYPE_SCREEN_CAPTURE.
Value is one of the following:
Throws
IllegalArgumentException if the provided action type does not match any defined ERROR(Type/android.hardware.input.SimpleCustomizationAction.Type Type).

Public methods

equals

public boolean equals (Object o)

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o Object: the reference object with which to compare.

Returns
boolean true if this object is the same as the obj argument; false otherwise.

getType

public int getType ()

Returns the specific type of action to be performed.

The returned value corresponds to one of the action type constants, such as TYPE_SCREEN_CAPTURE which defines the behavior triggered by the peripheral customization.

Returns
int the type of action.
Value is one of the following:

hashCode

public int hashCode ()

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

Returns
int a hash code value for this object.