After the announcement of the new Samsung Galaxy S9 with the new camera that changes aperture, I caught myself wondering: if smartphones have such a wide aperture (f/2.8, f/2.2, etc), how are smartphones able to take landscape pictures, making everything in sharp focus with a fixed wide aperture? As far as my knowledge goes, it's necessary to use a smaller aperture (f/5.6, f/7, etc) to get a wider depth of field, and put all the landscape within focus. How do smartphones manage to accomplish that with a fixed wide aperture?
It's worth noting that sensor size plays a huge role in depth of field and behavior of the lens.
A smartphone has a tiny camera sensor, often around 25 square mm. This gives the camera a crop factor of about 6. (For the Samsung S9, I'm not sure about the dimensions.)
You can calculate the hyperfocal distance (or "depth of field") but you can also get a pretty good estimate by multiplying the f/ number by the crop factor to know what your effective f stop is. On a sensor of roughly 25 square mm, your F/2.2 behaves a lot like a f/13.2 aperture lens would on full frame.
If by "landscape" you mean something like this:
then the answer is simple: at very large distances, depth of field is extremely large even at large apertures. That is, at any aperture if you focus at infinity, objects 20m, 200m, and 2000m from you will be sharp.
However, focal length of the lens also influences depth of field, see answers below. Smaller sensors will have shorter lenses. You should also read "what exactly determines depth of field"
Aperture is only one factor in depth of field. Others are: sensor size and focal length. Large format camera lenses often have max apertures in f/4-f/5 range, yet they yield very shallow DOF - because both photosensitive element is huge and focal length is long (at comparable angle of view to a 35mm camera).
Phone cameras have tiny sensors and short focal lengths (like 26mm for the S8) to compensate. Even if you mount a 28mm lens on a DSLR, it's "infinity" starts at about 0.5-1m for lenses that short. So, once you set focus there, everything from 1m to actual infinity is in focus, making sharp landscapes a breeze.
Rule of thumb is: the smaller the camera, the larger the depth of field. That's why cool effects, like background separation, are very hard to achieve on phones.
/edit: As @hobbs noted, what we everyday call "aperture" is in fact relative aperture. Absolute aperture (entrance pupil) is the actual size of the "hole" you perceive when looking into the lens. User @Nayuki wrote a nice article about how relative and absolute apertures are related to focal length and mentioned in his answer.
You can easily compare it yourself - looking into lens of your phone you can easily see that its ~F/2 aperture is only 2-3mm wide, while a typical 35mm F/2.8 lens is that small when fully stepped down and when opened (you can hold DOF preview button for that) is at least a cm wide.