diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 240aa5dc..c7e8bd64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,7 +105,8 @@ jobs: key: avd-${{ matrix.api-level }} - name: Create AVD and generate snapshot for caching - if: steps.avd-cache.outputs.cache-hit != 'true' + if: steps.avd-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/main' + timeout-minutes: 10 uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} @@ -119,6 +120,7 @@ jobs: - name: Run integration tests id: Run-integration-tests continue-on-error: true + timeout-minutes: 10 uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} @@ -135,6 +137,7 @@ jobs: - name: Retry integration tests id: Retry-integration-tests continue-on-error: true + timeout-minutes: 10 if: steps.Run-integration-tests.outcome == 'failure' uses: reactivecircus/android-emulator-runner@v2 with: @@ -155,6 +158,7 @@ jobs: - name: Re:Retry integration tests if: steps.Retry-integration-tests.outcome == 'failure' + timeout-minutes: 10 uses: reactivecircus/android-emulator-runner@v2 with: api-level: ${{ matrix.api-level }} diff --git a/.gitignore b/.gitignore index 1b30512c..9c649e26 100644 --- a/.gitignore +++ b/.gitignore @@ -16,8 +16,6 @@ migrate_working_dir/ *.iws .idea/ -.vscode/ - # Flutter/Dart/Pub related # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. pubspec.lock @@ -32,10 +30,9 @@ build/ # Android related *.iml .gradle -/local.properties +local.properties /.idea/workspace.xml /.idea/libraries -/build /captures .cxx /android/app/release @@ -54,16 +51,11 @@ key.properties .vagrant/ .sconsign.dblite .svn/ - .DS_Store *.swp profile DerivedData/ -build/ -GeneratedPluginRegistrant.h -GeneratedPluginRegistrant.m - .generated/ *.pbxuser @@ -86,38 +78,24 @@ Icon? .tags* **/Flutter/Generated.xcconfig -/Flutter/ephemeral/ -**/Flutter/flutter_export_environment.sh -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ +ios/Flutter/ephemeral/ .sconsign.dblite .tags* **/.vagrant/ **/DerivedData/ -Icon? **/Pods/ **/.symlinks/ profile xcuserdata **/.generated/ -Flutter/App.framework -Flutter/Flutter.framework + +App.framework +Flutter.framework Flutter.podspec Generated.xcconfig -Flutter/ephemeral/ flutter_export_environment.sh -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 +ServiceDefinitions.json +GeneratedPluginRegistrant.* # Example related **/doc/api/ diff --git a/android/src/main/java/studio/midoridesign/gal/GalPlugin.java b/android/src/main/java/studio/midoridesign/gal/GalPlugin.java index 4620c51a..e6e759ea 100644 --- a/android/src/main/java/studio/midoridesign/gal/GalPlugin.java +++ b/android/src/main/java/studio/midoridesign/gal/GalPlugin.java @@ -66,8 +66,9 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { new Thread(() -> { try { putMedia(pluginBinding.getApplicationContext(), - (String) call.argument("path"), (String) call.argument("album"), + call.argument("path"), call.argument("album"), call.method.contains("Image")); + new Handler(Looper.getMainLooper()).post(() -> result.success(null)); } catch (Exception e) { handleError(e, result); @@ -79,7 +80,8 @@ public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { new Thread(() -> { try { putMediaBytes(pluginBinding.getApplicationContext(), - (byte[]) call.argument("bytes"), (String) call.argument("album")); + call.argument("bytes"), call.argument("album")); + new Handler(Looper.getMainLooper()).post(() -> result.success(null)); } catch (Exception e) { handleError(e, result);