Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second call failed when invoked in succession #16

Open
innomatica opened this issue Dec 5, 2022 · 0 comments
Open

Second call failed when invoked in succession #16

innomatica opened this issue Dec 5, 2022 · 0 comments

Comments

@innomatica
Copy link

innomatica commented Dec 5, 2022

Describe the bug
I want to set different images for the lock screen and the home screen. So I called AsyncWallpaper.setWallpaperFromFile twice in succession:

    if (item.data.lockScreen != null) {
      await AsyncWallpaper.setWallpaperFromFile(
        filePath: item.data.lockScreen!,
        wallpaperLocation: AsyncWallpaper.LOCK_SCREEN,
      );
    }
    if (item.data.homeScreen != null) {
      await AsyncWallpaper.setWallpaperFromFile(
        filePath: item.data.homeScreen!,
        wallpaperLocation: AsyncWallpaper.HOME_SCREEN,
      );
    }

(edit) On emulator, it works always. However on real device, sometimes it works, but most of the time the second call doesn't. Log says:

I/Arguments (25285): configureFlutterEngine: /data/user/0/com.innomatic.ludiaapp/app_flutter/ddd_2238994064123313798.jpg
W/omatic.ludiaapp(25285): Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (unsupported,core-platform-api, reflection, allowed)
W/omatic.ludiaapp(25285): Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (unsupported,core-platform-api, reflection, allowed)
W/omatic.ludiaapp(25285): Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (unsupported,core-platform-api, reflection, allowed)
I/Arguments (25285): configureFlutterEngine: Image Downloaded
I/Arguments (25285): configureFlutterEngine: /data/user/0/com.innomatic.ludiaapp/app_flutter/ddd_2891432521155819000.jpg
I/Arguments (25285): configureFlutterEngine: Image Downloaded
E/libEGL  (25285): call to OpenGL ES API with no current context (logged once per thread)
E/SurfaceSyncer(25285): Failed to find sync for id=0

My guess is that if I can set both the lock screen and the home screen at the same call, problem can be solved.

Thanks,

Flutter:

  • 3.3.9
  • stable

Dart:

  • 2.18.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant