public static class BleSetupHelper.BluetoothEnablerImpl
extends java.lang.Object
checkIsCustomPermissionRequired(java.lang.Object)
, checkIsCustomPermissionEnabled(java.lang.Object)
and
requestCustomPermission(java.lang.Object)
. See each individual method for more informationModifier and Type | Field and Description |
---|---|
protected BleSetupHelper |
mEnabler |
Constructor and Description |
---|
BluetoothEnablerImpl() |
Modifier and Type | Method and Description |
---|---|
boolean |
checkIsCustomPermissionEnabled(java.lang.Object metadata)
This method is used by the enabler to determine if a given custom permission enabled.
|
boolean |
checkIsCustomPermissionRequired(java.lang.Object metadata)
This method is used by the enabler to determine if a given custom permission is required.
|
java.lang.String |
getString(BleSetupHelper.DefaultString ds)
This method is used by the enabler to obtain strings that will be shown to the user.
|
protected void |
onCustomPermissionRequestComplete()
This method is only used if you are implementing custom permissions in a subclass.
|
void |
requestCustomPermission(java.lang.Object metadata)
This method implements the actual logic required to request a permission from the user.
|
void |
showDialog(BleSetupHelper.PermissionInstance pi,
java.lang.String message,
java.lang.String button1Text,
java.lang.String button2Text,
android.content.DialogInterface.OnClickListener clickListener,
android.content.DialogInterface.OnDismissListener dismissListener)
This method is responsible for creating and showing a dialog to the user.
|
void |
showToast(BleSetupHelper.PermissionInstance pi,
java.lang.String message)
This method is responsible for showing a toast to the user.
|
protected BleSetupHelper mEnabler
public java.lang.String getString(BleSetupHelper.DefaultString ds)
BleSetupHelper.DefaultString
for possible
enum valuesds
- - enum value for the string being requestedpublic boolean checkIsCustomPermissionRequired(java.lang.Object metadata)
metadata
- - the metadata associated with the custom permission being checkedpublic boolean checkIsCustomPermissionEnabled(java.lang.Object metadata)
metadata
- - the metadata associated with the custom permission being checkedpublic void requestCustomPermission(java.lang.Object metadata)
requestCustomPermission(Object)
afterward,
regardless of the outcome.metadata
- - the metadata associated with the custom permission being checkedprotected final void onCustomPermissionRequestComplete()
requestCustomPermission(Object)
method.public void showDialog(BleSetupHelper.PermissionInstance pi, java.lang.String message, java.lang.String button1Text, java.lang.String button2Text, android.content.DialogInterface.OnClickListener clickListener, android.content.DialogInterface.OnDismissListener dismissListener)
pi
- - the permission instance this dialog is associated withmessage
- - the message the dialog should displaybutton1Text
- - the text for the first button on the dialog (neutral, or positive in 2 button dialog)button2Text
- - the text for the negative button on the dialog, or null if there is only one buttonclickListener
- - the listener that must be called if the positive button is clicked,
or if the user agrees to allowing the permission in a custom UIdismissListener
- - the listener that must be called if the user declines to allow
the permission, or if the dialog is dismissed in any other waypublic void showToast(BleSetupHelper.PermissionInstance pi, java.lang.String message)
pi
- - the permission instance this toast is associated withmessage
- - the message the toast should display