The AndrOBD Home Assistant plugin now includes proper runtime permission handling for Android 6.0+ (API 23+). This ensures users are properly informed about why permissions are needed and can grant them through the app's settings interface.
Status: Required for WiFi scanning on Android 6.0+
Why it's needed:
- Android requires location permission for WiFi scanning (security measure)
- Used to detect when home WiFi network is in range
- Enables automatic WiFi switching between OBD-II adapter and home network
- Optional feature: Send vehicle GPS location to Home Assistant (when enabled)
Important: The app does not track your location unless you explicitly enable the location tracking option. Location permission is primarily used for WiFi network detection as required by Android's security model. For journey monitoring and route efficiency tracking, you can optionally enable location transmission in the app settings.
Status: Required on Android 13+ (API 33+)
Why it's needed:
- Display foreground service notification (required by Android)
- Show network status indicator
- Display connection and transmission status updates
When the app is opened for the first time (or after permissions have been revoked):
- Permission Check: App automatically checks if required permissions are granted
- Explanation Dialog: If permissions are missing, a dialog explains what each permission is used for
- Permission Request: User can choose to:
- "Grant Permission" - Shows Android's permission request dialog
- "Not Now" - Dismisses the dialog (can grant later)
- "More Info" - Opens Android Settings for manual permission management
If user grants all permissions, a confirmation dialog shows:
- Scan for WiFi networks
- Detect home network proximity
- Enable automatic WiFi switching
- Display status notifications
- Optional: Track vehicle location (when enabled in settings)
If user denies any permission, a dialog explains the impact:
-
Location Denied:
- WiFi network scanning disabled
- Cannot detect when home network is in range
- Automatic WiFi switching unavailable
- Location sensor feature unavailable
-
Notifications Denied:
- Status notifications may not appear
- Network indicator may not display
The dialog provides a shortcut to Android Settings where permissions can be granted manually.
- Permission request only happens once on first launch
- Clear explanation before requesting permissions
- Users can choose to grant later
- Easy access to settings if permissions are denied
- Clear explanation of what each permission is used for
- Explicit statement that location is not tracked unless explicitly enabled
- List of features that will be enabled/disabled
- Follows Android best practices for runtime permissions
- Compatible with Android 6.0+ permission model
- Works on all Android versions (gracefully handles older versions)
- Uses AndroidX Core library for backward compatibility
- Checks Android version before requesting permissions
- Only requests POST_NOTIFICATIONS on Android 13+
The app handles three states:
- Granted: All features enabled
- Denied: Limited functionality, clear explanation provided
- Never Ask Again: Directs user to Settings
To test permission handling:
-
Grant Flow:
# Install app adb install app.apk # Open app - should show permission dialog # Grant permissions - should show confirmation
-
Denial Flow:
# Deny permissions when prompted # Should show limited functionality dialog
-
Reset Permissions:
# Clear app data to reset permissions adb shell pm clear com.fr3ts0n.androbd.plugin.homeassistant -
Manual Settings:
# Check current permissions adb shell dumpsys package com.fr3ts0n.androbd.plugin.homeassistant | grep permission
The location permission also enables a planned future feature:
- Send vehicle GPS coordinates to Home Assistant
- Create location-based automations (geo-fencing)
- Track vehicle location on map
- Historical trip logging with GPS data
This feature will be implemented in a future update and will respect user privacy:
- Optional (can be disabled in settings)
- Only sent when OBD-II is connected
- Not tracked when vehicle is off
- No background location tracking
- Check Android version (requires 6.0+)
- Ensure app is not in "Never Ask Again" state
- Clear app data and reinstall
- Restart the plugin service
- Check that permissions are actually granted in Android Settings
- Check logs for permission-related errors
Users can always manage permissions manually:
- Open Android Settings
- Go to Apps → AndrOBD Home Assistant
- Tap Permissions
- Enable/disable individual permissions
- WIFI_DEBUGGING_GUIDE.md - WiFi detection debugging
- README.md - General setup and configuration
- AndroidManifest.xml - Permission declarations