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 | |
|---|---|
SimpleCustomizationAction(actionType: Int)Creates a new |
|
| Public methods | |
|---|---|
| Boolean | |
| Int |
getType()Returns the specific type of action to be performed. |
| Int |
hashCode() |
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: 21TYPE_BACK
static val TYPE_BACK: Int
Action type: Back.
Specifies the action to go back when the peripheral input is triggered.
Value: 1TYPE_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: 2TYPE_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: 3TYPE_CALCULATOR
static val TYPE_CALCULATOR: Int
Action type: Calculator.
Specifies the action to launch calculator app when the peripheral input is triggered.
Value: 4TYPE_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: 19TYPE_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: 22TYPE_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: 24TYPE_CONTEXTUAL_SEARCH
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: 23TYPE_DICTATION
static val TYPE_DICTATION: Int
Action type: Dictation.
Specifies the action to start dictation when the peripheral input is triggered.
Value: 5TYPE_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: 18TYPE_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: 6TYPE_FORWARD
static val TYPE_FORWARD: Int
Action type: Forward.
Specifies the action to go forward when the peripheral input is triggered.
Value: 7TYPE_LOCK
static val TYPE_LOCK: Int
Action type: Lock screen.
Specifies the action to lock screen when the peripheral input is triggered.
Value: 8TYPE_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: 9TYPE_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: 10TYPE_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: 11TYPE_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: 20TYPE_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: 12TYPE_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: 13TYPE_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: 14TYPE_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: 25TYPE_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: 15TYPE_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: 16TYPE_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: 17Public 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
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.
hashCode
fun hashCode(): Int