Google's Pixel 2 and 2 XL have an edge squeeze functionality, called Active Edge, which can summon Google Assistant if you grip the phone tightly, but can't be set to do anything else. But XDA developer flar2, the creator of the Button Mapper app, has found a way to remap the squeeze to perform another task, all without the need for root. There is a caveat, though. It takes 14 steps to enable another function through Active Edge. And because Google hard-coded the Assistant into the squeeze gesture, the Button Mapper app needs to launch it first, before opening up anything...
Source: https://www.gsmarena.com/you_can_now_remap_the_squeeze_on_the_pixel_2_to_do_something_else-news-27836.php