enum BatteryOptimizationState {
  unrestricted,
  optimized,
  restricted,
  unknown,
}

class BatteryOptimizationGuidance {
  const BatteryOptimizationGuidance();

  String messageFor(BatteryOptimizationState state) => switch (state) {
        BatteryOptimizationState.unrestricted =>
          'Background protection is allowed to run without battery restrictions.',
        BatteryOptimizationState.optimized =>
          'Android may delay background tracking. Allow unrestricted battery usage for continuous protection.',
        BatteryOptimizationState.restricted =>
          'Background tracking is restricted. Open system settings and allow background activity for Digital Chaukidar.',
        BatteryOptimizationState.unknown =>
          'Battery optimization status is unavailable on this device.',
      };

  bool shouldShowSettingsAction(BatteryOptimizationState state) =>
      state == BatteryOptimizationState.optimized ||
      state == BatteryOptimizationState.restricted;
}
