From 8f5168e5c4fecfc7b67ea3a471d5cce3bbed7888 Mon Sep 17 00:00:00 2001 From: Jitesh Singh Date: Wed, 1 Feb 2023 19:39:04 +0530 Subject: [PATCH 1/2] adds a new tile in homepage to point to fsdk docs --- docs/.vuepress/components/Homepage.vue | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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 +
+
Foundation SDK Reference
+

API documentation

+
Date: Tue, 7 Feb 2023 21:34:19 +0530 Subject: [PATCH 2/2] updates DeviceSDK UsbPermissionsManager API doc with api migration notice --- docs/home/devicesdk.md | 100 ++--------------------------------------- 1 file changed, 4 insertions(+), 96 deletions(-) diff --git a/docs/home/devicesdk.md b/docs/home/devicesdk.md index 86039eb0..3a042ebe 100644 --- a/docs/home/devicesdk.md +++ b/docs/home/devicesdk.md @@ -1314,105 +1314,13 @@ sdk.clearUsbDeviceWhitelistForPackage( }); ``` -### Get USB Permission Manager +### USB Permission Manager -Returns an instance of `UsbPermissionManager` which can be used for granting or denying USB device/accessory access permissions to packages. - -:::warning Requirements -Only available for x86, x86_64 and arm64 GSI devices running Esper Foundation for Android. -::: - -**Usage** -____ - -```java -sdk.getUsbPermissionManager(new EsperDeviceSDK.Callback() { - @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 name com.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