Skip to content

Read file length on background thread to avoid StrictMode violation #4539

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

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

lfkellogg
Copy link
Contributor

StrictMode policy violation: android.os.strictmode.DiskReadViolation
	at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1658)
	at libcore.io.BlockGuardOs.stat(BlockGuardOs.java:419)
	at libcore.io.ForwardingOs.stat(ForwardingOs.java:846)
	at android.app.ActivityThread$AndroidOs.stat(ActivityThread.java:7798)
	at java.io.UnixFileSystem.getLength(UnixFileSystem.java:298)
	at java.io.File.length(File.java:968)
	at com.google.firebase.appdistribution.impl.ApkUpdater.lambda$installApk$5$com-google-firebase-appdistribution-impl-ApkUpdater(ApkUpdater.java:101)
	at com.google.firebase.appdistribution.impl.ApkUpdater$$ExternalSyntheticLambda1.onFailure(Unknown Source:6)
	at com.google.android.gms.tasks.zzk.run(com.google.android.gms:play-services-tasks@@18.0.2:1)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1137)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:637)
	at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0$com-google-firebase-concurrent-CustomThreadFactory(CustomThreadFactory.java:47)
	at com.google.firebase.concurrent.CustomThreadFactory$$ExternalSyntheticLambda0.run(Unknown Source:4)
	at java.lang.Thread.run(Thread.java:1012)

@google-oss-bot
Copy link
Contributor

1 Warning
⚠️ Did you forget to add a changelog entry? (Add the 'no-changelog' label to the PR to silence this warning.)

Generated by 🚫 Danger

@google-oss-bot
Copy link
Contributor

Coverage Report 1

Affected Products

  • firebase-appdistribution

    Overall coverage changed from ? (d37ac1e) to 76.65% (300c6f2) by ?.

    44 individual files with coverage change

    FilenameBase (d37ac1e)Merge (300c6f2)Diff
    AabUpdater.java?98.41%?
    ApkInstaller.java?100.00%?
    ApkUpdater.java?92.93%?
    AppDistributionReleaseImpl.java?100.00%?
    AppDistributionReleaseInternal.java?100.00%?
    AppIconSource.java?84.62%?
    AutoValue_AppDistributionReleaseImpl.java?65.45%?
    AutoValue_AppDistributionReleaseInternal.java?71.58%?
    AutoValue_ImageUtils_ImageSize.java?35.00%?
    AutoValue_TesterApiDisabledErrorDetails.java?29.41%?
    AutoValue_TesterApiDisabledErrorDetails_HelpLink.java?54.17%?
    AutoValue_UpdateProgressImpl.java?65.96%?
    ErrorMessages.java?0.00%?
    FeedbackActivity.java?1.12%?
    FeedbackSender.java?86.67%?
    FirebaseAppDistributionExceptions.java?80.00%?
    FirebaseAppDistributionFileProvider.java?0.00%?
    FirebaseAppDistributionImpl.java?90.64%?
    FirebaseAppDistributionLifecycleNotifier.java?91.60%?
    FirebaseAppDistributionNotificationsManager.java?87.18%?
    FirebaseAppDistributionRegistrar.java?84.21%?
    FirebaseAppDistributionTesterApiClient.java?88.54%?
    HttpsUrlConnectionFactory.java?50.00%?
    ImageUtils.java?100.00%?
    InstallActivity.java?2.67%?
    LogWrapper.java?100.00%?
    NewReleaseFetcher.java?85.71%?
    PackageInfoUtils.java?42.86%?
    ReleaseIdentifier.java?87.95%?
    ReleaseUtils.java?83.33%?
    ScreenshotTaker.java?38.78%?
    SequentialReference.java?100.00%?
    SignInResultActivity.java?0.00%?
    SignInStorage.java?100.00%?
    TakeScreenshotAndStartFeedbackActivity.java?0.00%?
    TaskCache.java?100.00%?
    TaskCompletionSourceCache.java?72.41%?
    TaskUtils.java?77.50%?
    TesterApiDisabledErrorDetails.java?93.75%?
    TesterApiHttpClient.java?90.18%?
    TesterSignInManager.java?95.18%?
    UpdateProgressImpl.java?100.00%?
    UpdateTaskCache.java?91.30%?
    UpdateTaskImpl.java?76.32%?

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/nyECuZBvx9.html

@github-actions
Copy link
Contributor

github-actions bot commented Jan 6, 2023

Unit Test Results

172 tests   172 ✔️  46s ⏱️
  17 suites      0 💤
  17 files        0

Results for commit f73bbea.

@lfkellogg lfkellogg merged commit 5c69e85 into fad/in-app-feedback Jan 6, 2023
@lfkellogg lfkellogg deleted the lk/file-length-strict-mode branch January 6, 2023 22:41
@google-oss-bot
Copy link
Contributor

Size Report 1

Affected Products

  • base

    TypeBase (d37ac1e)Merge (300c6f2)Diff
    apk (aggressive)?8.39 kB? (?)
    apk (release)?8.65 kB? (?)
  • firebase-annotations

    TypeBase (d37ac1e)Merge (300c6f2)Diff
    apk (aggressive)?8.39 kB? (?)
    apk (release)?9.46 kB? (?)
  • firebase-appdistribution

    TypeBase (d37ac1e)Merge (300c6f2)Diff
    aar?194 kB? (?)
    apk (aggressive)?889 kB? (?)
    apk (release)?2.62 MB? (?)
  • firebase-appdistribution-api

    TypeBase (d37ac1e)Merge (300c6f2)Diff
    aar?16.0 kB? (?)
    apk (aggressive)?112 kB? (?)
    apk (release)?1.27 MB? (?)
  • firebase-common

    TypeBase (d37ac1e)Merge (300c6f2)Diff
    aar?67.4 kB? (?)
    apk (aggressive)?111 kB? (?)
    apk (release)?1.26 MB? (?)
  • firebase-components

    TypeBase (d37ac1e)Merge (300c6f2)Diff
    aar?44.9 kB? (?)
    apk (aggressive)?23.1 kB? (?)
    apk (release)?596 kB? (?)
  • firebase-installations

    TypeBase (d37ac1e)Merge (300c6f2)Diff
    aar?55.0 kB? (?)
    apk (aggressive)?116 kB? (?)
    apk (release)?1.28 MB? (?)
  • firebase-installations-interop

    TypeBase (d37ac1e)Merge (300c6f2)Diff
    aar?8.05 kB? (?)
    apk (aggressive)?65.0 kB? (?)
    apk (release)?651 kB? (?)

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/rbvCbnEcoh.html

@google-oss-bot
Copy link
Contributor

Startup Time Report 1

Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS.

Startup time comparison between the CI merge commit (300c6f2) and the base commit (d37ac1e) are not available.

No macrobenchmark data found for the base commit (d37ac1e). Analysis for the CI merge commit (300c6f2) can be found at:

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/mKlzGAZ3Ty/index.html

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

Successfully merging this pull request may close these issues.

3 participants