[bug] Crash on android while background mode
Description (bug summary)
Hello,
I have this crash on android that I can't reproduce on my side. Do you know where it could be coming from?
Step to reproduce (how to reproduce the bug)
- Run the app in background mode
- Crash
Platform (Android/iOS/macOS/Windows)
Android
Crashlog : MethodChannelScreenBrightness.application io.flutter.plugins.firebase.crashlytics.FlutterError - PlatformException(-10, Unexpected error on activity binding, null, null)
Hi @wayupdev, I cannot reproduce this crash with demo app. Are you crashing the with demo app? If so, what are the steps to reproduce it?
Hi @aaassseee,
Sorry for the delay, on my side, I couldn't reproduce this crash on both app (demo and my own app). I only have the crashlytics report
@wayupdev how do you use the plugin? Just light up when go to one page,?
I use it in different way, in one part of my app, I have made a progressive brightness fonction like that :
double brightness = min(0.7, (info.currentTime.inSeconds / 5).floorToDouble() / 100); ScreenBrightness.instance.setApplicationScreenBrightness(brightness);
In some other part, I am just setting a value :
ScreenBrightness.instance.setApplicationScreenBrightness(0.1);
I also have a brightness.manager (where the issue seems to came from) :
import 'package:screen_brightness/screen_brightness.dart';
class BrightNessManager { static BrightNessManager manager = BrightNessManager(); late double brightness;
Future
@wayupdev Will it be possible when progressive brightness changing when user quit the application?
Yes, I think the user puts the application in background and the package tries to modify the brightness without success, causing the crash.
@wayupdev pausing the application should not cause this issue. Can you repeat this issue on your side?
I'll try to reproduce it, and I'll keep you posted. Thanks for your help
Sure. If it crash on pause, this is a critical issue.