-
- All Implemented Interfaces:
-
java.io.Serializable,kotlin.Comparable
public enum DoorstepPermission extends Enum<DoorstepPermission>
A runtime-permission bucket the SDK can request, named in Android's own vocabulary rather than a cross-platform lowest common denominator.
One bucket maps to one user-visible OS decision, which is why it is a bucket and not a permission string: "foreground location" is two manifest permissions (Manifest.permission.ACCESS_FINE_LOCATION + Manifest.permission.ACCESS_COARSE_LOCATION) behind a single dialog, and BLE scanning is a different pair of manifest permissions depending on API level.
Buckets are the unit of the whitelist accepted by DoorstepAI.requestPermissions and DoorstepAI.checkPermissions: only the buckets you name are ever requested. Omitting the whitelist requests all of them.
Cross-platform note: iOS has its own
DoorstepPermissionwithlocationWhenInUse/locationAlways/motionFitness/bluetooth. The two location buckets and the state vocabulary (DoorstepPermissionState) are deliberately identical; the rest differ because the platforms differ. NEARBY_WIFI_DEVICES and NOTIFICATIONS have no iOS counterpart in this SDK, and iOS'smotionFitnesshas no Android counterpart beyond ACTIVITY_RECOGNITION (Android's IMU streams need no runtime permission at all).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDoorstepPermission.Companion
-
Enum Constant Summary
Enum Constants Enum Constant Description NOTIFICATIONSNotifications — Manifest.permission.POST_NOTIFICATIONS (API 33+).
The SDK's foreground service posts a notification; a denied grant does not stop collection, it only hides the notification. Implicitly granted below API 33.
NEARBY_WIFI_DEVICESNearby WiFi devices — Manifest.permission.NEARBY_WIFI_DEVICES (API 33+), needed by WiFi RTT ranging (
wifi.rttEnabled).Shares the OS "Nearby devices" permission group with BLUETOOTH_SCAN, so whichever of the two is requested second is granted silently without a second dialog. Reports DoorstepPermissionState.UNAVAILABLE below API 33, where the permission does not exist (RTT falls back to fine location).
BLUETOOTH_SCANBLE scanning — Manifest.permission.BLUETOOTH_SCAN on API 31+; Manifest.permission.BLUETOOTH_ADMIN + fine location on API ≤30, where scan results are gated on location rather than a dedicated permission.
On API ≤30 this bucket therefore cannot be granted independently of LOCATION_WHEN_IN_USE — that is the OS contract, not an SDK choice.
Reports DoorstepPermissionState.UNAVAILABLE on hardware with no BLE (PackageManager.FEATURE_BLUETOOTH_LE absent).
ACTIVITY_RECOGNITIONPhysical activity — Manifest.permission.ACTIVITY_RECOGNITION (API 29+).
Optional for the SDK: it gates
TYPE_STEP_COUNTER/TYPE_STEP_DETECTORonly. Without it those two streams stay empty (getDefaultSensorreturns null) and everything else collects normally, which is why it is absent from the legacy DoorstepAI.getRequiredPermissions list.The SDK's own manifest deliberately does NOT declare it, so hosts are not forced to carry a permission most of them do not want. Declare
ACTIVITY_RECOGNITIONin your host manifest to use this bucket; until you do, it reports DoorstepPermissionState.NOT_DECLARED rather than silently failing to prompt.LOCATION_ALWAYSBackground location — Manifest.permission.ACCESS_BACKGROUND_LOCATION (API 29+), required to keep collecting while the host app is backgrounded or the screen is off, and required by route geofencing (
GeofenceManager.hasLocationPermissiondemands fine and background).Android forbids bundling this with the foreground request — on API 30+ a bundled ask is auto-denied — so the SDK never puts it in the same request batch as anything else. See DoorstepAI.requestPermissions for the deferral contract.
Below API 29 there is no separate grant: the permission is implicitly held, and this bucket reports DoorstepPermissionState.GRANTED.
LOCATION_WHEN_IN_USEForeground location — Manifest.permission.ACCESS_FINE_LOCATION + Manifest.permission.ACCESS_COARSE_LOCATION, one OS dialog.
The SDK cannot start a session without this (
DoorstepAI.startDelivery*refuses), and it is the prerequisite for LOCATION_ALWAYS.
-
Method Summary
Modifier and Type Method Description final List<String>manifestPermissions(Integer sdkInt)The manifest permissions this bucket resolves to on sdkInt, or an empty list when the bucket needs no runtime grant at that API level (either the permission does not exist yet, or it is implicitly held). final StringgetWireName()final StringgetName()final IntegergetOrdinal()-
-
Method Detail
-
manifestPermissions
final List<String> manifestPermissions(Integer sdkInt)
The manifest permissions this bucket resolves to on sdkInt, or an empty list when the bucket needs no runtime grant at that API level (either the permission does not exist yet, or it is implicitly held). Use PermissionLogic.evaluate to tell those two cases apart.
-
getWireName
final String getWireName()
-
getOrdinal
final Integer getOrdinal()
-
-
-
-