Added in API level 37

ShowSecretsSetting


public final class ShowSecretsSetting
extends Object

java.lang.Object
   ↳ android.text.ShowSecretsSetting


This is the API surface for interacting with the settings that determine whether characters in password inputs or other secret fields are echoed briefly or hidden immediately.

Summary

Public methods

static Runnable registerCallback(Context context, Runnable callback)

Registers a callback to be notified when show password settings change.

static Runnable registerCallback(Context context, Executor executor, Runnable callback)

Registers a callback to be notified when show password settings change.

static boolean shouldShowPhysicalInput(Context context)

Returns true when characters entered into a password, pin or other secret field from hardware/physical input sources should either be shown or echoed briefly.

static boolean shouldShowTouchInput(Context context)

Returns true when characters entered into a password, pin or other secret field from touch/virtual input sources should either be shown or echoed briefly.

Inherited methods

Public methods

registerCallback

Added in API level 37
public static Runnable registerCallback (Context context, 
                Runnable callback)

Registers a callback to be notified when show password settings change. The callback will be invoked on the main thread.

Parameters
context Context: The context used to access settings.
This value cannot be null.

callback Runnable: The callback to invoke.
This value cannot be null.

Returns
Runnable A runnable that unregisters the callback when run.
This value cannot be null.

registerCallback

Added in API level 37
public static Runnable registerCallback (Context context, 
                Executor executor, 
                Runnable callback)

Registers a callback to be notified when show password settings change.

Parameters
context Context: The context used to access settings.
This value cannot be null.

executor Executor: The executor on which to invoke the callback.
This value cannot be null.
Callback and listener events are dispatched through this Executor, providing an easy way to control which thread is used. To dispatch events through the main thread of your application, you can use Context.getMainExecutor(). Otherwise, provide an Executor that dispatches to an appropriate thread.

callback Runnable: The callback to invoke.
This value cannot be null.

Returns
Runnable A runnable that unregisters the callback when run.
This value cannot be null.

shouldShowPhysicalInput

Added in API level 37
public static boolean shouldShowPhysicalInput (Context context)

Returns true when characters entered into a password, pin or other secret field from hardware/physical input sources should either be shown or echoed briefly.

Parameters
context Context: This value cannot be null.

Returns
boolean

shouldShowTouchInput

Added in API level 37
public static boolean shouldShowTouchInput (Context context)

Returns true when characters entered into a password, pin or other secret field from touch/virtual input sources should either be shown or echoed briefly.

Parameters
context Context: This value cannot be null.

Returns
boolean