diff --git a/docs/.vuepress/components/Homepage.vue b/docs/.vuepress/components/Homepage.vue index 8b449f20..c7fb815c 100644 --- a/docs/.vuepress/components/Homepage.vue +++ b/docs/.vuepress/components/Homepage.vue @@ -139,6 +139,20 @@
Esper tool for provisioning
+ +API documentation
+ () { - @Override - public void onResponse(@Nullable UsbPermissionManager usbPermissionManager) { - // use UsbPermissionManager to perform needed actions - } - - @Override - public void onFailure(Throwable t) { - Log.e(TAG, "onFailure: ", t); - showFailureResult(t); - } -}); -``` - -### About the UsbPermissionManager - -Compared to the default permission manager of Android, this one can persist permissions across package re-installations, as this one uses the package name instead of UID. - -Here it is possible to grant or deny access for all USB devices and accessories to a package in one go, instead of the default one that operates on individual device identifiers. - -:::tip -Unless explicitly granted, permissions are considered denied by default. +:::tip API Migrated +Esper Foundation APIs are now available under a dedicated SDK named **Foundation SDK**. +For setup and migrating to the same, refer [Foundation API Reference](https://fsdk-api.esper.io/) ::: -### Check USB Access Permissions for an App - -Check the USB's access permissions for an app. - -**Parameters** -___ -| Parameter | Data Type | Description | -|-------------|-------------------------|--------------------------------------------------------------------------------| -| packageName | String | The package name of the application. | - - -**Responses** -_____ -| Response | Data Type | Description | -|----------|-----------|--------------------------------------------------| -| true | Boolean | Success | -| false | Boolean | Failure | - -**Usage** -____ - -```java -try { - boolean granted = usbPermissionManager.isAccessGranted("com.example.app"); -} catch (EsperSdkException t) { - Log.e(TAG, "onFailure: ", t); - showFailureResult(t); -} -``` - -### Grant or Deny USB Access Permissions for an App - -Grant or deny USB access permissions for an app. - -**Parameter** -___ -| Parameter | Data Type | Description | -|-------------|-------------------------|--------------------------------------------------------------------------------| -| packageName | String | The package name of the application. | - - -**Responses** -_____ -| Response | Data Type | Description | -|----------|-----------|--------------------------------------------------| -| true | Boolean | Success | -| false | Boolean | Failure | - -The example shown below will grant permissions to the app identified with package namecom.example.app. Grant status false will deny the permission.
-
-Once granted via here, the apps no more need to request for permission via ACTION_USB_PERMISSION intent.
-
-**Usage**
-___
-
-```java
-try {
- usbPermissionManager.setAccessGranted("com.example.app", true);
-} catch (EsperSdkException t) {
- Log.e(TAG, "onFailure: ", t);
- showFailureResult(t);
-}
-```
### Turn Wifi/Bluetooth for the Device to On/Off