fix(android): add UI-friendly permission status field names

The test app UI expects 'notificationsEnabled' and 'exactAlarmEnabled'
fields from checkPermissionStatus(), but the plugin only returned
technical field names ('postNotificationsGranted', 'exactAlarmGranted').

Added compatibility fields:
- notificationsEnabled = postNotificationsGranted && notificationsEnabledAtOsLevel
- exactAlarmEnabled = exactAlarmGranted

This ensures the UI can correctly display permission status after
granting permissions.
This commit is contained in:
Matthew Raymer
2025-12-25 09:58:29 +00:00
parent 95bf0f03c9
commit 78cd72529d

View File

@@ -194,6 +194,15 @@ public class PermissionManager {
result.put("channelEnabled", channelManager.isChannelEnabled());
result.put("channelImportance", channelManager.getChannelImportance());
// Add UI-friendly field names for compatibility
// notificationsEnabled = postNotificationsGranted AND notificationsEnabledAtOsLevel
boolean postNotificationsGranted = result.getBoolean("postNotificationsGranted", false);
boolean notificationsEnabledAtOsLevel = result.getBoolean("notificationsEnabledAtOsLevel", false);
result.put("notificationsEnabled", postNotificationsGranted && notificationsEnabledAtOsLevel);
// exactAlarmEnabled = exactAlarmGranted
boolean exactAlarmGranted = result.getBoolean("exactAlarmGranted", false);
result.put("exactAlarmEnabled", exactAlarmGranted);
call.resolve(result);
} catch (Exception e) {