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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user