public class PermissionManager extends BaseSubManager
This should be used through the SdlManager and not be instantiated by itself
| Modifier and Type | Class and Description |
|---|---|
static interface |
com.smartdevicelink.managers.permission.BasePermissionManager.PermissionGroupStatus |
static interface |
com.smartdevicelink.managers.permission.BasePermissionManager.PermissionGroupType |
| Modifier and Type | Field and Description |
|---|---|
static int |
PERMISSION_GROUP_STATUS_ALLOWED |
static int |
PERMISSION_GROUP_STATUS_DISALLOWED |
static int |
PERMISSION_GROUP_STATUS_MIXED |
static int |
PERMISSION_GROUP_STATUS_UNKNOWN |
static int |
PERMISSION_GROUP_TYPE_ALL_ALLOWED |
static int |
PERMISSION_GROUP_TYPE_ANY |
ERROR, internalInterface, LIMITED, READY, SETTING_UP, SHUTDOWN| Constructor and Description |
|---|
PermissionManager(ISdl internalInterface)
Creates a new instance of the PermissionManager
|
| Modifier and Type | Method and Description |
|---|---|
UUID |
addListener(List<PermissionElement> permissionElements,
int groupType,
OnPermissionChangeListener listener)
Add a listener to be called when there is permissions change.
|
void |
dispose()
Clean up everything after the manager is no longer needed
|
int |
getGroupStatusOfPermissions(List<PermissionElement> permissionElements)
Determine if a group of permissions is allowed for the current HMI level
|
boolean |
getRequiresEncryption()
Gets the encryption requirement
|
boolean |
getRPCRequiresEncryption(FunctionID rpcName)
Checks if an RPC requires encryption
|
Map<FunctionID,PermissionStatus> |
getStatusOfPermissions(List<PermissionElement> permissionElements)
Determine if a group of permissions is allowed for the current HMI level
This method is similar to getGroupStatusOfPermissions() but returns more detailed result about each individual permission
|
boolean |
isPermissionParameterAllowed(FunctionID rpcName,
String parameter)
Determine if an individual permission parameter is allowed for current permission items and current HMI level
|
boolean |
isRPCAllowed(FunctionID rpcName)
Determine if an individual RPC is allowed for the current permission items and HMI level
|
void |
removeListener(UUID listenerId)
Removes specific listener
|
void |
start(CompletionListener listener)
Starts up a BaseSubManager, and calls provided callback once BaseSubManager is done setting up or failed setup.
|
getState, handleTransportUpdated, onTransportUpdate, transitionToStatepublic static final int PERMISSION_GROUP_STATUS_ALLOWED
public static final int PERMISSION_GROUP_STATUS_DISALLOWED
public static final int PERMISSION_GROUP_STATUS_MIXED
public static final int PERMISSION_GROUP_STATUS_UNKNOWN
public static final int PERMISSION_GROUP_TYPE_ALL_ALLOWED
public static final int PERMISSION_GROUP_TYPE_ANY
public PermissionManager(@NonNull
ISdl internalInterface)
internalInterface - public void start(CompletionListener listener)
BaseSubManagerstart in class BaseSubManagerlistener - CompletionListener that is called once the BaseSubManager's state is READY, LIMITED, or ERRORpublic boolean getRPCRequiresEncryption(@NonNull
FunctionID rpcName)
rpcName - the rpc name (FunctionID) to checkpublic boolean getRequiresEncryption()
public boolean isRPCAllowed(@NonNull
FunctionID rpcName)
rpcName - rpcName FunctionID value that represents the name of the RPCpublic boolean isPermissionParameterAllowed(@NonNull
FunctionID rpcName,
@NonNull
String parameter)
rpcName - FunctionID value that represents the name of the RPCparameter - String value that represents a parameter for the RPCpublic void dispose()
dispose in class BaseSubManagerpublic int getGroupStatusOfPermissions(@NonNull
List<PermissionElement> permissionElements)
permissionElements - list of PermissionElement that represents the RPC names and their parametersBasePermissionManager.PermissionGroupStatuspublic Map<FunctionID,PermissionStatus> getStatusOfPermissions(@NonNull List<PermissionElement> permissionElements)
permissionElements - list of PermissionElement that represents the RPC names and their parameterspublic UUID addListener(@NonNull List<PermissionElement> permissionElements, int groupType, @NonNull OnPermissionChangeListener listener)
permissionElements - list of PermissionElement that represents the RPC names and their parametersgroupType - PermissionGroupType int value represents whether we need the listener to be called when there is any permissions change or only when all permission become allowedlistener - OnPermissionChangeListener interfacepublic void removeListener(@NonNull
UUID listenerId)
listenerId - the id of the listener