Page MenuHomePhabricator

[native] Prevent simulators from attempting to open the barcode scanner
ClosedPublic

Authored by rohan on Aug 14 2023, 8:50 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 24, 7:06 PM
Unknown Object (File)
Wed, Apr 24, 7:06 PM
Unknown Object (File)
Wed, Apr 24, 7:06 PM
Unknown Object (File)
Wed, Apr 24, 7:00 PM
Unknown Object (File)
Wed, Apr 24, 2:37 PM
Unknown Object (File)
Mar 8 2024, 6:26 AM
Unknown Object (File)
Feb 18 2024, 1:00 AM
Unknown Object (File)
Feb 18 2024, 12:29 AM
Subscribers

Details

Summary

Launching the barcode scanner on a simulator crashes the entire app (this is because it is not a compatible platform.

We should prevent this from being accessed in the simulator.

Addresses ENG-4647

Depends on D8805

Test Plan

Confirmed that the scanner no longer is launched when on a simulator.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

rohan edited the test plan for this revision. (Show Details)
rohan retitled this revision from [native] Prevent emulators from attempting to open the barcode scanner to [native] Prevent simulators from attempting to open the barcode scanner.
rohan requested review of this revision.Aug 14 2023, 9:07 AM
This revision is now accepted and ready to land.Aug 14 2023, 9:16 AM
native/profile/linked-devices-header-right-button.react.js
27 ↗(On Diff #29864)

The whole navigation object doesn't need to be here. That object changes rather often; in contrast, the simple function navigate changes rarely. It would be much better to only pass in the navigate function

native/utils/url-utils.js
81 ↗(On Diff #29864)

Now that we're exporting this, I think it might be helpful to rename it to deviceIsEmulator... dev feels ambiguous (could refer to "dev mode")