public class CustomerMode
extends java.lang.Object
Unless you intend for all users of the device to be locked out of all other applications you should ensure that your application always has some way to exit customer mode so the operator (employees, manager, etc) can exit your app and manage the device.
See this page for several techniques to keep the screen on programmatically.
if (!Platform2.supportsFeature(context, Platform2.Feature.CUSTOMER_MODE)) { getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_LOW_PROFILE | View.SYSTEM_UI_FLAG_FULLSCREEN | 0x10000000); }
Modifier and Type | Class and Description |
---|---|
static class |
CustomerMode.State
State of customer mode.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_CUSTOMER_MODE
Broadcast Action: This is a sticky broadcast containing the customer mode state.
|
static java.lang.String |
EXTRA_CUSTOMER_MODE_STATE
String extra with one of the
CustomerMode.State enum values. |
static int |
WINDOW_FEATURE_CUSTOMER_MODE
Deprecated.
|
static int |
WINDOW_FEATURE_NO_CUSTOMER_MODE
Deprecated.
|
Constructor and Description |
---|
CustomerMode()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static void |
disable(Activity activity)
Disable customer mode.
|
static void |
disable(Activity activity,
boolean requireEmployeePasscode)
Disable customer mode.
|
static void |
disable(Context context)
Deprecated.
|
static void |
disable(Context context,
boolean requireEmployeePasscode)
Deprecated.
|
static void |
enable(Activity activity)
Enable customer mode.
|
static void |
enable(Context context)
Deprecated.
|
static CustomerMode.State |
getState(Activity activity)
Returns the current state of customer mode.
|
static CustomerMode.State |
getState(Context context)
Deprecated.
|
static CustomerMode.State |
getStateFromIntent(Intent intent)
Return the current state of customer mode given the
EXTRA_CUSTOMER_MODE_STATE string
that was obtained from a ACTION_CUSTOMER_MODE broadcast. |
static boolean |
isShownOnPrimaryDisplay(Activity activity)
Returns true if the given activity is shown on the primary display of a device capable of
entering customer mode.
|
static void |
registerReceiver(Activity activity,
BroadcastReceiver customerModeReceiver)
Convenience method to register broadcast receiver of customer mode change.
|
static void |
unregisterReceiver(Activity activity,
BroadcastReceiver customerModeReceiver)
Convenience method to unregister broadcast receiver of customer mode change.
|
public static final java.lang.String ACTION_CUSTOMER_MODE
public static final java.lang.String EXTRA_CUSTOMER_MODE_STATE
CustomerMode.State
enum values.@Deprecated public static final int WINDOW_FEATURE_CUSTOMER_MODE
@Deprecated public static final int WINDOW_FEATURE_NO_CUSTOMER_MODE
@Deprecated public CustomerMode()
@Deprecated public static void enable(Context context)
enable(Activity)
.public static void enable(Activity activity)
@Deprecated public static void disable(Context context)
disable(Activity)
.public static void disable(Activity activity)
@Deprecated public static void disable(Context context, boolean requireEmployeePasscode)
disable(Activity, boolean)
.requireEmployeePasscode
- true if you want to force the employee lockscreen to appear
without the "default employee" option if the merchant has
enabled "default employee".public static void disable(Activity activity, boolean requireEmployeePasscode)
requireEmployeePasscode
- true if you want to force the employee lockscreen to appear
without the "default employee" option if the merchant has
enabled "default employee".@Deprecated public static CustomerMode.State getState(Context context)
getState(Activity)
.public static CustomerMode.State getState(Activity activity)
public static boolean isShownOnPrimaryDisplay(Activity activity)
android.app.Activity#onCreate(Bundle)
. The value false indicates either the device
does not support customer mode at all (such as the original Clover Station) or the activity
is shown on secondary display.public static CustomerMode.State getStateFromIntent(Intent intent)
EXTRA_CUSTOMER_MODE_STATE
string
that was obtained from a ACTION_CUSTOMER_MODE
broadcast.public static void registerReceiver(Activity activity, BroadcastReceiver customerModeReceiver)
public static void unregisterReceiver(Activity activity, BroadcastReceiver customerModeReceiver)
Copyright © 2016 Clover Network, Inc. All Rights Reserved.