mozilla-mobile / fenix

⚠️ Fenix (Firefox for Android) moved to a new repository. It is now developed and maintained as part of: https://github.com/mozilla-mobile/firefox-android
https://github.com/mozilla-mobile/firefox-android
Mozilla Public License 2.0
6.47k stars 1.27k forks source link

[Crash] With Camera permission Off, app crashes when trying to scan Pairing QR code @ android.content.ActivityNotFoundException: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java) #15079

Closed sv-ohorvath closed 4 years ago

sv-ohorvath commented 4 years ago

Steps to reproduce

  1. Turn off the app's camera permission from system settings. Or deny it when requested.
  2. Go to sign in to sync and choose to scan QR code.
  3. When the notification to turn on Camera permission is displayed, tap Go to Settings.

    Expected behavior

    App settings are displayed.

    Actual behavior

    App crashes. Crash report: https://crash-stats.mozilla.org/report/index/7cd7537f-274e-4198-9401-6ac410200914 @ android.content.ActivityNotFoundException: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java)

    Device information

┆Issue is synchronized with this Jira Task

ekager commented 4 years ago
android.content.ActivityNotFoundException
    at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:1809)
    at android.app.Instrumentation.execStartActivity(Instrumentation.java:1523)
    at android.app.Activity.startActivityForResult(Activity.java:4225)
    at androidx.fragment.app.FragmentActivity.startActivityForResult(FragmentActivity.java:6)
    at androidx.core.app.ActivityCompat.startActivityForResult(ActivityCompat.java:2)
    at androidx.fragment.app.FragmentActivity.startActivityFromFragment(FragmentActivity.java:2)
    at androidx.fragment.app.Fragment.startActivity(Fragment.java:4)
    at androidx.fragment.app.Fragment.startActivity(Fragment.java:1)
    at org.mozilla.fenix.settings.PairFragment$showPermissionsNeededDialog$$inlined$apply$lambda$1.onClick(PairFragment.kt:18)
    at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:3)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6119)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
eliserichards commented 4 years ago

The data needs to be set for the URI. Opening a PR

eliserichards commented 4 years ago

For QA: see #15097 description for test cases 😄

sv-ohorvath commented 4 years ago

Verified as fixed on Nightly 9/18. Devices: Pixel 4(android 10), HTC Desire 820 (android 6.0.1), Huawei P20 lite (android 9), Nexus 5 (android 5.1)