SimpleCustomizationAction


class SimpleCustomizationAction : CustomizationAction
kotlin.Any
   ↳ android.hardware.input.CustomizationAction
   ↳ android.hardware.input.SimpleCustomizationAction

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

Summary

Constants
static Int

Action type: Assist.

static Int

Action type: Back.

static Int

Action type: Brightness down.

static Int

Action type: Brightness up.

static Int

Action type: Calculator.

static Int

Action type: Close window.

static Int

Action type: Contextual Insert.

static Int

Action type: Contextual Query.

static Int

Action type: Contextual Search.

static Int

Action type: Dictation.

static Int

Action type: Do nothing.

static Int

Action type: Emoji menu.

static Int

Action type: Forward.

static Int

Action type: Lock screen.

static Int

Action type: Media next.

static Int

Action type: Media play/pause.

static Int

Action type: Media previous.

static Int

Action type: Partial Screenshot.

static Int

Action type: Print screen.

static Int

Action type: Screen capture.

static Int

Action type: Show desktop.

static Int

Action type: Voice Assist.

static Int

Action type: Volume down.

static Int

Action type: Volume mute.

static Int

Action type: Volume up.

Public constructors

Creates a new SimpleCustomizationAction with the specified action type.

Public methods
Boolean
equals(other: Any?)

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

Int

Returns the specific type of action to be performed.

Int

Returns a hash code value for the object.

Constants

TYPE_ASSIST

static val TYPE_ASSIST: Int

Action type: Assist.

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

Value: 21

TYPE_BACK

static val TYPE_BACK: Int

Action type: Back.

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

Value: 1

TYPE_BRIGHTNESS_DOWN

static val TYPE_BRIGHTNESS_DOWN: Int

Action type: Brightness down.

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

Value: 2

TYPE_BRIGHTNESS_UP

static val TYPE_BRIGHTNESS_UP: Int

Action type: Brightness up.

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

Value: 3

TYPE_CALCULATOR

static val TYPE_CALCULATOR: Int

Action type: Calculator.

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

Value: 4

TYPE_CLOSE_WINDOW

static val TYPE_CLOSE_WINDOW: Int

Action type: Close window.

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

Value: 19

TYPE_CONTEXTUAL_INSERT

static val TYPE_CONTEXTUAL_INSERT: Int

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.

Value: 22

TYPE_CONTEXTUAL_QUERY

static val TYPE_CONTEXTUAL_QUERY: Int

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.

Value: 24
static val TYPE_CONTEXTUAL_SEARCH: Int

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.

Value: 23

TYPE_DICTATION

static val TYPE_DICTATION: Int

Action type: Dictation.

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

Value: 5

TYPE_DO_NOTHING

static val TYPE_DO_NOTHING: Int

Action type: Do nothing.

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

Value: 18

TYPE_EMOJI_MENU

static val TYPE_EMOJI_MENU: Int

Action type: Emoji menu.

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

Value: 6

TYPE_FORWARD

static val TYPE_FORWARD: Int

Action type: Forward.

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

Value: 7

TYPE_LOCK

static val TYPE_LOCK: Int

Action type: Lock screen.

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

Value: 8

TYPE_MEDIA_NEXT

static val TYPE_MEDIA_NEXT: Int

Action type: Media next.

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

Value: 9

TYPE_MEDIA_PLAY_PAUSE

static val TYPE_MEDIA_PLAY_PAUSE: Int

Action type: Media play/pause.

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

Value: 10

TYPE_MEDIA_PREVIOUS

static val TYPE_MEDIA_PREVIOUS: Int

Action type: Media previous.

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

Value: 11

TYPE_PARTIAL_SCREENSHOT

static val TYPE_PARTIAL_SCREENSHOT: Int

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.

Value: 20

TYPE_PRINT_SCREEN

static val TYPE_PRINT_SCREEN: Int

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 android.view.KeyEvent#KEYCODE_SYSRQ.

Value: 12

TYPE_SCREEN_CAPTURE

static val TYPE_SCREEN_CAPTURE: Int

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.

Value: 13

TYPE_SHOW_DESKTOP

static val TYPE_SHOW_DESKTOP: Int

Action type: Show desktop.

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

Value: 14

TYPE_VOICE_ASSIST

static val TYPE_VOICE_ASSIST: Int

Action type: Voice Assist.

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

Value: 25

TYPE_VOLUME_DOWN

static val TYPE_VOLUME_DOWN: Int

Action type: Volume down.

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

Value: 15

TYPE_VOLUME_MUTE

static val TYPE_VOLUME_MUTE: Int

Action type: Volume mute.

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

Value: 16

TYPE_VOLUME_UP

static val TYPE_VOLUME_UP: Int

Action type: Volume up.

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

Value: 17

Public constructors

SimpleCustomizationAction

SimpleCustomizationAction(actionType: Int)

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:
Exceptions
java.lang.IllegalArgumentException if the provided action type does not match any defined android.hardware.input.SimpleCustomizationAction.Type.

Public methods

equals

fun equals(other: Any?): Boolean

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
obj the reference object with which to compare.
Return
Boolean true if this object is the same as the obj argument; false otherwise.

getType

fun getType(): Int

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.

Return
Int the type of action.
Value is one of the following:

hashCode

fun hashCode(): Int

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.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.
Return
Int a hash code value for this object.